NumpyTensorSpaceCustomDist¶
-
class
odl.space.npy_tensors.
NumpyTensorSpaceCustomDist
(dist)[source]¶ Bases:
odl.space.weighting.CustomDist
Class for handling a user-specified distance in
TensorSpace
.Note that this removes
inner
andnorm
.- Attributes
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)[source]¶ Initialize a new instance.
- Parameters
- dist
callable
The distance function defining a metric on
TensorSpace
. It must accept twoTensor
arguments, return afloat
and fulfill the following mathematical conditions for any three elementsx, y, z
:dist(x, y) >= 0
dist(x, y) = 0
if and only ifx = y
dist(x, y) = dist(y, x)
dist(x, y) <= dist(x, z) + dist(z, y)
- dist