multiply method

Matrix multiply(
  1. double x
)

Multiply the matrix by a scalar

  • x The scalar to multiply by
  • Returns The new matrix

Implementation

Matrix multiply(double x) {
  Matrix matrixB = Matrix(_row, _col);
  matrixB.fill(x);
  return hadamardProduct(matrixB);
}