CustomDist

class odl.space.weighting.CustomDist(dist, impl)[source]

Bases: odl.space.weighting.Weighting

Class for handling a user-specified distance.

Note that this removes inner and norm.

Attributes
dist

Custom distance of this instance..

exponent

Exponent of this weighting.

impl

Implementation backend of this weighting.

repr_part

Return a string usable in a space’s __repr__ method.

Methods

equiv(self, other)

Test if other is an equivalent weighting.

inner(self, x1, x2)

Inner product is not defined for custom distance.

norm(self, x)

Norm is not defined for custom distance.

__init__(self, dist, impl)[source]

Initialize a new instance.

Parameters
distcallable

The distance function defining a metric on a LinearSpace. It must accept two LinearSpaceElement arguments, return a float and and fulfill the following mathematical conditions for any three space elements x, y, z:

  • dist(x, y) >= 0

  • dist(x, y) = 0 if and only if x = y

  • dist(x, y) = dist(y, x)

  • dist(x, y) <= dist(x, z) + dist(z, y)

implstring

Specifier for the implementation backend