numpoly.outer¶
- numpoly.outer(a: numpoly.typing.PolyLike, b: numpoly.typing.PolyLike, out: Optional[numpoly.baseclass.ndpoly] = None) → numpoly.baseclass.ndpoly[source]¶
Compute the outer product of two vectors.
Given two vectors,
a = [a0, a1, ..., aM]
andb = [b0, b1, ..., bN]
, the outer product is:[[a0*b0 a0*b1 ... a0*bN ] [a1*b0 . [ ... . [aM*b0 aM*bN ]]
- Args:
- a:
First input vector. Input is flattened if not already 1-dimensional.
- b:
Second input vector. Input is flattened if not already 1-dimensional.
- out:
A location where the result is stored.
- Return:
out[i, j] = a[i] * b[j]
- Example:
>>> poly = numpoly.variable(3) >>> const = numpy.arange(5) >>> numpoly.outer(poly, const) polynomial([[0, q0, 2*q0, 3*q0, 4*q0], [0, q1, 2*q1, 3*q1, 4*q1], [0, q2, 2*q2, 3*q2, 4*q2]])