picos.expressions.set_ball¶
Implements Ball
.
Classes
- class picos.expressions.set_ball.Ball(radius=Constant(1), p=2, denominator_limit=1000)[source]¶
Bases:
Set
A ball of radius
according to a (generalized)
-norm.
- Definition
In the following,
refers to the vector
-norm or to the entrywise matrix
-norm, depending on the argument. See
Norm
for definitions.Let
.
For
or
(input as
float("inf")
), this is the convex setfor any
For a generalized
-norm with
, this is the convex set
for any
Note that
may not be complex if
due to the implicit
constraint in this case, which is not meaningful on the complex field.
Note further that
may be any scalar affine expression, it does not need to be constant.
Note
Due to significant differences in scope,
Ball
is not a subclass ofEllipsoid
even though both classes can represent Euclidean balls around the origin.- __init__(radius=Constant(1), p=2, denominator_limit=1000)[source]¶
Construct a
-norm ball of given radius.
- Parameters
radius (float or AffineExpression) – The ball’s radius.
p (float) – The value for
, which is cast to a limited precision fraction.
denominator_limit (int) – The largest allowed denominator when casting
to a fraction. Higher values can yield a greater precision at reduced performance.
- property p¶
The value
defining the
-norm used.
This is a limited precision version of the parameter used when the ball was constructed.
- property r¶
The ball’s radius
.