Multiply two operands together using NumPy style broadcasting rules.
Numeric.math.mul(first, right = 1)Combines operands with NumPy style broadcast.
- Parameters:
first: First operand as a scalar, vector, or matrixright: Second operand as a scalar, vector, or matrix
- Returns: Products matching the broadcast shape of the operands
- NumPy: Covers
np.multiply,np.matvec,np.vecmatthrough a single Numerix method.
import Numeric from '@neabyte/numerix'
const product = Numeric.math.mul(3, 4)
console.log(product)
// 12import Numeric from '@neabyte/numerix'
const products = Numeric.math.mul([1, 2, 3], 3)
console.log(products)
// [3,6,9]import Numeric from '@neabyte/numerix'
const products = Numeric.math.mul([2, 3], [4, 5])
console.log(products)
// [8,15]import Numeric from '@neabyte/numerix'
const products = Numeric.math.mul([[1, 2], [3, 4]], [1, 1])
console.log(products)
// [[1,2],[3,4]]