Skip to content

Monomial Sparsity

Torbjørn Cunis edited this page Mar 10, 2025 · 3 revisions

Monomial patterns describe the monomial terms a polynomial expression has.

monomials(x,deg)

creates a pattern of the l monomials in x with degree(s) in deg, where x must be a tuple of indeterminate variables (or a corresponding, vector-valed polynomial) and deg is a list of nonnegative integers; where l is the total number of such monomials.

Monomial patterns are defined by the class casos.Sparsity; if multiple patterns are concatenated to a vector or matrix, we call that a monomial sparsity pattern. The previous syntax is equivalent to

casos.Sparsity.scalar(x,deg)

while the following syntaxes can be used to create more complex, matrix-valued monomial sparsity patterns:

casos.Sparsity.dense(...,w)
casos.Sparsity.diag(...,w)
casos.Sparsity.band(...,w)
casos.Sparsity.banded(...,w)
casos.Sparsity.nonzeros(...,w)
casos.Sparsity.triplet(...,w)

where ... denotes arguments to the equivalent function of casadi.Sparsity and w is either a scalar monomial pattern or a monomial sparsity pattern with length equal to the nonzero matrix entries.

Both (scalar) monomial patterns and monomial sparsity patterns can be used to define symbolic polynomials.

Quick links

Cite us

If you use CaΣoS, please cite us.

CaΣoS logo

Clone this wiki locally