CustomInner

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

Bases: Weighting

Class for handling a user-specified inner product.

__init__(inner, impl, device, shape=())[source]

Initialize a new instance.

Parameters

innercallable

The inner product implementation. It must accept two LinearSpaceElement arguments, return an element from their space’s field (real or complex number) and satisfy the following conditions for all space elements x, y, z and scalars s:

  • <x, y> = conj(<y, x>)

  • <s*x + y, z> = s * <x, z> + <y, z>

  • <x, x> = 0 if and only if x = 0

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