@Test public void testReshape() { int[] reshape = new int[] {3, 2, 1}; Array<Double> pArray = Arrays.reshape(array, reshape); assertThat(pArray.get(0, 0, 0)).isEqualTo(1); assertThat(pArray.get(0, 1, 0)).isEqualTo(2); assertThat(pArray.get(1, 0, 0)).isEqualTo(3); assertThat(pArray.get(1, 1, 0)).isEqualTo(4); assertThat(pArray.get(2, 0, 0)).isEqualTo(5); assertThat(pArray.get(2, 1, 0)).isEqualTo(6); reshape = new int[] {6, 1, 1}; pArray = Arrays.reshape(array, reshape); assertThat(pArray.get(0, 0, 0)).isEqualTo(1); assertThat(pArray.get(1, 0, 0)).isEqualTo(2); assertThat(pArray.get(2, 0, 0)).isEqualTo(3); assertThat(pArray.get(3, 0, 0)).isEqualTo(4); assertThat(pArray.get(4, 0, 0)).isEqualTo(5); assertThat(pArray.get(5, 0, 0)).isEqualTo(6); reshape = new int[] {2, 3, 1}; pArray = Arrays.reshape(array, reshape); assertThat(pArray.get(0, 0, 0)).isEqualTo(1); assertThat(pArray.get(0, 1, 0)).isEqualTo(2); assertThat(pArray.get(0, 2, 0)).isEqualTo(3); assertThat(pArray.get(1, 0, 0)).isEqualTo(4); assertThat(pArray.get(1, 1, 0)).isEqualTo(5); assertThat(pArray.get(1, 2, 0)).isEqualTo(6); try { reshape = new int[] {2, 2, 2}; Arrays.reshape(array, reshape); fail(); } catch (Exception e) { assertThat(e).isInstanceOf(IllegalArgumentException.class); } }
public static <T> Array<T> reshape(Array<T> org, int[] shape) { return org.createView(org.indexFn().reshape(shape)); }
Arrays { public static <T> Array<T> reshape(Array<T> org, int[] shape) { return org.createView(org.indexFn().reshape(shape)); } }
Arrays { public static <T> Array<T> reshape(Array<T> org, int[] shape) { return org.createView(org.indexFn().reshape(shape)); }  }
Arrays { public static <T> Array<T> reshape(Array<T> org, int[] shape) { return org.createView(org.indexFn().reshape(shape)); }  static Array<T> factory(DataType dataType, int[] shape, Storage<T> storage); static Array<T> factory(DataType dataType, int[] shape, Object dataArray); static Array<T> factory(DataType dataType, int[] shape); static Array<T> factoryCopy(DataType dataType, int[] shape, List<Array<T>> dataArrays); static Array<T> factoryArrays(DataType dataType, int[] shape, List<Array<?>> dataArrays); static Array<T> flip(Array<T> org, int dim); static Array<T> permute(Array<T> org, int[] dims); static Array<T> reshape(Array<T> org, int[] shape); static Array<T> reduce(Array<T> org); static Array<T> reduce(Array<T> org, int dim); static Array<T> section(Array<T> org, List<Range> ranges); static Array<T> slice(Array<T> org, int dim, int value); static Array<T> transpose(Array<T> org, int dim1, int dim2); static long computeSize(int[] shape); static boolean isVariableLength(int[] shape); static int[] removeVlen(int[] shape); }
Arrays { public static <T> Array<T> reshape(Array<T> org, int[] shape) { return org.createView(org.indexFn().reshape(shape)); }  static Array<T> factory(DataType dataType, int[] shape, Storage<T> storage); static Array<T> factory(DataType dataType, int[] shape, Object dataArray); static Array<T> factory(DataType dataType, int[] shape); static Array<T> factoryCopy(DataType dataType, int[] shape, List<Array<T>> dataArrays); static Array<T> factoryArrays(DataType dataType, int[] shape, List<Array<?>> dataArrays); static Array<T> flip(Array<T> org, int dim); static Array<T> permute(Array<T> org, int[] dims); static Array<T> reshape(Array<T> org, int[] shape); static Array<T> reduce(Array<T> org); static Array<T> reduce(Array<T> org, int dim); static Array<T> section(Array<T> org, List<Range> ranges); static Array<T> slice(Array<T> org, int dim, int value); static Array<T> transpose(Array<T> org, int dim1, int dim2); static long computeSize(int[] shape); static boolean isVariableLength(int[] shape); static int[] removeVlen(int[] shape);  }