@Override public final Matrix times( final DenseMatrix other) { this.assertMultiplicationDimensions(other); // TODO: Make sure this BLAS is truly faster than slow version if (canUseBlasForMult(getNumRows(), getNumColumns(), other.getNumRows(), other.getNumColumns())) { double[] output = new double[getNumRows() * other.getNumColumns()]; BLAS.getInstance().dgemm("N", "N", getNumRows(), other.getNumColumns(), getNumColumns(), 1.0, this.toBlas(), getNumRows(), other.toBlas(), other.getNumRows(), 0.0, output, getNumRows()); return createFromBlas(output, getNumRows(), other.getNumColumns()); } else { return slowMult(other); } }
@Override public final Matrix times( final DenseMatrix other) { this.assertMultiplicationDimensions(other); // TODO: Make sure this BLAS is truly faster than slow version if (canUseBlasForMult(getNumRows(), getNumColumns(), other.getNumRows(), other.getNumColumns())) { double[] output = new double[getNumRows() * other.getNumColumns()]; BLAS.getInstance().dgemm("N", "N", getNumRows(), other.getNumColumns(), getNumColumns(), 1.0, this.toBlas(), getNumRows(), other.toBlas(), other.getNumRows(), 0.0, output, getNumRows()); return createFromBlas(output, getNumRows(), other.getNumColumns()); } else { return slowMult(other); } }
@Override public final Matrix times( final DenseMatrix other) { this.assertMultiplicationDimensions(other); // TODO: Make sure this BLAS is truly faster than slow version if (canUseBlasForMult(getNumRows(), getNumColumns(), other.getNumRows(), other.getNumColumns())) { double[] output = new double[getNumRows() * other.getNumColumns()]; BLAS.getInstance().dgemm("N", "N", getNumRows(), other.getNumColumns(), getNumColumns(), 1.0, this.toBlas(), getNumRows(), other.toBlas(), other.getNumRows(), 0.0, output, getNumRows()); return createFromBlas(output, getNumRows(), other.getNumColumns()); } else { return slowMult(other); } }