There are several ways to access and modify the contents of this container.
std::map<Row,double>
, so for expamle if e
is an DualExpr and v
and w
are of type Row, then you can read and modify the coefficients like these. e[v]=5; e[v]+=12; e.erase(v);
double s=0; for(LpSolverBase::DualExpr::iterator i=e.begin();i!=e.end();++i) s+=i->second;
double
's) and variables (Rows) directly convert to an DualExpr and the usual linear operations are defined, so v+w 2*v-3.12*(v-w/2) v*2.1+(3*v+(v*12+w)*3)/2
e=v+w; e+=2*v-3.12*(v-w/2); e*=3.4; e/=5;
#include <lemon/lp_base.h>
Inherits std::map<Row,Value>.
Public Member Functions | |
DualExpr () | |
| |
DualExpr (const Key &v) | |
| |
void | set (const Key &v, const Value &c) |
| |
void | simplify () |
Removes the components with zero coefficient. | |
void | simplify (double &tolerance) |
Removes the coefficients closer to zero than tolerance . | |
void | clear () |
Sets all coefficients to 0. | |
DualExpr & | operator+= (const DualExpr &e) |
| |
DualExpr & | operator-= (const DualExpr &e) |
| |
DualExpr & | operator*= (const Value &c) |
| |
DualExpr & | operator/= (const Value &c) |
| |
Related Functions | |
(Note that these are not member functions.) | |
LpSolverBase::DualExpr | operator+ (const LpSolverBase::DualExpr &a, const LpSolverBase::DualExpr &b) |
| |
LpSolverBase::DualExpr | operator- (const LpSolverBase::DualExpr &a, const LpSolverBase::DualExpr &b) |
| |
LpSolverBase::DualExpr | operator* (const LpSolverBase::DualExpr &a, const LpSolverBase::Value &b) |
| |
LpSolverBase::DualExpr | operator* (const LpSolverBase::Value &a, const LpSolverBase::DualExpr &b) |
| |
LpSolverBase::DualExpr | operator/ (const LpSolverBase::DualExpr &a, const LpSolverBase::Value &b) |
|