BroadcastOperator
- class odl.BroadcastOperator(*args, **kwargs)
Bases:
OperatorBroadcast 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
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)))