I have been scavenging thru the documentation of apache common core math library to search for this answer but havent been able to find the answer.. http://commons.apache.org/proper/commons-math/apidocs/org/apache/commons/math4/linear/RealMatrix.html
How do we construct or initialize a matrix with default value.
So, I see we can do this
RealMatrix X = new BlockRealMatrix(numRows, numCols);
or
double[][] matrixData = { {1d,2d,3d}, {2d,5d,3d}};
RealMatrix m = MatrixUtils.createRealMatrix(matrixData);
But how do i construct a matrix and initialize it to all (say) 2.. (or 0 in my case), rather than explicitly creating the double[][]
Thanks