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(x1, x2)

Calculate the distance between two elements.

equiv(other)

Test if other is an equivalent weighting.

inner(x1, x2)

Return the inner product of two elements.

norm(x)

Calculate the norm of an element.

__init__(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.