Weighting

class odl.space.weighting.Weighting(impl, exponent=2.0)[source]

Bases: object

Abstract base class for weighting of finite-dimensional spaces.

This class and its subclasses serve as a simple means to evaluate and compare weighted inner products, norms and metrics semantically rather than by identity on a pure function level.

The functions are implemented similarly to Operator, but without extra type checks of input parameters - this is done in the callers of the LinearSpace instance where these functions are being used.

Attributes
exponent

Exponent of this weighting.

impl

Implementation backend of this weighting.

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)

Return the inner product of two elements.

norm(self, x)

Calculate the norm of an element.

__init__(self, impl, exponent=2.0)[source]

Initialize a new instance.

Parameters
implstring

Specifier for the implementation backend

exponentpositive float, optional

Exponent of the norm. For values other than 2.0, the inner product is not defined.