OperatorSum

class odl.operator.operator.OperatorSum(*args, **kwargs)[source]

Bases: odl.operator.operator.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.

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 a Field.

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(self, x[, out])

Implement self(x[, out]).

derivative(self, x)

Return the operator derivative at x.

norm(self[, estimate])

Return the operator norm of this operator.

__init__(self, 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.])