public void dswap(DoubleMatrix2D A, DoubleMatrix2D B) { //B.swap(A); not yet implemented A.checkShape(B); for(int i = A.rows(); --i >= 0;) A.viewRow(i).swap(B.viewRow(i)); } public void dsymv(boolean isUpperTriangular, double alpha, DoubleMatrix2D A, DoubleMatrix1D x, double beta, DoubleMatrix1D y) {
public void dswap(DoubleMatrix2D A, DoubleMatrix2D B) { //B.swap(A); not yet implemented A.checkShape(B); for(int i = A.rows(); --i >= 0;) A.viewRow(i).swap(B.viewRow(i)); } public void dsymv(boolean isUpperTriangular, double alpha, DoubleMatrix2D A, DoubleMatrix1D x, double beta, DoubleMatrix1D y) {
/** * Replaces all cell values of the receiver with the values of another matrix. * Both matrices must have the same number of rows and columns. * If both matrices share the same cells (as is the case if they are views derived from the same matrix) and intersect in an ambiguous way, then replaces <i>as if</i> using an intermediate auxiliary deep copy of <tt>other</tt>. * * @param other the source matrix to copy from (may be identical to the receiver). * @return <tt>this</tt> (for convenience only). * @throws IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt> */ public DoubleMatrix2D assign(DoubleMatrix2D other) { if (other==this) return this; checkShape(other); if (haveSharedCells(other)) other = other.copy(); //for (int row=0; row<rows; row++) { //for (int column=0; column<columns; column++) { for (int row=rows; --row >= 0;) { for (int column=columns; --column >= 0;) { setQuick(row,column,other.getQuick(row,column)); } } return this; } /**
/** * Replaces all cell values of the receiver with the values of another matrix. * Both matrices must have the same number of rows and columns. * If both matrices share the same cells (as is the case if they are views derived from the same matrix) and intersect in an ambiguous way, then replaces <i>as if</i> using an intermediate auxiliary deep copy of <tt>other</tt>. * * @param other the source matrix to copy from (may be identical to the receiver). * @return <tt>this</tt> (for convenience only). * @throws IllegalArgumentException if <tt>columns() != other.columns() || rows() != other.rows()</tt> */ public DoubleMatrix2D assign(DoubleMatrix2D other) { if (other==this) return this; checkShape(other); if (haveSharedCells(other)) other = other.copy(); //for (int row=0; row<rows; row++) { //for (int column=0; column<columns; column++) { for (int row=rows; --row >= 0;) { for (int column=columns; --column >= 0;) { setQuick(row,column,other.getQuick(row,column)); } } return this; } /**
checkShape(y); for (int row=rows; --row >= 0; ) { for (int column=columns; --column >= 0; ) {
checkShape(y); for (int row=rows; --row >= 0; ) { for (int column=columns; --column >= 0; ) {
checkShape(other); if (size()==0) return Double.NaN; double a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1));
checkShape(other); if (size()==0) return Double.NaN; double a = f.apply(getQuick(rows-1,columns-1),other.getQuick(rows-1,columns-1));
checkShape(B); if (rows<3 || columns<3) return; // nothing to do int r = rows-1;
checkShape(B); if (rows<3 || columns<3) return; // nothing to do int r = rows-1;