Ejemplo n.º 1
0
  public void setUp() {
    varNums = new int[] {0, 1, 2};

    TensorBuilder builder = tensorFactory.getBuilder(varNums, new int[] {1000, 100, 100});
    for (int i = 0; i < 10000000; i++) {
      builder.put(new int[] {(i / 10000), (i / 100) % 100, i % 100}, 1.0);
    }
    table012 = builder.build();
    table012Copy = builder.build();

    builder = tensorFactory.getBuilder(new int[] {0, 1}, new int[] {1000, 100});
    for (int i = 0; i < 100000; i++) {
      builder.put(new int[] {i / 100, i % 100}, 1.0);
    }
    table01 = builder.build();

    builder = tensorFactory.getBuilder(new int[] {1, 2}, new int[] {100, 100});
    for (int i = 0; i < 10000; i++) {
      builder.put(new int[] {i / 100, i % 100}, 1.0);
    }
    table12 = builder.build();

    firstTestArray = new double[1000000];
    secondTestArray = new double[1000000];
    firstArrayKeys = new long[1000000];
    secondArrayKeys = new long[1000000];
    for (int i = 0; i < 100000; i++) {
      firstTestArray[i] = i;
      secondTestArray[i] = i + 1;
      firstArrayKeys[i] = i;
      secondArrayKeys[i] = i;
    }
  }
Ejemplo n.º 2
0
 @PerformanceTest
 public void testBuild() {
   TensorBuilder builder = tensorFactory.getBuilder(varNums, new int[] {100, 100, 10});
   for (int i = 0; i < 100000; i++) {
     builder.put(new int[] {(i / 1000), (i / 100) % 10, i % 10}, 1.0);
   }
   builder.build();
 }