From: Aina Niemetz Date: Mon, 6 Nov 2017 11:22:44 +0000 (-0800) Subject: Add getValue() for Rational and Integer (GMP and CLN). (#1309) X-Git-Tag: cvc5-1.0.0~5509 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d1467e740c17fe500bd598375165c2018305e0b3;p=cvc5.git Add getValue() for Rational and Integer (GMP and CLN). (#1309) Returns a copy of d_value to enable public access of GMP and CLN data. --- diff --git a/src/util/integer_cln_imp.h b/src/util/integer_cln_imp.h index 86cf649d0..c2791af52 100644 --- a/src/util/integer_cln_imp.h +++ b/src/util/integer_cln_imp.h @@ -102,6 +102,14 @@ public: ~Integer() {} + /** + * Returns a copy of d_value to enable public access of CLN data. + */ + cln::cl_I getValue() const + { + return d_value; + } + Integer& operator=(const Integer& x){ if(this == &x) return *this; d_value = x.d_value; diff --git a/src/util/integer_gmp_imp.h b/src/util/integer_gmp_imp.h index 0d0735127..5f676dbc5 100644 --- a/src/util/integer_gmp_imp.h +++ b/src/util/integer_gmp_imp.h @@ -78,6 +78,14 @@ public: ~Integer() {} + /** + * Returns a copy of d_value to enable public access of GMP data. + */ + mpz_class getValue() const + { + return d_value; + } + Integer& operator=(const Integer& x){ if(this == &x) return *this; d_value = x.d_value; diff --git a/src/util/rational_cln_imp.h b/src/util/rational_cln_imp.h index 23b733214..bdfff9875 100644 --- a/src/util/rational_cln_imp.h +++ b/src/util/rational_cln_imp.h @@ -176,6 +176,13 @@ public: ~Rational() {} + /** + * Returns a copy of d_value to enable public access of CLN data. + */ + cln::cl_RA getValue() const + { + return d_value; + } /** * Returns the value of numerator of the Rational. diff --git a/src/util/rational_gmp_imp.h b/src/util/rational_gmp_imp.h index e731f3c2f..70146561d 100644 --- a/src/util/rational_gmp_imp.h +++ b/src/util/rational_gmp_imp.h @@ -168,6 +168,14 @@ public: } ~Rational() {} + /** + * Returns a copy of d_value to enable public access of GMP data. + */ + mpq_class getValue() const + { + return d_value; + } + /** * Returns the value of numerator of the Rational. * Note that this makes a deep copy of the numerator.