/** * Sets all cells to the state specified by <tt>value</tt>. * @param value the value to be filled into the cells. * @return <tt>this</tt> (for convenience only). */ public DoubleMatrix2D assign(double value) { final double[] elems = this.elements; int index = index(0,0); int cs = this.columnStride; int rs = this.rowStride; for (int row=rows; --row >= 0; ) { for (int i=index, column=columns; --column >= 0; ) { elems[i] = value; i += cs; } index += rs; } return this; } /**
/** * Sets all cells to the state specified by <tt>value</tt>. * @param value the value to be filled into the cells. * @return <tt>this</tt> (for convenience only). */ public DoubleMatrix2D assign(double value) { final double[] elems = this.elements; int index = index(0,0); int cs = this.columnStride; int rs = this.rowStride; for (int row=rows; --row >= 0; ) { for (int i=index, column=columns; --column >= 0; ) { elems[i] = value; i += cs; } index += rs; } return this; } /**
/** * Returns the sum of all cells; <tt>Sum( x[i,j] )</tt>. * @return the sum. */ public double zSum() { double sum = 0; final double[] elems = this.elements; if (elems==null) throw new InternalError(); int index = index(0,0); int cs = this.columnStride; int rs = this.rowStride; for (int row=rows; --row >= 0; ) { for (int i=index, column=columns; --column >= 0; ) { sum += elems[i]; i += cs; } index += rs; } return sum; } }
/** * Returns the sum of all cells; <tt>Sum( x[i,j] )</tt>. * @return the sum. */ public double zSum() { double sum = 0; final double[] elems = this.elements; if (elems==null) throw new InternalError(); int index = index(0,0); int cs = this.columnStride; int rs = this.rowStride; for (int row=rows; --row >= 0; ) { for (int i=index, column=columns; --column >= 0; ) { sum += elems[i]; i += cs; } index += rs; } return sum; } }
final double[] elems = this.elements; if (elems==null) throw new InternalError(); int index = index(0,0); int cs = this.columnStride; int rs = this.rowStride;
final double[] elems = this.elements; if (elems==null) throw new InternalError(); int index = index(0,0); int cs = this.columnStride; int rs = this.rowStride;
int zs = zz.stride; int indexA = index(0,0); int indexY = yy.index(0); int indexZ = zz.index(0);
int zs = zz.stride; int indexA = index(0,0); int indexY = yy.index(0); int indexZ = zz.index(0);