* Implementation of GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2002 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
namespace GiNaC {
-GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(symbol, basic)
+GINAC_IMPLEMENT_REGISTERED_CLASS(symbol, basic)
//////////
// default ctor, dtor, copy ctor, assignment operator and helpers
TeX_name = other.TeX_name;
serial = other.serial;
asexinfop = other.asexinfop;
- ++asexinfop->refcount;
+ ++(asexinfop->refcount);
}
void symbol::destroy(bool call_parent)
// public
-symbol::symbol(const symbol & other)
-{
- copy(other);
-}
-
symbol::symbol(const std::string & initname) : inherited(TINFO_symbol)
{
name = initname;
// public
-basic *symbol::duplicate() const
-{
- return new symbol(*this);
-}
-
void symbol::print(const print_context & c, unsigned level) const
{
if (is_a<print_tree>(c)) {
return inherited::info(inf);
}
-int symbol::degree(const ex & s) const
-{
- return is_equal(ex_to<basic>(s)) ? 1 : 0;
-}
-
-int symbol::ldegree(const ex & s) const
-{
- return is_equal(ex_to<basic>(s)) ? 1 : 0;
-}
-
-ex symbol::coeff(const ex & s, int n) const
-{
- if (is_equal(ex_to<basic>(s)))
- return n==1 ? _ex1 : _ex0;
- else
- return n==0 ? *this : _ex0;
-}
-
ex symbol::eval(int level) const
{
if (level == -max_recursion_level)