public static double[][] random(int m,int n){
  double[][] matres=new double[m][];
  for (int i=0; i < m; ++i) {
    matres[i]=new double[n];
    for (int j=0; j < n; ++j) {
      matres[i][j]=Math.random();
    }
  }
  return (matres);
}

public static double [ ] [ ] random ( int m , int n ) { double [ ] [ ] matres = new double [ m ] [ ] ; for ( int i = 0 ; i < m ; ++ i ) { matres [ i ] = new double [ n ] ; for ( int j = 0 ; j < n ; ++ j ) { matres [ i ] [ j ] = Math . random ( ) ; } } return ( matres ) ; }
generates a random m * n matrix object .
