]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.cpp
added check for archiving system
[ginac.git] / ginac / symbol.cpp
index 169ee631bc5ef0361f855ef3e7267a764e58c345..09e4192b689cdf27ed3f6fb5c52958bdb44011e7 100644 (file)
@@ -25,7 +25,6 @@
 
 #include "symbol.h"
 #include "lst.h"
-#include "idx.h"
 #include "archive.h"
 #include "debugmsg.h"
 #include "utils.h"
@@ -141,7 +140,7 @@ void symbol::print(std::ostream & os, unsigned upper_precedence) const
 void symbol::printraw(std::ostream & os) const
 {
        debugmsg("symbol printraw",LOGLEVEL_PRINT);
-       os << "symbol(" << "name=" << name << ",serial=" << serial
+       os << class_name() << "(" << "name=" << name << ",serial=" << serial
           << ",hash=" << hashvalue << ",flags=" << flags << ")";
 }
 
@@ -188,19 +187,19 @@ bool symbol::has(const ex & other) const
                return false;
 }
 
-int symbol::degree(const symbol & s) const
+int symbol::degree(const ex & s) const
 {
-       return compare_same_type(s)==0 ? 1 : 0;
+       return is_equal(*s.bp) ? 1 : 0;
 }
 
-int symbol::ldegree(const symbol & s) const
+int symbol::ldegree(const ex & s) const
 {
-       return compare_same_type(s)==0 ? 1 : 0;
+       return is_equal(*s.bp) ? 1 : 0;
 }
 
-ex symbol::coeff(const symbol & s, int n) const
+ex symbol::coeff(const ex & s, int n) const
 {
-       if (compare_same_type(s)==0)
+       if (is_equal(*s.bp))
                return n==1 ? _ex1() : _ex0();
        else
                return n==0 ? *this : _ex0();
@@ -222,24 +221,6 @@ ex symbol::eval(int level) const
        }
 }
 
-ex symbol::subs(const lst & ls, const lst & lr) const
-{
-       GINAC_ASSERT(ls.nops()==lr.nops());
-#ifdef DO_GINAC_ASSERT
-       for (unsigned i=0; i<ls.nops(); i++)
-               GINAC_ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
-                            is_ex_of_type(ls.op(i),idx));
-#endif // def DO_GINAC_ASSERT
-
-       for (unsigned i=0; i<ls.nops(); i++) {
-               if (is_ex_exactly_of_type(ls.op(i),symbol)) {
-                       if (compare_same_type(ex_to_symbol(ls.op(i)))==0)
-                               return lr.op(i);
-               }
-       }
-       return *this;
-}
-
 // protected
 
 /** Implementation of ex::diff() for single differentiation of a symbol.