Can I resize a matrix?
Resizing depends on the matrix implementation. A dense matrix is fixed in size, as the data is stored in a double[][] array.
However, some matrix implementations allow resizing. For example, you can create a sparse matrix with MatrixFactory.sparse(0, 0) and then change the size dynamically with matrix.setSize(5, 5). Note that sparse matrices are much slower than dense matrices.
It might be better to append one matrix to another for resizing:
Matrix matrix = Matrix.zeros(5, 5); Matrix newRow = Matrix.zeros(1, 5);
Matrix biggerMatrix = matrix.appendVertically(newRow);
or
Matrix biggerMatrix = MatrixFactory.vertCat(matrix, newRow);

