ArrayWeighting

class odl.core.space.weightings.weighting.ArrayWeighting(array, impl, device, exponent=2.0)[source]

Bases: Weighting

Weighting of a space by an array.

The exact definition of the weighted inner product, norm and distance functions depend on the concrete space.

The array may only have positive entries, otherwise it does not define an inner product or norm, respectively. This is not checked during initialization.

__init__(array, impl, device, exponent=2.0)[source]

Initialize a new instance.

Parameters

arrayarray-like

Weighting array of inner product, norm and distance. Native Tensor instances are stored as-is without copying. Do not pass an ODL-space-element here. If you want to use such an element, use its contained data instead.

implstring

Specifier for the implementation backend.

device :

device identifier, compatible with the backend associated with impl

exponentpositive float, optional

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