Implement special matrix vectorization formats.
These formats are used to efficiently store structured mutable types such as symmetric matrix variables in the form of real vectors.
- class picos.expressions.vectorizations.BaseVectorization(shape)¶
Abstract base class for special matrix vectorization formats.
Subclass instances are cached: If multiple instances of the same vectorization format and concerning matrices of the same shape are requested successively, then the instance created to serve the first request is retrieved from a cache on successive requests. The module attributes
CACHE_BULK_REMOVEcontrol the size of the cache for each vectorization format.
Due to how caching is implemented, derived classes may not inherit from each other but only from
Initialize a vectorization format for a fixed matrix shape.
- static __new__(cls, shape)¶
Lookup or create a vectorization format for a fixed matrix shape.
Given a special vectorization, return the corresponding matrix.
TypeError – If the input isn’t a CVXOPT column vector or does not have the expected numeric type or length.
Given a matrix, return its special vectorization.
- property dim¶
The length of the vectorization.
This corresponds to the dimension of a matrix mutable being vectorized.
- property identity¶
A linear mapping from the special to the full vectorization.
The term identity comes from the fact that these matrices are used as the coefficients that map the internal (vectorized) representation of a
Mutableobject to the
BiaffineExpressioninstance that represents the mutable in algebraic operations.
- property shape¶
The shape of matrices being vectorized.
- class picos.expressions.vectorizations.ComplexVectorization(shape)¶
An isometric vectorization that stacks real and imaginary parts.
- class picos.expressions.vectorizations.FullVectorization(shape)¶
A basic column-major matrix vectorization.
- class picos.expressions.vectorizations.HermitianVectorization(shape)¶
An isometric hermitian matrix vectorization.
The vectorization is isometric with respect to the Hermitian inner product on the matrices and the real dot product on their vectorizations.
Initialize a vectorization format for hermitian matrices.
- class picos.expressions.vectorizations.LowerTriangularVectorization(shape)¶
An isometric lower triangular matrix vectorization.
- class picos.expressions.vectorizations.SkewSymmetricVectorization(shape)¶
An isometric skew-symmetric matrix vectorization.
- class picos.expressions.vectorizations.SymmetricVectorization(shape)¶
An isometric symmetric matrix vectorization.
See [svec] for the precise vectorization used.
- class picos.expressions.vectorizations.UpperTriangularVectorization(shape)¶
An isometric upper triangular matrix vectorization.
Number of cached instances to drop at random when the cache is full.
- Default value
Number of instances to cache per vectorization format.
- Default value