CustomNorm

class odl.core.space.weightings.weighting.CustomNorm(norm, impl, device, shape=())[source]

Bases: Weighting

Class for handling a user-specified norm.

Note that this removes inner.

__init__(norm, impl, device, shape=())[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 elements x, y and scalars s:

  • ||x|| >= 0

  • ||x|| = 0 if and only if x = 0

  • ||s * x|| = |s| * ||x||

  • ||x + y|| <= ||x|| + ||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 norm callable can assume that the shape has already been checked. If an empty shape is specified (the default), norm should be able to handle arrays of arbitrary shape.