LinCombOperator
- class odl.LinCombOperator(*args, **kwargs)
Bases:
OperatorOperator mapping two space elements to a linear combination.
Implements:
LinCombOperator(a, b)([x, y]) == a * x + b * y
- __init__(space, a, b)[source]
Initialize a new instance.
Parameters
- space
LinearSpace Space of elements which the operator is acting on.
- a, b
space.fieldelements Scalars to multiply
x[0]andx[1]with, respectively.
Examples
>>> r3 = odl.rn(3) >>> r3xr3 = odl.ProductSpace(r3, r3) >>> xy = r3xr3.element([[1, 2, 3], [1, 2, 3]]) >>> z = r3.element() >>> op = LinCombOperator(r3, 1.0, 1.0) >>> op(xy, out=z) # Returns z rn(3).element([ 2., 4., 6.]) >>> z rn(3).element([ 2., 4., 6.])
- space