Random.nextDouble
returns a double
, so in the code above you are calling this constructor:
Matrix(int m, int n, double s)
Which constructs a m-by-n constant Matrix.
You should just call this static method instead:
public static Matrix random(int m, int n)
E.g.,
Matrix mR = Matrix.random(3, 3);
See the doc for more information.