165166167168169170171172173174175
source[ 0 ] = 0; source[ 1 ] = 0; source[ 2 ] = 0; source[ 3 ] = 0; t.apply( source, target ); for ( int d = 0; d < 4; ++d ) { expectedSource[ d ] = source[ d ]; source[ d ] = -1; }
178179180181182183184185186187188
source[ 0 ] = 0; source[ 1 ] = 0; source[ 2 ] = 0; source[ 3 ] = 1; t.apply( source, target ); for ( int d = 0; d < 4; ++d ) { expectedSource[ d ] = source[ d ]; source[ d ] = -1; }
191192193194195196197198199200201
source[ 0 ] = 9; source[ 1 ] = 4; source[ 2 ] = 2; source[ 3 ] = 3; t.apply( source, target ); for ( int d = 0; d < 4; ++d ) { expectedSource[ d ] = source[ d ]; source[ d ] = -1; }
5556575859606162636465
final long[] expectedTarget = new long[ 1 ]; source[ 0 ] = 0; source[ 1 ] = 0; expectedTarget[ 0 ] = 0; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 0; expectedTarget[ 0 ] = 5;
6162636465666768697071
assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 0; expectedTarget[ 0 ] = 5; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 1; expectedTarget[ 0 ] = 15;
6768697071727374757677
assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 1; expectedTarget[ 0 ] = 15; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); } @Test public void test3Dto1D()
8586878889909192939495
source[ 0 ] = 0; source[ 1 ] = 0; source[ 2 ] = 0; expectedTarget[ 0 ] = 0; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 0; source[ 2 ] = 0;
9293949596979899100101102
source[ 0 ] = 5; source[ 1 ] = 0; source[ 2 ] = 0; expectedTarget[ 0 ] = 5; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 1; source[ 2 ] = 0;
99100101102103104105106107108109
source[ 0 ] = 5; source[ 1 ] = 1; source[ 2 ] = 0; expectedTarget[ 0 ] = 15; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); source[ 0 ] = 5; source[ 1 ] = 4; source[ 2 ] = 3;
106107108109110111112113114115116
source[ 0 ] = 5; source[ 1 ] = 4; source[ 2 ] = 3; expectedTarget[ 0 ] = 5 + 4 * 10 + 3 * 20 * 10; t.apply( source, target ); assertArrayEquals( expectedTarget, target ); } @Test public void test4Dto3D()