OperatorSum

class odl.OperatorSum(*args, **kwargs)

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 where Operator.range is a LinearSpace.

__init__(left, right, tmp_ran=None, tmp_dom=None)[source]

Initialize a new instance.

Parameters

leftOperator

First summand. Its Operator.range must be a LinearSpace or Field.

rightOperator

Second summand. Must have the same Operator.domain and Operator.range as left.

tmp_ranOperator.range element, optional

Used to avoid the creation of a temporary when applying the operator.

tmp_domOperator.domain element, optional

Used to avoid the creation of a temporary when applying the operator adjoint.

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.])