* Implementation of GiNaC's constant types and some special constants. */
/*
- * 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
*
* 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 <string>
// public
-constant::constant() : basic(TINFO_constant), ef(0), serial(next_serial++)
+constant::constant() : basic(&constant::tinfo_static), ef(0), serial(next_serial++)
{
setflag(status_flags::evaluated | status_flags::expanded);
}
// public
constant::constant(const std::string & initname, evalffunctype efun, const std::string & texname)
- : basic(TINFO_constant), name(initname), ef(efun), serial(next_serial++)
+ : basic(&constant::tinfo_static), name(initname), ef(efun), serial(next_serial++)
{
if (texname.empty())
TeX_name = "\\mbox{" + name + "}";
}
constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname)
- : basic(TINFO_constant), name(initname), ef(0), number(initnumber), serial(next_serial++)
+ : basic(&constant::tinfo_static), name(initname), ef(0), number(initnumber), serial(next_serial++)
{
if (texname.empty())
TeX_name = "\\mbox{" + name + "}";
unsigned constant::calchash() const
{
- hashvalue = golden_ratio_hash(tinfo() ^ serial);
+ hashvalue = golden_ratio_hash((unsigned)tinfo() ^ serial);
setflag(status_flags::hash_calculated);