diff -r 371cf309fc3c -r 26983135fd6d lemon/lp_base.h --- a/lemon/lp_base.h Wed Nov 14 17:44:42 2007 +0000 +++ b/lemon/lp_base.h Wed Nov 14 17:53:08 2007 +0000 @@ -1369,9 +1369,27 @@ ///\e Value primal(Col c) const { return _getPrimal(_lpId(c)); } + ///\e + Value primal(const Expr& e) const { + double res = e.constComp(); + for (std::map::const_iterator it = e.begin(); + it != e.end(); ++it) { + res += _getPrimal(_lpId(it->first)) * it->second; + } + return res; + } ///\e Value dual(Row r) const { return _getDual(_lpId(r)); } + ///\e + Value dual(const DualExpr& e) const { + double res = 0.0; + for (std::map::const_iterator it = e.begin(); + it != e.end(); ++it) { + res += _getPrimal(_lpId(it->first)) * it->second; + } + return res; + } ///\e bool isBasicCol(Col c) const { return _isBasicCol(_lpId(c)); }