solver
solver::LinExpr Class Reference

Helper class to ease the construction of a linear expression (e.g. More...

#include <Exprs.hpp>

Public Member Functions

 LinExpr (double constant=0.0)
 
 LinExpr (Var var, double coeff=1.0)
 
double getValue () const
 
size_t size () const
 
double & getConstant ()
 
const VargetVar (int i) const
 
double getCoeff (int i) const
 
const double & getConstant () const
 
void clear ()
 
LinExpr operator* (double factor) const
 
LinExproperator+= (const LinExpr &rhs)
 
LinExproperator+= (double a)
 
LinExproperator-= (double a)
 
LinExproperator-= (const LinExpr &rhs)
 
LinExpr operator/ (double a)
 
LinExpr operator+ (double a)
 
LinExpr operator- (double a)
 
LinExpr operator+ (Var var)
 
LinExpr operator- (Var var)
 
LinExpr operator+ (const LinExpr &rhs) const
 
LinExpr operator- (const LinExpr &rhs) const
 
LinExpr operator= (const LinExpr &rhs)
 
LinExproperator*= (double a)
 
LinExproperator/= (double a)
 

Static Public Member Functions

static bool isClean (const LinExpr &rhs)
 
static LinExpr clean (const LinExpr &rhs)
 

Private Attributes

double constant_
 
std::vector< Varvars_
 
std::vector< double > coeffs_
 

Friends

LinExpr operator+ (Var var)
 
LinExpr operator- (Var var)
 
LinExpr operator* (Var var, double a)
 
LinExpr operator* (double a, Var var)
 
LinExpr operator+ (Var x, Var y)
 
LinExpr operator- (Var x, Var y)
 
LinExpr operator/ (Var var, double a)
 
LinExpr operator+ (double a, Var var)
 
LinExpr operator+ (Var var, double a)
 
LinExpr operator- (double a, Var var)
 
LinExpr operator- (Var var, double a)
 
LinExpr operator+ (const LinExpr &rhs)
 
LinExpr operator- (const LinExpr &rhs)
 
LinExpr operator- (Var var, LinExpr rhs)
 
LinExpr operator+ (double a, const LinExpr &rhs)
 
LinExpr operator- (double a, const LinExpr &rhs)
 
LinExpr operator* (double factor, const LinExpr &rhs)
 
std::ostream & operator<< (std::ostream &stream, LinExpr expr)
 

Detailed Description

Helper class to ease the construction of a linear expression (e.g.

a*x = b)


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