X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Frelational.cpp;h=324b2a5d72a82d4809a22f85a9c1f4e5dbd9ce23;hp=86e2c2e8399bde1fbea5eb4db966e69aa2870f27;hb=a9909685b1ea5014a81a2d2e5963203637bdb3ce;hpb=23acc666fcef311fd97092aee7f8c55e80395351 diff --git a/ginac/relational.cpp b/ginac/relational.cpp index 86e2c2e8..324b2a5d 100644 --- a/ginac/relational.cpp +++ b/ginac/relational.cpp @@ -3,7 +3,7 @@ * Implementation of relations between expressions */ /* - * GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include @@ -40,7 +40,7 @@ GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(relational, basic, // default constructor ////////// -relational::relational() : basic(TINFO_relational) {} +relational::relational() : basic(&relational::tinfo_static) {} ////////// // other constructors @@ -48,7 +48,7 @@ relational::relational() : basic(TINFO_relational) {} // public -relational::relational(const ex & lhs, const ex & rhs, operators oper) : basic(TINFO_relational), lh(lhs), rh(rhs), o(oper) {} +relational::relational(const ex & lhs, const ex & rhs, operators oper) : basic(&relational::tinfo_static), lh(lhs), rh(rhs), o(oper) {} ////////// // archiving @@ -250,7 +250,7 @@ unsigned relational::return_type() const return lh.return_type(); } -unsigned relational::return_type_tinfo() const +tinfo_t relational::return_type_tinfo() const { GINAC_ASSERT(lh.return_type_tinfo()==rh.return_type_tinfo()); return lh.return_type_tinfo(); @@ -258,7 +258,7 @@ unsigned relational::return_type_tinfo() const unsigned relational::calchash() const { - unsigned v = golden_ratio_hash(tinfo()); + unsigned v = golden_ratio_hash((p_int)tinfo()); unsigned lhash = lh.gethash(); unsigned rhash = rh.gethash(); @@ -338,13 +338,13 @@ relational::operator relational::safe_bool() const case not_equal: return make_safe_bool(!ex_to(df).is_zero()); case less: - return make_safe_bool(ex_to(df)<_num0); + return make_safe_bool(ex_to(df)<(*_num0_p)); case less_or_equal: - return make_safe_bool(ex_to(df)<=_num0); + return make_safe_bool(ex_to(df)<=(*_num0_p)); case greater: - return make_safe_bool(ex_to(df)>_num0); + return make_safe_bool(ex_to(df)>(*_num0_p)); case greater_or_equal: - return make_safe_bool(ex_to(df)>=_num0); + return make_safe_bool(ex_to(df)>=(*_num0_p)); default: throw(std::logic_error("invalid relational operator")); }