The geometry package#
convexset#
- class mpt4py.geometry.convexset.ConvexSet[source]#
Bases:
ABC- add_function(func: FunctionBase | Callable[[ndarray[tuple[Any, ...], dtype[float64]]], float], func_name: str) None[source]#
Adds a function associated to the convex set.
- abstract property dim: int#
Returns the dimension of the convex set.
- distance(other: ndarray[tuple[Any, ...], dtype[float64]] | ConvexSet) floating[source]#
Compute the distance between this convex set \(\mathcal{C}\) and the given point \(z\) or convex set \(\mathcal{S}\).
By providing real vector \(z\), the distance between \(z\) and \(\mathcal{C}\) is computed by solving the optimization problem
\[\begin{split}\begin{align*} \min\limits_y &\quad \|z-y\|_2^2 \\ \text{s.t.} &\quad y \in \mathcal{C}. \end{align*}\end{split}\]By providing a convex set \(\mathcal{S}\), the distance between \(\mathcal{C}\) and \(\mathcal{S}\) is computed by solving the optimization problem
\[\begin{split}\begin{align*} \min\limits_{x,y} &\quad \|x-y\|_2^2 \\ \text{s.t.} &\quad x \in \mathcal{C}, \\ &\quad y \in \mathcal{S}. \end{align*}\end{split}\]
- extreme(x: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#
Computes an extreme point \(y\) of the set \(\mathcal{C}\) in the direction \(x\):
\[\begin{split}\begin{align*} \mathop{\arg\min}\limits_y &\quad x^\top y \\ \text{s.t.} &\quad y \in \mathcal{C} \\ \end{align*}\end{split}\]
- get_function(func_name: str) FunctionBase[source]#
Returns a function associated to the convex set.
- has_function(func_name: str | None = None) bool[source]#
Returns whether the convex set has a function specified by the name.
- project(x: ndarray[tuple[Any, ...], dtype[float64]]) ndarray[tuple[Any, ...], dtype[float64]][source]#
Projects the given point \(y\) onto the set \(\mathcal{C}\):
\[\begin{split}\begin{aligned} \min_x &\quad \|x - y\|_2^2 \\ \text{s.t.} &\quad x \in \mathcal{C} \end{aligned}\end{split}\]
- seperate(x: ndarray[tuple[Any, ...], dtype[float64]]) Hyperplane[source]#
Compute the maximal seperating hyperplane between the point x and the Set.
- shoot(r: ndarray[tuple[Any, ...], dtype[float64]], x0: ndarray[tuple[Any, ...], dtype[float64]]) Tuple[float, ndarray[tuple[Any, ...], dtype[float64]]][source]#
Computes the solution to the optimization problem:
\[\begin{split}\begin{align*} \max\limits_\alpha &\quad \alpha \\ \text{s.t.} &\quad x_0 + \alpha r \in \mathcal{C} \end{align*}\end{split}\]The problem can be explained as to find the point that lies along the line given by the ray \(r\) which starts from the point \(x_0\) such that it still lies inside the set \(\mathcal{C}\). Typically, the solution of this set is the point that lies on the boundary of the set, or can be Inf if the set is unbounded.
polyhedron#
- class mpt4py.geometry.polyhedron.Polyhedron(H: HData | None = None, V: VData | None = None)[source]#
Bases:
ConvexSetRepresents a polyhedron - a set defined by the intersection of a finite number of inequalities.
- property A: ndarray[tuple[Any, ...], dtype[float64]]#
Return the \(A\) matrix in H-representation. Will be computed if needed.
- property Ae: ndarray[tuple[Any, ...], dtype[float64]]#
Return the \(A_e\) matrix in H-representation. Will be computed if needed.
- property H: ndarray[tuple[Any, ...], dtype[float64]]#
Return the contatenated \([A \mid b]\) matrix in H-representation. Will be computed if needed.
- property He: ndarray[tuple[Any, ...], dtype[float64]]#
Return the contatenated \([A_e \mid b_e]\) matrix in H-representation. Will be computed if needed.
- property R: ndarray[tuple[Any, ...], dtype[float64]]#
Return the \(R\) matrix in V-representation. Will be computed if needed.
- property V: ndarray[tuple[Any, ...], dtype[float64]]#
Return the \(V\) matrix in V-representation. Will be computed if needed.
- property affine_dimension: int#
Compute the affine dimension of the polyhedron, i.e., the number of degrees of freedom you have when moving within the affine set.
Math
The implementation is based on the method proposed in Section 7.3 of Fukuda’s Polyhedral Computation.
For a V-polyhedron \(P = \{ x \in \mathbb{R}^n \mid x = V^\top \lambda + R^\top\mu, 1^\top \lambda = 1, \mu \geq 0, \lambda \geq 0\}\),
\[\begin{split}\text{affdim}(P) = \text{rank} \begin{bmatrix} V^\top & R^\top \\ 1_{1\times n} & 0_{1\times n} \end{bmatrix} -1.\end{split}\]For a H-polyhedron \(P = \{ x \in \mathbb{R}^n \mid A x \leq b, A_e x = b_e \}\):
\[\text{affdim}(P) = n - \text{rank}\tilde{A}_e.\]where \(\tilde{A}_e\) is the matrix containing all explicit and implicit equalities.
Note
If a polyhedron is empty, its affine dimension is defined as -1.
- affine_hull(inplace: bool = False) AffineSet[source]#
Compute the affine hull of the polyhedron, which is the smallest affine set that contains it.
This function detects if the polyhedron has an implicit affine set, e.g., if the inequalities contain \(\alpha^\top x \leq \beta\) and \(\alpha^\top x \geq \beta\).
If inplace == True, then the HData of this object is modified.
- affine_map(T: ndarray[tuple[Any, ...], dtype[float64]], t: ndarray[tuple[Any, ...], dtype[float64]] | None = None) Polyhedron[source]#
Computes an affine map \(P \rightarrow Q\) of polyhedron \(P\) to polyhedron \(Q\) based on the transformation matrix \(T\). The polyhedron \(Q\) is given by
\[Q = \{ y \in \mathbb{R}^n \mid y=Tx+t, x \in P \subseteq \mathbb{R}^d \}\]The matrix \(T\) must be real with \(n\) rows and \(d\) columns.
If \(n < d\) then this operation is referred to as projection.
If \(n = d\) then this operation is referred to as rotation/skew.
If \(n > d\) then this operation is referred to as lifting.
Note
This operation is also overloaded via
__matmul__and__add__. So for a Polyhedron objectP,P.affine_map(T, t)is equivalent toT @ P + t.See also
inv_affine_map()- Compute the inverse affine map
- property b: ndarray[tuple[Any, ...], dtype[float64]]#
Return the \(b\) vector in H-representation. Will be computed if needed.
- property be: ndarray[tuple[Any, ...], dtype[float64]]#
Return the \(b_e\) vector in H-representation. Will be computed if needed.
- static bounding_box(obj: ConvexSet) Polyhedron[source]#
Compute the minimum bounding box of the polyhedron.
If the polyhedron is unbounded, then the box will be unbounded in those directions.
Note that if the polyhedron has an affine hull, then the bounding box will take the form
\[B = \{ x\in\mathbb{R}^n \mid x_{lb} \leq x \leq x_{ub}, A_e x = b_e \}.\]
- cartesian_product(other: Polyhedron) Polyhedron[source]#
Compute the Cartesian product with another polyhedron. The Cartesian product of two polyhedra \(P\subseteq\mathbb{R}^m\) and \(Q\subseteq\mathbb{R}^n\) is defined as:
\[P \times Q := \{ (x,y) \in\mathbb{R}^{m+n} \mid x\in P, y \in Q \}.\]
- cheby_center(raise_on_empty_set: bool | None = True) Tuple[ndarray[tuple[Any, ...], dtype[float64]], float][source]#
Compute the center and radius of the polyhedron’s Chebyshev ball.
Given a polyhedron with H-representation, the center \(c\) and radius \(r\) of the Chebyshev ball is computed by solving the following Linear Programming:
\[\begin{split}\begin{align*} \max_{c,r} &\quad r \\ \text{s.t.} &\quad a_i c + \|a_i\|_2 r \leq b_i, \quad \forall i\in \{1,...,m\} \\ &\quad A_e c = b_e \end{align*}\end{split}\]where \(a_i\) is the \(i\) th row of \(A\) and \(m\) is the number of rows of \(A\).
Note
If the polyhedron is empty, the Chebyshev center is set to \(-\infty\) and the radius is set to \(-\infty\).
If the polyhedron is unbounded, the Chebyshev center is set to \(+\infty\) and the radius is set to \(+\infty\).
Warning
If the polyhedron is lower-dimensional and it only has a V-representation, then its H-representation is non-unique. Different H-representations give different Chebyshev balls.
- property codimension: int#
Returns the codimension of the polyhedron, i.e., the number of constraints/dimensions by which the affine set is “lower” than the ambient space.
For example, suppose we have a non-empty polyhedron
\[P = \{ x \in \mathbb{R}^n \mid A x \leq b, A_e x = b_e \},\]where the rank of \(A_e\) (number of rows) is \(m\). The codimension of \(P\) is \(m\).
- contains(inner: ndarray[tuple[Any, ...], dtype[float64]] | ConvexSet) bool[source]#
Determine if the given point or convex set is a subset of this polyhedron or not.
Note
The H-representation of the self polyhedron is required to test if one set is contained in another. Will be computed if needed.
If the inner set is unbounded and not a polyhedron, then this will likely raise an error.
Math
For two homogenized polyhedra \(P = \{x \mid Ax\leq 0, A_e x=0 \}\) and \(Q=\{x\mid Bx\leq 0, B_e x=0 \}\), to test if \(Q\subseteq P\):
If \(Q\) has V-rep, just test that all vertices and rays of \(Q\) are contained in \(P\).
If \(Q\) only has H-rep, use Farkas’ lemma: \(Q\subseteq P\) if and only if the following LP is feasible:
\[\begin{split}\begin{align*} \min_{\lambda, \mu, \mu_e} &\quad 0 \\ \text{s.t.} &\quad B = \lambda A + \mu A_e \\ &\quad B_e = \mu_e A_e \end{align*}\end{split}\]
- property dim: int#
Return the polyhedron’s dimension of representation.
See also
affine_dimension()- Compute the affine dimension of the polyhedron.codimension()- Compute the codimension of the polyhedron.
- classmethod empty_set(dim: int) Polyhedron[source]#
Create an empty polyhedron of given dimension which has a H-rep \(P = \{x \mid \mathbf{0}^{\top} x \leq -1\}\) and a V-rep (no vertices or rays).
- fplot(ax: Axes | Plotter, func_name: str | None = None, **kwargs)[source]#
Plot a single function over a polyhedron.
Note
Require H-representation. Will be computed if necessary.
- classmethod from_Hrep(*args, **kwargs) Polyhedron[source]#
Create a polyhedron from its H-representation.
This method initializes a polyhedron object using the H-representation data provided as arguments, which is encapsulated in an
HDataobject.- Parameters:
*args – Positional arguments to initialize the H-representation.
**kwargs – Keyword arguments to initialize the H-representation.
- Returns:
An instance of the
Polyhedronclass initialized with the given H-representation data.
See also
from_Vrep()- Create a polyhedron instance from its V-representation.
- classmethod from_Vrep(*args, **kwargs) Polyhedron[source]#
Create a polyhedron from its V-representation.
This method initializes a polyhedron object using the V-representation data provided as arguments, which is encapsulated in an
VDataobject.- Parameters:
*args – Positional arguments to initialize the V-representation.
**kwargs – Keyword arguments to initialize the V-representation.
- Returns:
An instance of the
Polyhedronclass initialized with the given V-representation data.
See also
from_Hrep()- Create a polyhedron instance from its H-representation.
- classmethod from_bounds(lb: ndarray[tuple[Any, ...], dtype[float64]], ub: ndarray[tuple[Any, ...], dtype[float64]]) Polyhedron[source]#
Create a polyhedron from upper and lower bounds.
If the upper bounds contain
numpy.infor the lower bounds contain-numpy.inf, the corresponding dimensions are treated as unbounded.The resulting polyhedron has both H-representation and V-representation. The H-rep is \(P = \{x \mid x_{lb} \leq x \leq x_{ub}\}\) and the minimal V-rep is computed accordingly.
- get_facet(index: int | list[int] | None = None) Polyhedron | list[Polyhedron][source]#
Extract the facets of the polyhedron specified by the inequality indices. Each facet is a polyhedron formed by rewriting the indexed ineqality as an equality constraint.
For a polyhedron \(P\) in H-representation:
\[P = \{ x\in\mathbb{R}^n \mid a_i^\top x \leq b_i, i \in \{1, ..., m\}, A_e x = b_e \}\]given an index \(k\), the facet polyhedron \(Q\) is built as:
\[Q = \{ x\in\mathbb{R}^n \mid a_i^\top x \leq b_i, i \in \{1, ..., m\} \backslash \{k\}, a_k^\top x = b_k, A_e x = b_e \}\]- Parameters:
index (int) – an integer or list of integers. If not provided, a list of all facets will be returned.
Note
The polyhedron must have minimal (irredundant) H-representation, otherwise an error will be thrown. Consider calling
minHrep()beforehand.
- property hasHrep: bool#
Tell if the polyhedron has a H-representation or not.
- property hasVrep: bool#
Tell if the polyhedron has a V-representation or not.
- hausdorff_distance(other: Polyhedron) float[source]#
Compute the Hausdorff distance between two polyhedra.
For two polyhedra \(P\) and \(Q\), the Hausdorff distance is defined as:
\[d_H(P, Q) = \max\left\{ \max\limits_{x\in P} \min\limits_{y\in Q} \|x-y\|, \max\limits_{y\in Q} \min\limits_{x\in P} \|x-y\| \right\}.\]Note
This method is computationally expensive, as it requires to compute the distances of all vertices to another set for both polyhedra.
- homogenize() Polyhedron[source]#
Homogenize the Polyhedron into a cone.
For an H-representation \(P = \{ x\in\mathbb{R}^n \mid A x \leq b, A_e x = b_e \}\), its homogenization is:
\[\bar{P} = \{ y\in\mathbb{R}^{n+1} \mid [A ~-b] \leq 0, [A_e ~-b_e] x = 0 \}.\]For a V-representation: \(P = \{ x\in\mathbb{R}^n \mid x = V^\top v + R^\top r, r \geq 0, v\geq 0, 1^\top v = 1 \}\), its homogenization is:
\[\begin{split}P_h = \{ y\in\mathbb{R}^{n+1} \mid y=\begin{bmatrix} V^\top & R^\top \\ 1 & 0\end{bmatrix} l, l \geq 0 \}.\end{split}\]
- property incidence_map: dict#
Compute the incidence map of the polyhedron.
The incidence map describes containment of vertices in facets.
Note
This function computes both irredundant H-rep and V-rep and can be time consuming.
Warning
This function is not implemented yet. Calling it will raise
NotImplementedError.
- interior_point(facet_index: int | None = None) Tuple[ndarray[tuple[Any, ...], dtype[float64]], bool][source]#
Compute an interior point of the polyhedron.
- Parameters:
facet_index (int) – the index of the facet to compute the interior point for. If None, compute the interior point of the whole polyhedron.
- Returns:
An interior point of the polyhedron and a boolean indicating whether the point is strictly inside the polyhedron.
- intersect(other: Polyhedron) Polyhedron[source]#
Compute the intersection of this polyhedron with another Polyhedron.
- inv_affine_map(T: ndarray[tuple[Any, ...], dtype[float64]], t: ndarray[tuple[Any, ...], dtype[float64]] | None = None) Polyhedron[source]#
Computes an inverse affine map \(Q\) of polyhedron \(P\) based on the transformation matrix \(T\) and vector \(t\). The polyhedron \(Q\) is given by:
\[Q = \{ x \in \mathbb{R}^n \mid T x + t \in P \subseteq \mathbb{R}^n \}\]The matrix \(T\) must be a square real matrix. The vector \(t\), if omitted, defaults to a zero vector of corresponding dimension.
See also
affine_map()- Compute the affine map
- is_adjacent(other: Polyhedron) bool[source]#
Test if a polyhedron shares a facet with another polyhedron.
Return true if the polyhedron P has a facet-to-facet property with the polyhedron Q. Both polyhedra must be in H-representation. If they are not, the irredundant H-representations will be computed.
The function tests if polyhedra P and Q are adjacent by checking if their intersection is of dimension \(d-1\) and if the intersection is a facet of both polyhedra.
See also
is_neighbor()- Determine if two polyhedra are neighbors.
- property is_bounded#
Returns True if the polyhedron is bounded and False otherwise.
- property is_empty: bool#
Returns True if the polyhedron is empty and False otherwise.
- property is_full_dim: bool#
Determine if the polyhedron is full dimensional or not.
A polyhedron \(P\in\mathbb{R}^n\) is full dimensional if and only if the dimension of its affine dimension is the same as \(n\) (its dimension of representation), or equivalently if there exists a non-empty ball of dimension \(n\) that is contained within it.
- is_neighbor(other: Polyhedron) Tuple[bool, int | None, int | None][source]#
Test if a polyhedron touches another polyhedron along a given facet.
Return True if the polyhedron \(P\) shares with another polyhedron \(Q\) a part of a common facet. Both polyhedra must be in H-representation. If they are not, the irredundant H-representations will be computed.
The function tests if the intersection of two polyhedra \(P\) and S in dimension d is nonempty and is of dimension \(d-1\). If this holds, then the two polyhedra are touching themself along one facet.
Note
If one of the polyhedra is empty, the function will return False.
See also
is_adjacent()- Determine if two polyhedra are adjacent.
- lift(num_dims: int) Polyhedron[source]#
Lift the polyhedron \(P\in\mathbb{R}^n\) to a higher dimension in \(\mathbb{R}^{n+m}\):
\[\{ (x, y) \mid x \in P, y \in \mathbb{R}^m \}.\]
- minHrep(inplace: bool = True, use_cdd: bool = False) HData[source]#
Compute the minimal H-representation of the polyhedron.
- Parameters:
inplace – If True, the current object is modified.
use_cdd – If True, the pycddlib is used for the redundancy elimination. Otherwise the built-in implementation is used.
- Returns:
The minimal H-representation of the polyhedron.
Note
If an H-representation is already known, then this function performs redundancy elimination. Otherwise, facet enumeration will be performed first.
If the polyhedron is empty, no redundancy elimination will be performed.
Math
The redundancy elimination of H-representation performs the following steps.
First, attempt to identify some irredundant inequalities using ray shooting heuristics if the polyhedron is full-dimensional. Draw a number of rays from a strict interior point along random directions. For each ray, the inequality it intersects first must be irredundant.
Second, identify redundant inequalities using Linear Programming. For each inequality \(a_j x \leq b_j\), solve the following LP:
\[\begin{split}\begin{align*} \max_x &\quad a_j x \\ \text{s.t.} &\quad a_i x \leq b_i, \quad \forall i\neq j \\ &\quad a_j x \leq b_j + 1, \\ &\quad A_e x = b_e. \\ \end{align*}\end{split}\]This LP is guaranteed to be bounded. The inequality \(a_j x \leq b_j\) is irredundant if the LP’s optimal objective value is strictly greater than \(b_j\) and redundant otherwise.
- minVrep(inplace: bool = True, use_cdd: bool = False) VData[source]#
Returns the minimal V-representation of the polyhedron.
If inplace is True, then the current object is modified.
Math
The redundancy elimination of V-representation performs the following steps:
1. Eliminate redundant rays. An extreme ray \(r_j\) is redundant if it can be written as the non-negative linear combination of other rays \(r_i\), i.e., if the following LP is feasible:
\[\begin{split}\begin{align*} \min_\mu &\quad 0 \\ \text{s.t.} &\quad r_j = \sum\limits_{i\neq j} \mu_i r_i \\ &\quad \mu_i \geq 0 \end{align*}\end{split}\]2. Eliminate redundant vertices. The method we use is an extension of Section 2.19 in Fukuda’s PolyFAQ. A vertex \(v_j\) is redundant if the following LP is infeasible:
\[\begin{split}\begin{align*} \min\limits_{z, z_0} &\quad 0 \\ \text{s.t.} &\quad z^\top v_j > z_0 \\ &\quad z^\top v_i \leq z_0 \\ &\quad z^\top r_k < 0 \end{align*}\end{split}\]
- minkowski_sum(other: ndarray[tuple[Any, ...], dtype[float64]] | Polyhedron) Polyhedron[source]#
Compute the Minkowski sum of the polyhedron with a point or another polyhedron.
The Minkowski sum of a polyhedron \(P\subseteq\mathbb{R}^n\) and a point \(z\in\mathbb{R}^n\) is defined as:
\[P \oplus z = \{ x+z \mid x\in P \}.\]The Minkowski sum of two polyhedra \(P\subseteq\mathbb{R}^n\) and \(Q\subseteq\mathbb{R}^n\) is defined as:
\[P \oplus Q = \{ x+y \mid x\in P, y\in Q \}.\]
- plot(ax: Axes | Plotter, **kwargs)[source]#
Plot the Polyhedron.
Note
Require V-representation. Will be computed if necessary.
- pontryagin_difference(other: ndarray[tuple[Any, ...], dtype[float64]] | Polyhedron) Polyhedron[source]#
Compute the Pontryagin difference between a polyhedron with a point or another polyhedron.
The Pontryagin difference of a polyhedron \(P\subseteq\mathbb{R}^n\) with a point \(z\in\mathbb{R}^n\) is defined as:
\[P \ominus z = \{ x-z \mid x\in P \} = P \oplus (-z).\]The Pontryagin difference of a polyhedron \(P\subseteq\mathbb{R}^n\) with another polyhedron \(Q\subseteq\mathbb{R}^n\) is defined as:
\[P \ominus Q = \{ x\in P \mid \forall y\in Q, x+y \in P \}.\]
- projection(dims: Sequence[int], method: str | None = None) Polyhedron[source]#
Compute the orthogonal projection of the polyhedron on given dimensions.
- sample(n_samples: int, strictly_interior: bool = False, method: Literal['hit_and_run', 'reject'] = 'reject', *, rng: Generator | None = None, batch_size: int = 1024, max_attempts: int | None = None, whitening: bool = True, verbose: bool = False) ndarray[source]#
Uniformuly sample random points inside the polyhedron. Requires the polyhedron to be bounded and non-empty.
- classmethod singleton(point: ndarray[tuple[Any, ...], dtype[float64]]) Polyhedron[source]#
Create a polyhedron that contains only a single point. The H-rep is \(P = \{x \mid x = v\}\) where \(v\) is the given point. The V-rep contains the point as the only vertex and no rays.
- property volume: float#
Compute the volume of this polyhedron.
Note
The volume of a polyhedron is defined as 0 if it is lower-dimensional or empty and \(\infty\) if it is full-dimensional and unbounded.
zonotope#
- class mpt4py.geometry.zonotope.Zonotope(G: ndarray[tuple[Any, ...], dtype[float64]], c: ndarray[tuple[Any, ...], dtype[float64]] | None = None)[source]#
Bases:
PolyhedronThe zonotope class.
A zonotope \(\mathcal{Z}\subset \mathbb{R}^n\) is defined as:
\[\mathcal{Z} := \{ c+\sum\limits_{i=1}^p \beta_i g_i \mid \beta_i \in \left[-1,1\right] \}\]- property G: ndarray[tuple[Any, ...], dtype[float64]]#
Get the generator matrix of the zonotope.
- affine_map(T: ndarray[tuple[Any, ...], dtype[float64]], t: ndarray[tuple[Any, ...], dtype[float64]] | None = None) Zonotope[source]#
Apply an affine transformation to the zonotope.
- Parameters:
T – Affine transformation matrix.
t – Translation vector.
- property c: ndarray[tuple[Any, ...], dtype[float64]]#
Get the center of the zonotope.
- property center: ndarray[tuple[Any, ...], dtype[float64]]#
Get the center of the zonotope.
- property dim: int#
Return the polyhedron’s dimension of representation.
See also
affine_dimension()- Compute the affine dimension of the polyhedron.codimension()- Compute the codimension of the polyhedron.
- property generators: ndarray[tuple[Any, ...], dtype[float64]]#
Get the generator matrix of the zonotope.
- minkowski_sum(other: ndarray[tuple[Any, ...], dtype[float64]] | Polyhedron | Zonotope) Polyhedron | Zonotope[source]#
Compute the Minkowski sum of two zonotopes.
ellipsoid#
- class mpt4py.geometry.convexset.Ellipsoid(P: ndarray[tuple[Any, ...], dtype[float64]], center: ndarray[tuple[Any, ...], dtype[float64]] | None = None, radius: float = 1.)[source]#
Bases:
ConvexSetRepresents an ellipsoid:
\[\{ x \in \mathbb{R}^n \mid (x - c)^\top P (x - c) \leq r^2 \}\]where \(P\in\mathbb{R}^{n\times n}\) is positive semi-definite.
- property dim: int#
Returns the dimension of the convex set.
- plot(fig: PlotterProtocol, **kwargs)[source]#
Plot the ellipsoid.
- Parameters:
fig (PlotterProtocol) – _description_