constraint.py¶
Constraint¶

class
picos.
Constraint
(typeOfConstraint, Id, Exp1, Exp2, Exp3=None, dualVariable=None, key=None)¶ A class for describing a constraint.

Exp1
= None¶ LHS

Exp2
= None¶ RHS (ignored for constraints of type
lse
andquad
, whereExp2
is set to0
)

Exp3
= None¶ Second factor of the RHS for
RScone
constraints (seetypeOfConstraint
).

Id
= None¶ An integer identifier

boundCons
= None¶ stores list of bounds of the form (var,index,lower,upper)

delete
()¶ deletes the constraint from Problem

dual
¶ Value of the dual variable associated to this constraint
See the note on dual variables in the tutorial for more information.

exp3ConeVar
= None¶ for a constraint of the form x<u or x^2<u v, stores x, u and v

key
= None¶ A string to give a key name to the constraint

passed
= None¶ list of solvers to which this constraints was already passed

semidefVar
= None¶ for a constraint of the form X>>0, stores the semidef variable

slack
¶ Value of the slack variable associated to this constraint (should be nonnegative/zero if the inequality/equality is satisfied: for an inequality of the type
lhs<rhs
, the slack isrhslhs
, and forlhs>rhs
the slack islhsrhs
)

typeOfConstraint
= None¶ A string from the following values, indicating the type of constraint:
lin<
,lin=
orlin>
: Linear (in)equalityExp1 ≤ Exp2
,Exp1 = Exp2
orExp1 ≥ Exp2
.SOcone
: Second Order Cone constraintExp1 < Exp2
.RScone
: Rotated Cone constraintExp1**2 < Exp2 * Exp3
.lse
: Geometric Programming constraintLogSumExp(Exp1)<0
quad
: scalar quadratic constraintExp1 < 0
.sdp<
orsdp>
: semidefinite constraintExp1 ≼ Exp2
orExp1 ≽ Exp2
.

GeoMeanConstraint¶

class
picos.
GeoMeanConstraint
(expaff, expgeo, Ptmp, constring)¶ A temporary object used to pass geometric mean inequalities. This class derives from
Constraint
.
delete
()¶ deletes the constraint from Problem

prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called

NormP_Constraint¶

class
picos.
NormP_Constraint
(expaff, expnorm, alpha, beta, Ptmp, constring)¶ A temporary object used to pass pnorm inequalities. This class derives from
Constraint

delete
()¶ deletes the constraint from Problem

prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called

NormPQ_Constraint¶

class
picos.
NormPQ_Constraint
(expaff, expnorm, p, q, Ptmp, constring)¶ A temporary object used to pass (p,q)norm inequalities. This class derives from
Constraint

delete
()¶ deletes the constraint from Problem

prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called

TracePow_Constraint¶

class
picos.
TracePow_Constraint
(exprhs, explhs, alpha, beta, M, Ptmp, constring)¶ A temporary object used to pass (trace of) pth power inequalities This class derives from
Constraint

delete
()¶ deletes the constraint from Problem

prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called

Flow_Constraint¶

class
picos.
Flow_Constraint
(G, Ptmp, constring)¶ A temporary object used to pass a flow constraint. This class derives from
Constraint
.
prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called

DetRootN_Constraint¶

class
picos.
DetRootN_Constraint
(exprhs, expdet, Ptmp, constring)¶ A temporary object used to pass nth root of determinant inequalities. This class derives from
Constraint

delete
()¶ deletes the constraint from Problem

prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called

Sumklargest_Constraint¶

class
picos.
Sumklargest_Constraint
(rhs, exp, k, eigenvalues, islargest, Ptmp, constring)¶ A temporary object used to pass constraints involving “sum of k largest elements”. This class derives from
Constraint

delete
()¶ deletes the constraint from Problem

prefix
= None¶ prefix to be added to the names of the temporary variables when add_constraint() is called
