DistOperator

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

Bases: 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.

__init__(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