ProductSpace.lincomb¶
-
ProductSpace.
lincomb
(self, a, x1, b=None, x2=None, out=None)¶ Implement
out[:] = a * x1 + b * x2
.This function implements
out[:] = a * x1
or, if
b
andx2
are given,out = a * x1 + b * x2
.- Parameters
- a
field
element Scalar to multiply
x1
with.- x1
LinearSpaceElement
First space element in the linear combination.
- b
field
element, optional Scalar to multiply
x2
with. Required ifx2
is provided.- x2
LinearSpaceElement
, optional Second space element in the linear combination.
- out
LinearSpaceElement
, optional Element to which the result is written.
- a
- Returns
- out
LinearSpaceElement
Result of the linear combination. If
out
was provided, the returned object is a reference to it.
- out
Notes
The elements
out
,x1
andx2
may be aligned, thus a callspace.lincomb(2, x, 3.14, x, out=x)
is (mathematically) equivalent to
x = x * (2 + 3.14)
.