CustomNorm¶
-
class
odl.space.weighting.
CustomNorm
(norm, impl)[source]¶ Bases:
odl.space.weighting.Weighting
Class for handling a user-specified norm.
Note that this removes
inner
.- Attributes
Methods
dist
(self, x1, x2)Calculate the distance between two elements.
equiv
(self, other)Test if
other
is an equivalent weighting.inner
(self, x1, x2)Inner product is not defined for custom distance.
-
__init__
(self, norm, impl)[source]¶ Initialize a new instance.
- Parameters
- normcallable
The norm implementation. It must accept a
LinearSpaceElement
argument, return a float and satisfy the following conditions for all space elementsx, y
and scalarss
:||x|| >= 0
||x|| = 0
if and only ifx = 0
||s * x|| = |s| * ||x||
||x + y|| <= ||x|| + ||y||
- implstring
Specifier for the implementation backend