BroadcastOperator

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

Bases: Operator

Broadcast argument to set of operators.

An argument is broadcast by evaluating several operators in the same point:

BroadcastOperator(op1, op2)(x) = [op1(x), op2(x)]

See Also

ProductSpaceOperator : More general case, used as backend. ReductionOperator : Calculates sum of operator results. DiagonalOperator : Case where each operator should have its own argument.

__init__(*operators)[source]

Initialize a new instance

Parameters

operator1,…,operatorNOperator or int

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

Examples

Initialize an operator:

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

Evaluate the operator:

>>> x = [1, 2, 3]
>>> op(x)
ProductSpace(rn(3), 2).element([
    [ 1.,  2.,  3.],
    [ 2.,  4.,  6.]
])

Can also initialize by calling an operator repeatedly:

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