Vector Manipulation Layer (VectorLib)


reshapeMatrix
to reshape size of matrix data



FUNCTIONS

int[][] - reshapeMatrix(int[] in, int col, int row)
double[][] - reshapeMatrix(double[] in, int col, int row)
String[][] - reshapeMatrix(String[] in, int col, int row)
int[][] - reshapeMatrix(int[][] in, int col, int row)
double[][] - reshapeMatrix(double[][] in, int col, int row)
String[][] - reshapeMatrix(String[][] in, int col, int row)




EXAMPLES

Example VectorLib vlib=new VectorLib();
int[] data={7, 4};
int[][] output=vlib.reshapeMatrix(a, 2, 3);
vlib.view("Output", output);
Output Output =
7      4      7      4
7      4      7      4
7      4      7      4


Example VectorLib vlib=new VectorLib();
double[] data={7.5, 4.3};
double[][] output=vlib.reshapeMatrix(a, 2, 1);
vlib.view("Output", output);
Output Output =
7.5      4.3      7.5      4.3


Example VectorLib vlib=new VectorLib();
String[] data={"A", "B"};
int[][] output=vlib.reshapeMatrix(a, 1, 2);
vlib.view("Output", output);
Output Output =
A      B
A      B


Example VectorLib vlib=new VectorLib();
int[][] data={{7, 4}, {8, 2}};
int[][] output=vlib.reshapeMatrix(a, 1, 2);
vlib.view("Output", output);
Output Output =
7      4
8      2
7      4
8      2


Example VectorLib vlib=new VectorLib();
double[][] data={{7.1, 4.9}, {8.5, 2.3}};
double[][] output=vlib.reshapeMatrix(a, 2, 1);
vlib.view("Output", output);
Output Output =
7.1      4.9      7.1      4.9
8.5      2.3      8.5      2.3


Example VectorLib vlib=new VectorLib();
String[][] data={{"A", "B"}, {"C", "D"}};
String[][] output=vlib.reshapeMatrix(a, 2, 3);
vlib.view("Output", output);
Output Output =
A      B      A      B
C      D      C      D
A      B      A      B
C      D      C      D
A      B      A      B
C      D      C      D