CustomDist
- class odl.core.space.weightings.weighting.CustomDist(dist, impl, device, shape=())[source]
Bases:
WeightingClass for handling a user-specified distance.
Note that this removes
innerandnorm.- __init__(dist, impl, device, shape=())[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
- device :
device identifier, compatible with the backend associated with
impl- shape :
what shape array need to have to be processed by this weighting. The
distcallable can assume that the shape has already been checked. If an empty shape is specified (the default),distshould be able to handle arrays of arbitrary shape.