Implements the WeightedSum fallback class.


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.

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

Construct a weighted sum of expressions.

  • 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.

property expressions

The expressions being summed, without their coefficients.

property weights[source]

The coefficient vector as a PICOS column vector.