/** * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns. * For example, if the receiver is an instance of type <tt>DenseDoubleMatrix2D</tt> the new matrix must also be of type <tt>DenseDoubleMatrix2D</tt>, * if the receiver is an instance of type <tt>SparseDoubleMatrix2D</tt> the new matrix must also be of type <tt>SparseDoubleMatrix2D</tt>, etc. * In general, the new matrix should have internal parametrization as similar as possible. * * @param rows the number of rows the matrix shall have. * @param columns the number of columns the matrix shall have. * @return a new empty matrix of the same dynamic type. */ public DoubleMatrix2D like(int rows, int columns) { return new RCDoubleMatrix2D(rows,columns); } /**
/** * Construct and returns a new empty matrix <i>of the same dynamic type</i> as the receiver, having the specified number of rows and columns. * For example, if the receiver is an instance of type <tt>DenseDoubleMatrix2D</tt> the new matrix must also be of type <tt>DenseDoubleMatrix2D</tt>, * if the receiver is an instance of type <tt>SparseDoubleMatrix2D</tt> the new matrix must also be of type <tt>SparseDoubleMatrix2D</tt>, etc. * In general, the new matrix should have internal parametrization as similar as possible. * * @param rows the number of rows the matrix shall have. * @param columns the number of columns the matrix shall have. * @return a new empty matrix of the same dynamic type. */ public DoubleMatrix2D like(int rows, int columns) { return new RCDoubleMatrix2D(rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public DoubleMatrix2D make(int rows, int columns) { if (this==sparse) return new SparseDoubleMatrix2D(rows,columns); if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns); //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns); else return new DenseDoubleMatrix2D(rows,columns); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public DoubleMatrix2D make(int rows, int columns) { if (this==sparse) return new SparseDoubleMatrix2D(rows,columns); if (this==rowCompressed) return new RCDoubleMatrix2D(rows,columns); //if (this==rowCompressedModified) return new RCMDoubleMatrix2D(rows,columns); else return new DenseDoubleMatrix2D(rows,columns); } /**