public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
protected DoubleMatrix1D like1D(int size, int offset, int stride) { return new SparseDoubleMatrix1D(size, this.elements, offset, stride); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
protected DoubleMatrix1D like1D(int size, int offset, int stride) { return new SparseDoubleMatrix1D(size, this.elements, offset, stride); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
/** * Construct and returns a new 1-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>DenseDoubleMatrix2D</tt> the new * matrix must be of type <tt>DenseDoubleMatrix1D</tt>, if the receiver is * an instance of type <tt>SparseDoubleMatrix2D</tt> the new matrix must be * of type <tt>SparseDoubleMatrix1D</tt>, etc. * * @param size * the number of cells the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
public DoubleMatrix1D like1D(int size) { return new SparseDoubleMatrix1D(size); }
/** * Construct and returns a new empty matrix <i>of the same dynamic type</i> * as the receiver, having the specified size. For example, if the receiver * is an instance of type <tt>DenseDoubleMatrix1D</tt> the new matrix must * also be of type <tt>DenseDoubleMatrix1D</tt>, if the receiver is an * instance of type <tt>SparseDoubleMatrix1D</tt> the new matrix must also * be of type <tt>SparseDoubleMatrix1D</tt>, etc. In general, the new matrix * should have internal parametrization as similar as possible. * * @param size * the number of cell the matrix shall have. * @return a new empty matrix of the same dynamic type. */ public DoubleMatrix1D like(int size) { return new SparseDoubleMatrix1D(size); }
/** * Constructs a matrix with the given shape, each cell initialized with * zero. */ public DoubleMatrix1D make(int size) { if (this == sparse) return new SparseDoubleMatrix1D(size); return new DenseDoubleMatrix1D(size); }
/** * Constructs a matrix with the given shape, each cell initialized with * zero. */ public DoubleMatrix1D make(int size) { if (this == sparse) return new SparseDoubleMatrix1D(size); return new DenseDoubleMatrix1D(size); }
/** * Constructs a matrix with the given cell values. The values are copied. So * subsequent changes in <tt>values</tt> are not reflected in the matrix, * and vice-versa. * * @param values * The values to be filled into the new matrix. */ public DoubleMatrix1D make(double[] values) { if (this == sparse) return new SparseDoubleMatrix1D(values); else return new DenseDoubleMatrix1D(values); }
/** * Constructs a matrix with the given cell values. The values are copied. So * subsequent changes in <tt>values</tt> are not reflected in the matrix, * and vice-versa. * * @param values * The values to be filled into the new matrix. */ public DoubleMatrix1D make(double[] values) { if (this == sparse) return new SparseDoubleMatrix1D(values); else return new DenseDoubleMatrix1D(values); }
public DoubleMatrix1D vectorize() { SparseDoubleMatrix1D v = new SparseDoubleMatrix1D((int) size()); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { double elem = getQuick(r, c); v.setQuick(idx++, elem); } } return v; }
public DoubleMatrix1D vectorize() { SparseDoubleMatrix1D v = new SparseDoubleMatrix1D((int) size()); int idx = 0; for (int c = 0; c < columns; c++) { for (int r = 0; r < rows; r++) { double elem = getQuick(r, c); v.setQuick(idx++, elem); } } return v; }
public DoubleMatrix1D vectorize() { DoubleMatrix1D v = new SparseDoubleMatrix1D((int) size()); int length = rows * columns; for (int s = 0; s < slices; s++) { v.viewPart(s * length, length).assign(viewSlice(s).vectorize()); } return v; }
public DoubleMatrix1D vectorize() { DoubleMatrix1D v = new SparseDoubleMatrix1D((int) size()); int length = rows * columns; for (int s = 0; s < slices; s++) { v.viewPart(s * length, length).assign(viewSlice(s).vectorize()); } return v; }