ConstantOperator¶
- class odl.operator.default_ops.ConstantOperator(*args, **kwargs)[source]¶
Bases:
OperatorOperator that always returns the same value.
Implements:
ConstantOperator(y)(x) == y
- Attributes:
adjointAdjoint of the operator.
constantConstant space element returned by 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.rangeSet in which the result of an evaluation of this operator lies.
Methods
__call__(x[, out])Return
self(x[, out, **kwargs]).derivative(point)Derivative of this operator, always zero.
norm([estimate])Return the operator norm of this operator.
- __init__(constant, domain=None, range=None)[source]¶
Initialize a new instance.
- Parameters:
- constant
LinearSpaceElementorrangeelement-like The constant space element to be returned. If
rangeis not provided,constantmust be aLinearSpaceElementsince the operator range is then inferred from it.- domain
LinearSpace, optional Domain of the operator. Default:
vector.space- range
LinearSpace, optional Range of the operator. Default:
vector.space
- constant
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.])