* Implementation of relations between expressions */
/*
- * GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2008 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
*
* 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 <iostream>
// default constructor
//////////
-relational::relational() : basic(TINFO_relational) {}
+relational::relational() : basic(&relational::tinfo_static) {}
//////////
// other constructors
// 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
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();
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();
case not_equal:
return make_safe_bool(!ex_to<numeric>(df).is_zero());
case less:
- return make_safe_bool(ex_to<numeric>(df)<_num0);
+ return make_safe_bool(ex_to<numeric>(df)<(*_num0_p));
case less_or_equal:
- return make_safe_bool(ex_to<numeric>(df)<=_num0);
+ return make_safe_bool(ex_to<numeric>(df)<=(*_num0_p));
case greater:
- return make_safe_bool(ex_to<numeric>(df)>_num0);
+ return make_safe_bool(ex_to<numeric>(df)>(*_num0_p));
case greater_or_equal:
- return make_safe_bool(ex_to<numeric>(df)>=_num0);
+ return make_safe_bool(ex_to<numeric>(df)>=(*_num0_p));
default:
throw(std::logic_error("invalid relational operator"));
}