throw new IllegalArgumentException("Matrix2D inner dimensions must agree:" + this.toStringShort() + ", " + B.toStringShort()); } else { if (rowsA != C.rows() || columnsB != C.columns()) { throw new IllegalArgumentException("Incompatibe result matrix: " + this.toStringShort() + ", " + B.toStringShort() + ", " + C.toStringShort());
throw new IllegalArgumentException("Matrix2D inner dimensions must agree:" + this.toStringShort() + ", " + B.toStringShort()); } else { if (rowsA != C.rows() || columnsB != C.columns()) { throw new IllegalArgumentException("Incompatibe result matrix: " + this.toStringShort() + ", " + B.toStringShort() + ", " + C.toStringShort());
public DoubleMatrix1D zMult(final DoubleMatrix1D y, DoubleMatrix1D z, final double alpha, final double beta, final boolean transposeA) { if (z == null) { z = new DenseDoubleMatrix1D(transposeA ? columns : rows); } if ((transposeA ? rows : columns) != y.size() || (transposeA ? columns : rows) > z.size()) throw new IllegalArgumentException("Incompatible args: " + toStringShort() + ", " + y.toStringShort() + ", " + z.toStringShort()); if (!(y instanceof DenseDoubleMatrix1D) || !(z instanceof DenseDoubleMatrix1D) || this.isView() || y.isView() || z.isView()) return super.zMult(y, z, alpha, beta, transposeA); double[] yElements = (double[]) y.elements(); double[] zElements = (double[]) z.elements(); Transpose transA = transposeA ? Transpose.Transpose : Transpose.NoTranspose; BLAS.getInstance().dgemv(transA.netlib(), rows, columns, alpha, elements, Math.max(rows, 1), yElements, 1, beta, zElements, 1); return z; }
public DoubleMatrix1D zMult(final DoubleMatrix1D y, DoubleMatrix1D z, final double alpha, final double beta, final boolean transposeA) { if (z == null) { z = new DenseDoubleMatrix1D(transposeA ? columns : rows); } if ((transposeA ? rows : columns) != y.size() || (transposeA ? columns : rows) > z.size()) throw new IllegalArgumentException("Incompatible args: " + toStringShort() + ", " + y.toStringShort() + ", " + z.toStringShort()); if (!(y instanceof DenseDoubleMatrix1D) || !(z instanceof DenseDoubleMatrix1D) || this.isView() || y.isView() || z.isView()) return super.zMult(y, z, alpha, beta, transposeA); double[] yElements = (double[]) y.elements(); double[] zElements = (double[]) z.elements(); Transpose transA = transposeA ? Transpose.Transpose : Transpose.NoTranspose; BLAS.getInstance().dgemv(transA.netlib(), rows, columns, alpha, elements, Math.max(rows, 1), yElements, 1, beta, zElements, 1); return z; }