DistOperator

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

Bases: odl.operator.operator.Operator

Operator taking the distance to a fixed space element.

Implements:

DistOperator(y)(x) == y.dist(x)

This is only applicable in metric spaces, i.e., spaces implementing a dist method.

See also

InnerProductOperator

Inner product with fixed space element.

NormOperator

Vector space norm as an operator.

Attributes
adjoint

Adjoint of this operator (abstract).

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.

vector

Element to which to take the distance.

Methods

_call(self, x)

Return the distance from self.vector to x.

derivative(self, point)

The derivative operator.

norm(self[, estimate])

Return the operator norm of this operator.

__init__(self, vector)[source]

Initialize a new instance.

Parameters
vectorLinearSpaceElement

Point to calculate the distance to.

Examples

>>> r2 = odl.rn(2)
>>> x = r2.element([1, 1])
>>> op = DistOperator(x)
>>> op([4, 5])
5.0