ReductionOperator

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

Bases: odl.operator.operator.Operator

Reduce argument over set of operators.

An argument is reduced by evaluating several operators and summing the result:

ReductionOperator(op1, op2)(x) = op1(x[0]) + op2(x[1])

See also

ProductSpaceOperator

More general case, used as backend.

BroadcastOperator

Calls several operators with same argument.

DiagonalOperator

Case where each operator should have its own argument.

SeparableSum

Corresponding construction for functionals.

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.

operators

Tuple of sub-operators that comprise self.

prod_op

ProductSpaceOperator implementation.

range

Set in which the result of an evaluation of this operator lies.

size

Total number of sub-operators.

Methods

_call(self, x[, out])

Apply operators to x and sum.

derivative(self, x)

Derivative of the reduction operator.

norm(self[, estimate])

Return the operator norm of this operator.

__init__(self, \*operators)[source]

Initialize a new instance.

Parameters
operator1,…,operatorNOperator or int

The individual operators that should be evaluated and summed. Can also be given as operator, n with n integer, in which case operator is repeated n times.

Examples

>>> I = odl.IdentityOperator(odl.rn(3))
>>> op = ReductionOperator(I, 2 * I)
>>> op.domain
ProductSpace(rn(3), 2)
>>> op.range
rn(3)

Evaluating in a point gives the sum of the evaluation results of the individual operators:

>>> op([[1, 2, 3],
...     [4, 6, 8]])
rn(3).element([  9.,  14.,  19.])

An out argument can be given for in-place evaluation:

>>> out = op.range.element()
>>> result = op([[1, 2, 3],
...              [4, 6, 8]], out=out)
>>> out
rn(3).element([  9.,  14.,  19.])
>>> result is out
True

There is a simplified syntax for the case that all operators are the same:

>>> op = ReductionOperator(I, 2)
>>> op.operators
(IdentityOperator(rn(3)), IdentityOperator(rn(3)))