MultiplyOperator¶
- class odl.operator.default_ops.MultiplyOperator(*args, **kwargs)[source]¶
Bases:
OperatorOperator multiplying by a fixed space or field element.
Implements:
MultiplyOperator(y)(x) == x * y
Here,
yis aLinearSpaceElementorFieldelement andxis aLinearSpaceElement. Hence, this operator can be defined either on aLinearSpaceor on aField. In the first case it is the pointwise multiplication, in the second the scalar multiplication.- Attributes:
adjointAdjoint of this operator.
domainSet of objects on which this operator can be evaluated.
inverseReturn the operator inverse.
is_functionalTrueif this operator's range is aField.is_linearTrueif this operator is linear.multiplicandValue to multiply by.
rangeSet in which the result of an evaluation of this operator lies.
Methods
__call__(x[, out])Return
self(x[, out, **kwargs]).derivative(point)Return the operator derivative at
point.norm([estimate])Return the operator norm of this operator.
- __init__(multiplicand, domain=None, range=None)[source]¶
Initialize a new instance.
- Parameters:
- multiplicand
LinearSpaceElementor scalar Value to multiply by.
- domain
LinearSpaceorField, optional Set to which the operator can be applied. Default:
multiplicand.space.- range
LinearSpaceorField, optional Set to which the operator maps. Default:
multiplicand.space.
- multiplicand
Examples
>>> r3 = odl.rn(3) >>> x = r3.element([1, 2, 3])
Multiply by vector:
>>> op = MultiplyOperator(x) >>> op(x) rn(3).element([ 1., 4., 9.]) >>> out = r3.element() >>> op(x, out) rn(3).element([ 1., 4., 9.])
Multiply by scalar:
>>> op2 = MultiplyOperator(x, domain=r3.field) >>> op2(3) rn(3).element([ 3., 6., 9.]) >>> out = r3.element() >>> op2(3, out) rn(3).element([ 3., 6., 9.])