MultiplyOperator

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

Bases: odl.operator.operator.Operator

Operator multiplying by a fixed space or field element.

Implements:

MultiplyOperator(y)(x) == x * y

Here, y is a LinearSpaceElement or Field element and x is a LinearSpaceElement. Hence, this operator can be defined either on a LinearSpace or on a Field. In the first case it is the pointwise multiplication, in the second the scalar multiplication.

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.

multiplicand

Value to multiply by.

range

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

Methods

_call(self, x[, out])

Multiply x and write to out if given.

derivative(self, point)

Return the operator derivative at point.

norm(self[, estimate])

Return the operator norm of this operator.

__init__(self, multiplicand, domain=None, range=None)[source]

Initialize a new instance.

Parameters
multiplicandLinearSpaceElement or scalar

Value to multiply by.

domainLinearSpace or Field, optional

Set to which the operator can be applied. Default: multiplicand.space.

rangeLinearSpace or Field, optional

Set to which the operator maps. Default: multiplicand.space.

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.])