From eefe0b63e564320eb135eb66d6c02c9dc6e9e8de Mon Sep 17 00:00:00 2001 From: Tim King Date: Tue, 28 Feb 2012 21:26:35 +0000 Subject: This commit merges in branches/arithmetic/internalbb up to revision 2831. This is a significant refactoring of code. - r2820 -- Refactors Simplex so that it does significantly fewer functions. -- Adds the LinearEqualityModule for handling update and pivotAndUpdate and other utility functions that require access to both the tableau and partial model. -- Some of the code for propagation has moved to TheoryArith. -r2826 -- Small changes to documentation and removes the no longer implemented deduceLowerBound() and deduceUpperBound(). - r2827 -- Adds isZero() to Rational. Adds cmp to DeltaRational. - r2831 -- Refactored comparison to upper and lower in the partial model to use DeltaRational::cmp. -- Refactored AssertUpper and AssertLower in TheoryArith to include functionality that has weaseled into TheoryArith::assertionCases. --- src/util/rational_cln_imp.h | 4 ++++ src/util/rational_gmp_imp.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'src/util') diff --git a/src/util/rational_cln_imp.h b/src/util/rational_cln_imp.h index 885e6b628..69eede0d6 100644 --- a/src/util/rational_cln_imp.h +++ b/src/util/rational_cln_imp.h @@ -192,6 +192,10 @@ public: } } + bool isZero() const { + return cln::zerop(d_value); + } + Rational abs() const { if(sgn() < 0){ return -(*this); diff --git a/src/util/rational_gmp_imp.h b/src/util/rational_gmp_imp.h index 4635ce881..751c8f137 100644 --- a/src/util/rational_gmp_imp.h +++ b/src/util/rational_gmp_imp.h @@ -169,6 +169,10 @@ public: return mpq_sgn(d_value.get_mpq_t()); } + bool isZero() const { + return sgn() == 0; + } + Rational abs() const { if(sgn() < 0){ return -(*this); -- cgit v1.2.3