code: public static DMatrixRMaj parse_DDRM(String s , int numColumns )
      {
          String []vals = s.split("(\\s)+");
  
          // there is the possibility the first element could be empty
          int start = vals[0].isEmpty() ? 1 : 0;
  
          // covert it from string to doubles
          int numRows = (vals.length-start) / numColumns;
  
          DMatrixRMaj ret = new DMatrixRMaj(numRows,numColumns);
  
          int index = start;
          for( int i = 0; i < numRows; i++ ) {
              for( int j = 0; j < numColumns; j++ ) {
                  ret.set(i,j, Double.parseDouble(vals[ index++ ]));
              }
          }
  
          return ret;
      }
docs: Give a string of numbers it returns a DenseMatrix