protected Vector createCopy(Vector vector) {
   if (RANDOM.nextBoolean()) {
     return DenseVectorFactoryMTJ.INSTANCE.copyVector(vector);
   } else {
     return SparseVectorFactoryMTJ.INSTANCE.copyVector(vector);
   }
 }
  protected Vector createVector(int numDim) {

    if (RANDOM.nextBoolean()) {
      return DenseVectorFactoryMTJ.INSTANCE.createVector(numDim);
    } else {
      return SparseVectorFactoryMTJ.INSTANCE.createVector(numDim);
    }
  }
示例#3
0
  private void generateAndAddShift(final String locale) {
    Entity shift = dataDefinitionService.get(L_BASIC_PLUGIN_IDENTIFIER, "shift").create();

    shift.setField(
        L_NAME,
        getNameFromNumberAndPrefix("Shift-", generateString(CHARS_ONLY, RANDOM.nextInt(40) + 5)));

    for (int i = 0; i < SHIFT_HOURS.length; i++) {
      shift.setField(WORK_SHIFT[i], RANDOM.nextBoolean());
      shift.setField(SHIFT_HOURS[i], generateWorkingHours(locale));
    }

    dataDefinitionService.get(L_BASIC_PLUGIN_IDENTIFIER, "shift").save(shift);
  }