picos.expressions.exp_wsum

Implements the WeightedSum fallback class.

Classes

class picos.expressions.exp_wsum.WeightedSum(expressions, weights=1, opstring=None)[source]

Bases: picos.expressions.expression.Expression

A convex or concave weighted sum of scalar expressions.

__add__(other)[source]

Denote addition with another expression on the right-hand side.

__ge__(other)[source]

Return a constraint that the expression is lower-bounded.

__init__(expressions, weights=1, opstring=None)[source]

Construct a weighted sum of expressions.

Parameters
  • expressions – A collection of scalar expressions.

  • weights – A constant weight vector.

  • opstring (str) – Used by PICOS internally when this class is tried as a last fallback to represent the result of an otherwise unsupported product or sum.

__le__(other)[source]

Return a constraint that the expression is upper-bounded.

__mul__(other)[source]

Denote multiplication with another expression on the right.

__neg__()[source]

Denote the negation of the expression.

__radd__(other)[source]

Denote addition with another expression on the left-hand side.

__rmul__(other)[source]

Denote multiplication with another expression on the left.

__rsub__(other)[source]

Denote subtraction of the expression from another expression.

__sub__(other)[source]

Denote subtraction of another expression from the expression.

property expressions

The expressions being summed, without their coefficients.

property weights[source]

The coefficient vector as a PICOS column vector.