public void TestLengthEqualToBreadth() { var generator = new SequenceIndexGenerator(2, 0, 2, Order.Upwards); CheckSequence(generator, 0, 1); generator = new SequenceIndexGenerator(2, 1, 2, Order.Downwards); CheckSequence(generator, 1, 0); }
public void TestCreateInverse() { IndexGenerator generator = new SequenceIndexGenerator(2, 0); CheckSequence(generator, 0, 1); generator = generator.CreateInverse(); CheckSequence(generator, 1, 0); generator = generator.CreateInverse(); CheckSequence(generator, 0, 1); }
public void TestSwap() { IndexGenerator generator = new SequenceIndexGenerator(2, 0); CheckSequence(generator, 0, 1); generator = generator.CreateSwaped(); CheckSequence(generator, 1, 0); generator = generator.CreateSwaped(); CheckSequence(generator, 0, 1); }
public void TestCreateInvers01() { IndexGenerator generator = new SequenceIndexGenerator(4, 0); CheckSequence(generator, 0, 1, 2, 3); generator = generator.CreateInverse(); CheckSequence(generator, 3, 2, 1, 0); generator = generator.CreateInverse(); CheckSequence(generator, 0, 1, 2, 3); }
public void TestOddUpwards2SubUpwards() { var generator = new SequenceIndexGenerator(5, 0, 2, Order.Upwards); CheckSequence(generator, 0, 1, 3, 2, 4, null); }
public void TestOddUpwards2SubDownwards() { var generator = new SequenceIndexGenerator(5, 1, 2, Order.Downwards); CheckSequence(generator, 1, 0, 2, 3, null, 4); }
public void TestOddDownwards2SubUpwards() { var generator = new SequenceIndexGenerator(5, 3, 2, Order.Upwards); CheckSequence(generator, 3, 4, 2, 1, null, 0); }
public void TestOddDownwards2SubDownwards() { var generator = new SequenceIndexGenerator(5, 4, 2, Order.Downwards); CheckSequence(generator, 4, 3, 1, 2, 0, null); }
public void TestLowerToUpper() { var generator = new SequenceIndexGenerator(3, 0); CheckSequence(generator, 0, 1, 2); }
public void TestEvenUpwards2SubDownwards() { var generator = new SequenceIndexGenerator(4, 1, 2, Order.Downwards); CheckSequence(generator, 1, 0, 2, 3); }
public void TestEvenDownwards2SubUpwards() { var generator = new SequenceIndexGenerator(4, 2, 2, Order.Upwards); CheckSequence(generator, 2, 3, 1, 0); }
public void TestEvenDownwards2SubDownwards() { var generator = new SequenceIndexGenerator(4, 3, 2, Order.Downwards); CheckSequence(generator, 3, 2, 0, 1); }
public void TestStartSubOrderWithBreadthOf1() { var generator = new SequenceIndexGenerator(2, 1, 1, Order.Upwards); CheckSequence(generator, 1, 0); generator = new SequenceIndexGenerator(2, 1, 1, Order.Downwards); CheckSequence(generator, 1, 0); generator = new SequenceIndexGenerator(2, 0, 1, Order.Upwards); CheckSequence(generator, 0, 1); generator = new SequenceIndexGenerator(2, 0, 1, Order.Downwards); CheckSequence(generator, 0, 1); }
private static DimensionDescription CreateIncrementDescriptionSerpentine(int max, DimensionAssignment assignment, int breadth, Order startSubOrder) { var generator = new SequenceIndexGenerator(max, 0, breadth, startSubOrder); return new DimensionDescription(max, assignment, generator); }
public void TestEvenUpwards2SubUpwards() { var generator = new SequenceIndexGenerator(4, 0, 2, Order.Upwards); CheckSequence(generator, 0, 1, 3, 2); }
public DimensionDescription Generate() { IndexGenerator indexGenerator; if (Mode == TraverseMode.Serpentine) indexGenerator = new SequenceIndexGenerator(Length, Start, Breadth, StartSubOrder); else if (Mode == TraverseMode.Circular) indexGenerator = new CircularIndexGenerator(Length, Start, Breadth, StartSubOrder); else throw new InvalidOperationException(); return new DimensionDescription(Length, Assignment, indexGenerator); }
private static DimensionDescription CreateIncrementDescriptionSerpentine(int max, DimensionAssignment assignment) { var generator = new SequenceIndexGenerator(max, 0); return new DimensionDescription(max, assignment, generator); }