@Test public void testFactoryCopy() { int[] shape1 = new int[] {1, 2, 3}; Array<Short> array1 = Arrays.factory(DataType.SHORT, shape1, new short[] {1, 2, 3, 4, 5, 6}); Array<Short> array2 = Arrays.factory(DataType.SHORT, shape1, new short[] {7, 8, 9, 10, 11, 12}); int[] shape = new int[] {2, 2, 3}; Array<Short> array = Arrays.factoryCopy(DataType.SHORT, shape, ImmutableList.of(array1, array2)); assertThat(array.get(0, 0, 0)).isEqualTo(1); assertThat(array.get(0, 0, 1)).isEqualTo(2); assertThat(array.get(0, 0, 2)).isEqualTo(3); assertThat(array.get(0, 1, 0)).isEqualTo(4); assertThat(array.get(0, 1, 1)).isEqualTo(5); assertThat(array.get(0, 1, 2)).isEqualTo(6); assertThat(array.get(1, 0, 0)).isEqualTo(7); assertThat(array.get(1, 0, 1)).isEqualTo(8); assertThat(array.get(1, 0, 2)).isEqualTo(9); assertThat(array.get(1, 1, 0)).isEqualTo(10); assertThat(array.get(1, 1, 1)).isEqualTo(11); assertThat(array.get(1, 1, 2)).isEqualTo(12); int count = 0; for (short val : array) { assertThat(val).isEqualTo(count + 1); count++; } }
@Override public Short get(int... index) { return storage.get(indexFn.get(index)); }
ArrayShort extends Array<Short> { @Override public Short get(int... index) { return storage.get(indexFn.get(index)); } }
ArrayShort extends Array<Short> { @Override public Short get(int... index) { return storage.get(indexFn.get(index)); } ArrayShort(DataType dtype, int[] shape);  ArrayShort(DataType dtype, int[] shape, Storage<Short> storage); private  ArrayShort(DataType dtype, IndexFn indexFn, Storage<Short> storageD); }
ArrayShort extends Array<Short> { @Override public Short get(int... index) { return storage.get(indexFn.get(index)); } ArrayShort(DataType dtype, int[] shape);  ArrayShort(DataType dtype, int[] shape, Storage<Short> storage); private  ArrayShort(DataType dtype, IndexFn indexFn, Storage<Short> storageD); @Override Iterator<Short> fastIterator(); @Override Iterator<Short> iterator(); @Override Short get(int... index); @Override Short get(Index index); }
ArrayShort extends Array<Short> { @Override public Short get(int... index) { return storage.get(indexFn.get(index)); } ArrayShort(DataType dtype, int[] shape);  ArrayShort(DataType dtype, int[] shape, Storage<Short> storage); private  ArrayShort(DataType dtype, IndexFn indexFn, Storage<Short> storageD); @Override Iterator<Short> fastIterator(); @Override Iterator<Short> iterator(); @Override Short get(int... index); @Override Short get(Index index);  }