/** * 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 view 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>. * @throws IllegalArgumentException if <tt>size<0</tt>. */ protected DenseDoubleMatrix1D(int size, double[] elements, int zero, int stride) { setUp(size,zero,stride); this.elements = elements; this.isNoView = false; } /**
/** * Constructs a matrix view 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>. * @throws IllegalArgumentException if <tt>size<0</tt>. */ protected DenseDoubleMatrix1D(int size, double[] elements, int zero, int stride) { setUp(size,zero,stride); this.elements = elements; this.isNoView = false; } /**