@Test public void testContents() { final int[] a = new int[] {1, 2, 3}; final IntVec v = new IntVec(a); assertEquals(a.length, v.dim()); for (int i = 0; i < a.length; ++i) { assertEquals(a[i], v.get(i)); } }
@Test public void testAdvanceV() { final int[] b = new int[5]; for (int i = 0; i < 3; ++i) { b[i + 1] = i + 1; } final IntVec bv = new IntVec(b); final SeqLE seq = new SeqLE(bv); final int[] x = new int[5]; int n = 0; do { for (int i = 0; i < x.length; ++i) { assertTrue((x[i] >= 0) && (x[i] <= bv.get(i))); } ++n; } while (seq.advance(x)); assertEquals(24, n); }