code: public static Matrix fromCSV(String csv) {
          StringTokenizer lines = new StringTokenizer(csv, "\n");
          Matrix result = DenseMatrix.zero(10, 10);
          int rows = 0;
          int columns = 0;
  
          while (lines.hasMoreTokens()) {
              if (result.rows() == rows) {
                  result = result.copyOfRows((rows * 3) / 2 + 1);
              }
  
              StringTokenizer elements = new StringTokenizer(lines.nextToken(), ", ");
              int j = 0;
              while (elements.hasMoreElements()) {
                  if (j == result.columns()) {
                      result = result.copyOfColumns((j * 3) / 2 + 1);
                  }
  
                  double x = Double.parseDouble(elements.nextToken());
                  result.set(rows, j++, x);
              }
  
              rows++;
              columns = j > columns ? j : columns;
          }
  
          return result.copyOfShape(rows, columns);
      }
docs: Parses {@link Matrix} from the given CSV string.
  
  @param csv the string in CSV format
  
  @return a parsed matrix