PowerOperator¶
- class odl.operator.default_ops.PowerOperator(*args, **kwargs)[source]¶
Bases:
Operator
Operator taking a fixed power of a space or field element.
Implements:
PowerOperator(p)(x) == x ** p
Here,
x
is aLinearSpaceElement
orField
element andp
is a number. Hence, this operator can be defined either on aLinearSpace
or on aField
.- Attributes:
adjoint
Adjoint of this operator (abstract).
domain
Set of objects on which this operator can be evaluated.
exponent
Power of the input element to take.
inverse
Return the operator inverse.
is_functional
True
if this operator's range is aField
.is_linear
True
if this operator is linear.range
Set 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
LinearSpace
orField
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