protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) { return new SparseDoubleMatrix2D(rows, columns, this.elements, rowZero, columnZero, rowStride, columnStride); }
public ParallelColtSparseDoubleMatrix2D(int rows, int columns) { super(rows, columns); this.matrix = new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
protected DoubleMatrix2D like2D(int rows, int columns, int rowZero, int columnZero, int rowStride, int columnStride) { return new SparseDoubleMatrix2D(rows, columns, this.elements, rowZero, columnZero, rowStride, columnStride); }
public ParallelColtSparseDoubleMatrix2D(int rows, int columns) { super(rows, columns); this.matrix = new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like2D(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
public DoubleMatrix2D like(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
/** * Construct and returns a new 2-d matrix <i>of the corresponding dynamic * type</i>, entirelly independent of the receiver. For example, if the * receiver is an instance of type <tt>DenseDoubleMatrix1D</tt> the new * matrix must be of type <tt>DenseDoubleMatrix2D</tt>, if the receiver is * an instance of type <tt>SparseDoubleMatrix1D</tt> the new matrix must be * of type <tt>SparseDoubleMatrix2D</tt>, etc. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public DoubleMatrix2D like2D(int rows, int columns) { return new SparseDoubleMatrix2D(rows, columns); }
/** * Construct and returns a new 2-d matrix <i>of the corresponding dynamic * type</i>, entirelly independent of the receiver. For example, if the * receiver is an instance of type <tt>DenseDoubleMatrix1D</tt> the new * matrix must be of type <tt>DenseDoubleMatrix2D</tt>, if the receiver is * an instance of type <tt>SparseDoubleMatrix1D</tt> the new matrix must be * of type <tt>SparseDoubleMatrix2D</tt>, etc. * * @param rows * the number of rows the matrix shall have. * @param columns * the number of columns the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public DoubleMatrix2D like2D(int rows, int columns) { return new SparseDoubleMatrix2D(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); } 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); } else { return new DenseDoubleMatrix2D(rows, columns); } }
public DoubleMatrix2D reshape(int rows, int columns) { if (rows * columns != size) { throw new IllegalArgumentException("rows*columns != size"); } DoubleMatrix2D M = new SparseDoubleMatrix2D(rows, columns); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { M.setQuick(r, c, getQuick(idx++)); } } return M; }
public DoubleMatrix2D reshape(int rows, int columns) { if (rows * columns != size) { throw new IllegalArgumentException("rows*columns != size"); } DoubleMatrix2D M = new SparseDoubleMatrix2D(rows, columns); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { M.setQuick(r, c, getQuick(idx++)); } } return M; }
public DoubleMatrix2D reshape(int rows, int columns) { if (rows * columns != size) { throw new IllegalArgumentException("rows*columns != size"); } DoubleMatrix2D M = new SparseDoubleMatrix2D(rows, columns); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { double elem = getQuick(idx++); if (elem != 0) { M.setQuick(r, c, elem); } } } return M; }
public DoubleMatrix2D reshape(int rows, int columns) { if (rows * columns != size) { throw new IllegalArgumentException("rows*columns != size"); } DoubleMatrix2D M = new SparseDoubleMatrix2D(rows, columns); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { double elem = getQuick(idx++); if (elem != 0) { M.setQuick(r, c, elem); } } } return M; }