PowerOperator

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

Bases: Operator

Operator taking a fixed power of a space or field element.

Implements:

PowerOperator(p)(x) == x ** p

Here, x is a LinearSpaceElement or Field element and p is a number. Hence, this operator can be defined either on a LinearSpace or on a Field.

__init__(domain, exponent)[source]

Initialize a new instance.

Parameters

domainLinearSpace or Field

Set of elements on which the operator can be applied.

exponentfloat

Exponent parameter of the power function applied to an element.

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