I need to add a number of matrces to an arraylist or some sort of collection in order to recall them at a later stage
I have tried the arraylist and arraycopy
List<Double> al = new ArrayList<>();
double [][] k = new double [d.length][d[0].length];
System.arraycopy (d,0,k,0,d.length);
for (int i1 =0; i1 < d.length; i1++)
k[i1] = k.add(D[i1]);
al.add(k[i1]);
for (Integer x : k)
System.out.print(x + " ");
print2D(k);
I need an array of say 4x4 matrices
If I do say al.add(d); I get error: cannot find suitable method to add double
even when al.add(Matrix)