Examples of IntArrayCallback


Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

  }

  @Test
  public void nodeAndLeafCount() {
    final List<int[]> list = Lists.newArrayList();
    IntArrayCallback callback = new ListCollector(list);
    for (int n = 0; n < 8; ++n) {
      list.clear();
      // Exact sum means that no array will be a prefix of another one.
      TestUtils.generateSpecWithExactSum(n, 2 * n, callback);
      Collections.sort(list, IntArrayComparator.INSTANCE);
View Full Code Here

Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

  }

  @Test
  public void oneNodeAtMost() {
    final List<int[]> list = Lists.newArrayList();
    IntArrayCallback callback = new ListCollector(list);
    for (int n = 0; n < 8; ++n) {
      list.clear();
      // Exact sum means that no array will be a prefix of another one.
      TestUtils.generateSpecWithExactSum(n, 2 * n, callback);
      Collections.sort(list, IntArrayComparator.INSTANCE);
View Full Code Here

Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

  }

  @Test
  public void subtreeIsOptimalWithinConstraints() {
    final List<int[]> list = Lists.newArrayList();
    IntArrayCallback callback = new ListCollector(list);
    for (int n = 0; n < 3; ++n) {
      list.clear();
      // Exact sum means that no array will be a prefix of another one.
      TestUtils.generateSpecWithExactSum(n, 2 * n, callback);
      Collections.sort(list, IntArrayComparator.INSTANCE);
View Full Code Here

Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

    List<List<MapNode<K, V>>> result = Lists.newArrayList();
    assert exactNodes > 1;
    if (exactNodes > node.getChildren().size()) {
      final List<MapNode<K, V>> children = ImmutableList.copyOf(node.getChildren().values());
      final List<List<List<List<MapNode<K, V>>>>> childrenExpansions = Lists.newArrayList();
      IntArrayCallback callback = new IntArrayCallback() {
        @Override
        public void call(int[] m) {
          assert m.length <= children.size();
          if (m.length == children.size()) {
            List<List<List<MapNode<K, V>>>> expansionSet = Lists.newArrayList();
View Full Code Here

Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

    }
  }
 
  @Test
  public void compactHilbertIndexInverse() {
    TestUtils.generateSpec(4, 6, new IntArrayCallback() {
      @Override
      public void call(int[] m) {
        matchHilbertIndexWithInverse(m);
      }
    });
View Full Code Here

Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

    EasyMock.verify(mock);
  }
 
  @Test
  public void allSpaceInquiredWhenChildrenAreAlwaysRequested() {
    TestUtils.generateSpec(4, 7, new IntArrayCallback() {
      @Override
      public void call(int[] m) {
        gatherAllIndexEnds(m);
      }
    });
View Full Code Here

Examples of com.google.uzaygezen.core.TestUtils.IntArrayCallback

    }
  }

  @Test
  public void generate() {
    IntArrayCallback mock = EasyMock.createMock(IntArrayCallback.class);
    final int maxSum = 10;
    mock.call(EasyMock.aryEq(new int[0]));
    for (int i = 0; i <= maxSum; ++i) {
      mock.call(EasyMock.aryEq(new int[] {i}));
      for (int j = 0; j <= maxSum - i; ++j) {
        mock.call(EasyMock.aryEq(new int[] {i, j}));
        for (int k = 0; k <= maxSum - i - j; ++k) {
          mock.call(EasyMock.aryEq(new int[] {i, j, k}));
        }
      }
    }
    EasyMock.replay(mock);
    TestUtils.generateSpec(3, maxSum, mock);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.