This package contains the constraint types that are used to express optimization constraints. You do not need to instanciate these constraints directly; it is more convenient to create them by applying Python’s comparison operators to algebraic expressions (see the Cheat Sheet).


AbsoluteValueConstraint(signedScalar, upperBound)

AffineConstraint(lhs, relation, rhs[, …])

An equality or inequality between two affine expressions.

Constraint(typeTerm[, customString, printSize])

An abstract base class for optimization constraints.

DetRootNConstraint(detRootN, lowerBound)

ExpConeConstraint(element[, customString])

An exponential cone constraint stating that (x, y, z) fulfills x \geq y e^{\frac{z}{y}} \land x > 0 \land y > 0.

FlowConstraint(G, f, source, sink, flow_value)

GeoMeanConstraint(geoMean, lowerBound)

KullbackLeiblerConstraint(divergence, upperBound)

LMIConstraint(lhs, relation, rhs[, customString])

An inequality with respect to the positive semidefinite cone, also known as a Linear Matrix Inequality (LMI) or an SDP constraint.

LSEConstraint(lse, upperBound)

An upper bound on a log-sum-exp expression.

LogConstraint(log, lowerBound)

A lower bound on a logarithmic expression.

MetaConstraint(tmpProblem, typeTerm[, …])

An abstract base class for optimization constraints that are comprised of auxiliary variables and constraints.

PNormConstraint(pNorm, relation, rhs)

PQNormConstraint(pqNorm, upperBound)

QuadConstraint(lowerEqualZero[, customString])

An upper bound on a scalar quadratic expression.

RSOCConstraint(normedExpression, …[, …])

A rotated second order cone constraint.

SOCConstraint(normedExpression, upperBound)

A second order cone (2-norm cone, Lorentz cone) constraint.

SumExpConstraint(theSum, upperBound)

SumExtremesConstraint(theSum, relation, rhs)

SymTruncSimplexConstraint(simplex, element)

TracePowConstraint(power, relation, rhs)