cr.sparse.opt.indicator_singleton

cr.sparse.opt.indicator_singleton(c)[source]

Returns an indicator function for a singleton set \(C = \{c\}\)

Parameters

c (jax.numpy.ndarray) – An array

Returns

An indicator function

Let \(C\) be a singleton convex set \(\{ c\}\) where \(c \in \RR^n\).

We implement its indicator function as:

(1)\[\begin{split}I(x) = \begin{cases} 0 & \text{if } x = c \\ \infty & \text{if } x \neq c \end{cases}\end{split}\]

Note

The implementation broadcasts \(c\) to the shape of \(x\) before making the comparison.

Thus if \(c == 4\) and \(x = [4,4,4,4]\), then \(I(x) = 0\).