IndicatorSumConstraint

class odl.solvers.functional.default_functionals.IndicatorSumConstraint(*args, **kwargs)[source]

Bases: odl.solvers.functional.functional.Functional

Indicator functional of a unit sum constraint.

Notes

The functional F is given by:

System Message: WARNING/2 (F(x) = \begin{cases} 0 & \text{if } \sum_i x_i = 1 \ +\infty & \text{else.} \end{cases} )

latex exited with error [stdout] This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian) (preloaded format=latex) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2016/02/01> Babel <3.9q> and hyphenation patterns for 3 language(s) loaded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2014/09/29 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty (/usr/share/texlive/texmf-dist/tex/latex/base/utf8.def (/usr/share/texlive/texmf-dist/tex/latex/base/t1enc.dfu) (/usr/share/texlive/texmf-dist/tex/latex/base/ot1enc.dfu) (/usr/share/texlive/texmf-dist/tex/latex/base/omsenc.dfu))) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?' option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/anyfontsize/anyfontsize.sty) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) (./math.aux) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) ! Extra alignment tab has been changed to \cr. <template> $\hfil $$\endtemplate l.19 \end{cases}\end{split} ! Extra alignment tab has been changed to \cr. <template> $\hfil $$\endtemplate l.19 \end{cases}\end{split} [1] (./math.aux) ) (see the transcript file for additional information) Output written on math.dvi (1 page, 540 bytes). Transcript written on math.log.

Attributes
adjoint

Adjoint of this operator (abstract).

convex_conj

The convex conjugate.

domain

Set of objects on which this operator can be evaluated.

grad_lipschitz

Lipschitz constant for the gradient of the functional.

gradient

Gradient operator of the functional.

inverse

Return the operator inverse.

is_functional

True if this operator’s range is a Field.

is_linear

True if this operator is linear.

proximal

Return the proximal factory of the functional.

range

Set in which the result of an evaluation of this operator lies.

Methods

_call(self, x)

Return self(x).

bregman(self, point, subgrad)

Return the Bregman distance functional.

derivative(self, point)

Return the derivative operator in the given point.

norm(self[, estimate])

Return the operator norm of this operator.

translated(self, shift)

Return a translation of the functional.

__init__(self, space, sum_value=1, sum_rtol=None)[source]

Initialize a new instance.

Parameters
spaceDiscretizedSpace or TensorSpace

Domain of the functional.

sum_valuefloat

Desired value of the sum constraint.

sum_rtolfloat, optional

Relative tolerance for sum comparison. If set to None, the default is space.size times 1e-10 when space.dtype is float64 and 1e-6 otherwise.

Examples

Example where a point does not have unit sum …

>>> space = odl.rn(3)
>>> ind_sum = IndicatorSumConstraint(space)
>>> x = space.one()
>>> ind_sum(x)
inf

… and one where it does.

>>> x /= x.ufuncs.sum()
>>> ind_sum(x)
0