PowerOperator¶
- class odl.operator.default_ops.PowerOperator(*args, **kwargs)[source]¶
Bases:
OperatorOperator taking a fixed power of a space or field element.
Implements:
PowerOperator(p)(x) == x ** p
Here,
xis aLinearSpaceElementorFieldelement andpis a number. Hence, this operator can be defined either on aLinearSpaceor on aField.- Attributes:
adjointAdjoint of this operator (abstract).
domainSet of objects on which this operator can be evaluated.
exponentPower of the input element to take.
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.
norm([estimate])Return the operator norm of this operator.
- __init__(domain, exponent)[source]¶
Initialize a new instance.
- Parameters:
- domain
LinearSpaceorField Set of elements on which the operator can be applied.
- exponentfloat
Exponent parameter of the power function applied to an element.
- domain
Examples
Use with vectors
>>> op = PowerOperator(odl.rn(3), exponent=2) >>> op([1, 2, 3]) rn(3).element([ 1., 4., 9.])
or scalars
>>> op = PowerOperator(odl.RealNumbers(), exponent=2) >>> op(2.0) 4.0