Antares Simulator
Power System Simulator
|
#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. | |
LinearExpression & | operator+= (const LinearExpression &value) |
Linear Expression Represents an expression that is linear in regard to an optimization problem's variables. It can be fully defined by:
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
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
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