ConstantOperator

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

Bases: odl.operator.operator.Operator

Operator that always returns the same value.

Implements:

ConstantOperator(y)(x) == y
Attributes
adjoint

Adjoint of the operator.

constant

Constant space element returned by 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.

range

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

Methods

_call(self, x[, out])

Return the constant vector or assign it to out.

derivative(self, point)

Derivative of this operator, always zero.

norm(self[, estimate])

Return the operator norm of this operator.

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

Initialize a new instance.

Parameters
constantLinearSpaceElement or range element-like

The constant space element to be returned. If range is not provided, constant must be a LinearSpaceElement since the operator range is then inferred from it.

domainLinearSpace, optional

Domain of the operator. Default: vector.space

rangeLinearSpace, optional

Range of the operator. Default: vector.space

Examples

>>> r3 = odl.rn(3)
>>> x = r3.element([1, 2, 3])
>>> op = ConstantOperator(x)
>>> op(x, out=r3.element())
rn(3).element([ 1.,  2.,  3.])