@Override public void zero() { this.internalMatrix.zero(); }
@Override public void zero() { this.internalMatrix.zero(); }
@Override public void zero() { this.internalMatrix.zero(); }
public Matrix mult(double alpha, Matrix B, Matrix C) { return multAdd(alpha, B, C.zero()); }
public Matrix transABmult(double alpha, Matrix B, Matrix C) { return transABmultAdd(alpha, B, C.zero()); }
public Matrix transAmult(double alpha, Matrix B, Matrix C) { return transAmultAdd(alpha, B, C.zero()); }
public Matrix transAmult(double alpha, Matrix B, Matrix C) { return transAmultAdd(alpha, B, C.zero()); }
public Matrix transBmult(double alpha, Matrix B, Matrix C) { return transBmultAdd(alpha, B, C.zero()); }
public Matrix transABmult(double alpha, Matrix B, Matrix C) { return transABmultAdd(alpha, B, C.zero()); }
public Matrix transBmult(double alpha, Matrix B, Matrix C) { return transBmultAdd(alpha, B, C.zero()); }
public Matrix mult(double alpha, Matrix B, Matrix C) { return multAdd(alpha, B, C.zero()); }
@Override public Matrix mult(Matrix B, Matrix C) { checkMultAdd(B, C); C.zero(); // optimised a little bit to avoid zeros in rows, but not to // exploit sparsity of matrix B for (int i = 0; i < numRows; ++i) { for (int j = 0; j < C.numColumns(); ++j) { double dot = 0; for (int k = rowPointer[i]; k < rowPointer[i + 1]; ++k) { dot += data[k] * B.get(columnIndex[k], j); } if (dot != 0) { C.set(i, j, dot); } } } return C; }
@Override public Matrix mult(Matrix B, Matrix C) { checkMultAdd(B, C); C.zero(); // optimised a little bit to avoid zeros in rows, but not to // exploit sparsity of matrix B for (int i = 0; i < numRows; ++i) { for (int j = 0; j < C.numColumns(); ++j) { double dot = 0; for (int k = rowPointer[i]; k < rowPointer[i + 1]; ++k) { dot += data[k] * B.get(columnIndex[k], j); } if (dot != 0) { C.set(i, j, dot); } } } return C; }
public Matrix transpose(Matrix B) { checkTranspose(B); if (B == this) return transpose(); B.zero(); for (MatrixEntry e : this) B.set(e.column(), e.row(), e.get()); return B; }
public void identity() { int N; this.internalMatrix.zero(); if (this.getNumRows() < this.getNumColumns()) { N = this.getNumRows(); } else { N = this.getNumColumns(); } for (int i = 0; i < N; i++) { this.setElement(i, i, 1.0); } }
public void identity() { int N; this.internalMatrix.zero(); if (this.getNumRows() < this.getNumColumns()) { N = this.getNumRows(); } else { N = this.getNumColumns(); } for (int i = 0; i < N; i++) { this.setElement(i, i, 1.0); } }
public Matrix transpose(Matrix B) { checkTranspose(B); if (B == this) return transpose(); B.zero(); for (MatrixEntry e : this) B.set(e.column(), e.row(), e.get()); return B; }
public void identity() { int N; this.internalMatrix.zero(); if (this.getNumRows() < this.getNumColumns()) { N = this.getNumRows(); } else { N = this.getNumColumns(); } for (int i = 0; i < N; i++) { this.setElement(i, i, 1.0); } }