OperatorSum¶
- class odl.operator.operator.OperatorSum(*args, **kwargs)[source]¶
Bases:
Operator
Expression type for the sum of operators.
OperatorSum(left, right)(x) == left(x) + right(x)
The sum is only well-defined for
Operator
instances whereOperator.range
is aLinearSpace
.- Attributes:
adjoint
Adjoint of this operator.
domain
Set of objects on which this operator can be evaluated.
inverse
Return the operator inverse.
is_functional
True
if this operator's range is aField
.is_linear
True
if this operator is linear.left
The left/first part of this sum.
range
Set in which the result of an evaluation of this operator lies.
right
The left/second part of this sum.
Methods
__call__
(x[, out])Return
self(x[, out, **kwargs])
.derivative
(x)Return the operator derivative at
x
.norm
([estimate])Return the operator norm of this operator.
- __init__(left, right, tmp_ran=None, tmp_dom=None)[source]¶
Initialize a new instance.
- Parameters:
- left
Operator
First summand. Its
Operator.range
must be aLinearSpace
orField
.- right
Operator
Second summand. Must have the same
Operator.domain
andOperator.range
asleft
.- tmp_ran
Operator.range
element, optional Used to avoid the creation of a temporary when applying the operator.
- tmp_dom
Operator.domain
element, optional Used to avoid the creation of a temporary when applying the operator adjoint.
- left
Examples
>>> r3 = odl.rn(3) >>> op = odl.IdentityOperator(r3) >>> x = r3.element([1, 2, 3]) >>> out = r3.element() >>> OperatorSum(op, op)(x, out) # In-place, returns out rn(3).element([ 2., 4., 6.]) >>> out rn(3).element([ 2., 4., 6.]) >>> OperatorSum(op, op)(x) rn(3).element([ 2., 4., 6.])