ScalingOperator

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

Bases: Operator

Operator of multiplication with a scalar.

Implements:

ScalingOperator(s)(x) == s * x
__init__(domain, scalar)[source]

Initialize a new instance.

Parameters

domainLinearSpace or Field

Set of elements on which this operator acts.

scalardomain.field element

Fixed scaling factor of this operator.

Examples

>>> r3 = odl.rn(3)
>>> vec = r3.element([1, 2, 3])
>>> out = r3.element()
>>> op = ScalingOperator(r3, 2.0)
>>> op(vec, out)  # In-place, Returns out
rn(3).element([ 2.,  4.,  6.])
>>> out
rn(3).element([ 2.,  4.,  6.])
>>> op(vec)  # Out-of-place
rn(3).element([ 2.,  4.,  6.])