/** * Constructs a matrix with a given number of cells. All entries are * initially <tt>0</tt>. * * @param size * the number of cells the matrix shall have. * @throws IllegalArgumentException * if <tt>size<0</tt>. */ public DenseDoubleMatrix1D(int size) { setUp(size); this.elements = new double[size]; }
/** * Constructs a matrix with a given number of cells. All entries are * initially <tt>0</tt>. * * @param size * the number of cells the matrix shall have. * @throws IllegalArgumentException * if <tt>size<0</tt>. */ public DenseDoubleMatrix1D(int size) { setUp(size); this.elements = new double[size]; }
/** * Constructs a matrix with the given parameters. * * @param size * the number of cells the matrix shall have. * @param elements * the cells. * @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>. * @param isView * if true then a matrix view is constructed * @throws IllegalArgumentException * if <tt>size<0</tt>. */ public DenseDoubleMatrix1D(int size, double[] elements, int zero, int stride, boolean isView) { setUp(size, zero, stride); this.elements = elements; this.isNoView = !isView; }
/** * Constructs a matrix with the given parameters. * * @param size * the number of cells the matrix shall have. * @param elements * the cells. * @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>. * @param isView * if true then a matrix view is constructed * @throws IllegalArgumentException * if <tt>size<0</tt>. */ public DenseDoubleMatrix1D(int size, double[] elements, int zero, int stride, boolean isView) { setUp(size, zero, stride); this.elements = elements; this.isNoView = !isView; }