Antares Simulator
Power System Simulator
Loading...
Searching...
No Matches
Antares::Optimization::LinearExpression Class Reference

#include <LinearExpression.h>

Public Member Functions

 LinearExpression ()=default
 Build a linear expression with zero offset and zero coefficients.
 
 LinearExpression (double offset, FullKeyMap coef_per_var)
 
LinearExpression operator+ (const LinearExpression &other) const
 Sum two linear expressions.
 
LinearExpression operator- (const LinearExpression &other) const
 Subtract two linear expressions.
 
LinearExpression operator* (const LinearExpression &other) const
 
LinearExpression operator/ (const LinearExpression &other) const
 
LinearExpression operator- () const
 Multiply linear expression by -1.
 
double offset () const
 Get the offset.
 
const FullKeyMap & coefPerVar () const
 Get the non-zero coefficients per variable ID.
 
LinearExpressionoperator+= (const LinearExpression &value)
 

Detailed Description

Linear Expression Represents an expression that is linear in regard to an optimization problem's variables. It can be fully defined by:

  • the non-zero coefficients of the variables
  • a scalar offset

Constructor & Destructor Documentation

◆ LinearExpression()

Antares::Optimization::LinearExpression::LinearExpression ( double offset,
FullKeyMap coef_per_var )

Build a linear expression with a given offset and a given map of non-zero coefficients per variable ID

Member Function Documentation

◆ operator*()

LinearExpression Antares::Optimization::LinearExpression::operator* ( const LinearExpression & other) const

Multiply two linear expressions Only one can have non-zero coefficients, otherwise the result cannot be linear

◆ operator/()

LinearExpression Antares::Optimization::LinearExpression::operator/ ( const LinearExpression & other) const

Divide two linear expressions Only first expression can have non-zero coefficients, otherwise the result cannot be linear


The documentation for this class was generated from the following files: