# HG changeset patch # User alpar # Date 1131121301 0 # Node ID 5faaa9880d4de9f91940815127e63e45e6cf04ae # Parent 657de7e5043cd9843cfbfbeccc072f049cdc24f2 (Dual)Expr::simplify(double tolerance) added diff -r 657de7e5043c -r 5faaa9880d4d lemon/lp_base.h --- a/lemon/lp_base.h Fri Nov 04 16:18:51 2005 +0000 +++ b/lemon/lp_base.h Fri Nov 04 16:21:41 2005 +0000 @@ -293,6 +293,16 @@ } } + ///Removes the coefficients closer to zero than \c tolerance. + void simplify(double &tolerance) { + for (Base::iterator i=Base::begin(); i!=Base::end();) { + Base::iterator j=i; + ++j; + if (std::fabs((*i).second)