CustomDist¶
- class odl.space.weighting.CustomDist(dist, impl)[source]¶
Bases:
WeightingClass for handling a user-specified distance.
Note that this removes
innerandnorm.- Attributes:
Methods
equiv(other)Test if
otheris an equivalent weighting.inner(x1, x2)Inner product is not defined for custom distance.
norm(x)Norm is not defined for custom distance.
- __init__(dist, impl)[source]¶
Initialize a new instance.
- Parameters:
- distcallable
The distance function defining a metric on a
LinearSpace. It must accept twoLinearSpaceElementarguments, return a float and and fulfill the following mathematical conditions for any three space elementsx, y, z:dist(x, y) >= 0dist(x, y) = 0if and only ifx = ydist(x, y) = dist(y, x)dist(x, y) <= dist(x, z) + dist(z, y)
- implstring
Specifier for the implementation backend