/** * 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>DenseObjectMatrix2D</tt> the new matrix must be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix2D</tt> the new matrix must be of type <tt>SparseObjectMatrix1D</tt>, etc. * * @param size the number of cells the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public ObjectMatrix1D like1D(int size) { return new DenseObjectMatrix1D(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>DenseObjectMatrix2D</tt> the new matrix must be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix2D</tt> the new matrix must be of type <tt>SparseObjectMatrix1D</tt>, etc. * * @param size the number of cells the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public ObjectMatrix1D like1D(int size) { return new DenseObjectMatrix1D(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>DenseObjectMatrix1D</tt> the new matrix must also be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix1D</tt> the new matrix must also be of type <tt>SparseObjectMatrix1D</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 ObjectMatrix1D like(int size) { return new DenseObjectMatrix1D(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>DenseObjectMatrix1D</tt> the new matrix must also be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix1D</tt> the new matrix must also be of type <tt>SparseObjectMatrix1D</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 ObjectMatrix1D like(int size) { return new DenseObjectMatrix1D(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>DenseObjectMatrix2D</tt> the new matrix must be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix2D</tt> the new matrix must be of type <tt>SparseObjectMatrix1D</tt>, etc. * * @param size the number of cells the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public ObjectMatrix1D like1D(int size) { return new DenseObjectMatrix1D(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>DenseObjectMatrix2D</tt> the new matrix must be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix2D</tt> the new matrix must be of type <tt>SparseObjectMatrix1D</tt>, etc. * * @param size the number of cells the matrix shall have. * @return a new matrix of the corresponding dynamic type. */ public ObjectMatrix1D like1D(int size) { return new DenseObjectMatrix1D(size); } /**
/** * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells. * For example, if the receiver is an instance of type <tt>DenseObjectMatrix2D</tt> the new matrix must be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix2D</tt> the new matrix must be of type <tt>SparseObjectMatrix1D</tt>, etc. * * @param size the number of cells the matrix shall have. * @param zero the index of the first element. * @param stride the number of indexes between any two elements, i.e. <tt>index(i+1)-index(i)</tt>. * @return a new matrix of the corresponding dynamic type. */ protected ObjectMatrix1D like1D(int size, int zero, int stride) { return new DenseObjectMatrix1D(size,this.elements,zero,stride); } /**
/** * 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>DenseObjectMatrix1D</tt> the new matrix must also be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix1D</tt> the new matrix must also be of type <tt>SparseObjectMatrix1D</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 ObjectMatrix1D like(int size) { return new DenseObjectMatrix1D(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>DenseObjectMatrix1D</tt> the new matrix must also be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix1D</tt> the new matrix must also be of type <tt>SparseObjectMatrix1D</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 ObjectMatrix1D like(int size) { return new DenseObjectMatrix1D(size); } /**
/** * Construct and returns a new 1-d matrix <i>of the corresponding dynamic type</i>, sharing the same cells. * For example, if the receiver is an instance of type <tt>DenseObjectMatrix2D</tt> the new matrix must be of type <tt>DenseObjectMatrix1D</tt>, * if the receiver is an instance of type <tt>SparseObjectMatrix2D</tt> the new matrix must be of type <tt>SparseObjectMatrix1D</tt>, etc. * * @param size the number of cells the matrix shall have. * @param zero the index of the first element. * @param stride the number of indexes between any two elements, i.e. <tt>index(i+1)-index(i)</tt>. * @return a new matrix of the corresponding dynamic type. */ protected ObjectMatrix1D like1D(int size, int zero, int stride) { return new DenseObjectMatrix1D(size,this.elements,zero,stride); } /**
/** * 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 ObjectMatrix1D make(Object[] values) { if (this==sparse) return new SparseObjectMatrix1D(values); else return new DenseObjectMatrix1D(values); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix1D make(int size) { if (this==sparse) return new SparseObjectMatrix1D(size); return new DenseObjectMatrix1D(size); } /**
/** * Constructs a matrix with the given shape, each cell initialized with zero. */ public ObjectMatrix1D make(int size) { if (this==sparse) return new SparseObjectMatrix1D(size); return new DenseObjectMatrix1D(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 ObjectMatrix1D make(Object[] values) { if (this==sparse) return new SparseObjectMatrix1D(values); else return new DenseObjectMatrix1D(values); } /**