]> www.ginac.de Git - ginac.git/blobdiff - ginac/expairseq.h
- change triggered by newer automake version
[ginac.git] / ginac / expairseq.h
index faaa7532294d1a585853b638caec0aa480cc7f41..d9d7bf0530ecf6f78ef294f90be03fba848e63d2 100644 (file)
@@ -1,6 +1,9 @@
 /** @file expairseq.h
  *
- *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *  Interface to sequences of expression pairs. */
+
+/*
+ *  GiNaC Copyright (C) 1999-2000 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
 
 #include <vector>
 #include <list>
+
+// CINT needs <algorithm> to work properly with <vector> and <list>
+//#include <algorithm>
+
 #include <ginac/expair.h>
 
+#ifndef NO_GINAC_NAMESPACE
+namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
+
 //#define EXPAIRSEQ_USE_HASHTAB
 
 typedef vector<expair> epvector;
@@ -31,7 +42,6 @@ typedef epvector::iterator epviter;
 
 inline void iter_swap(epvector::iterator it1, epvector::iterator it2)
 {
-    debugmsg("iter_swap epvector",LOGLEVEL_NONMEMBER_FUNCTION);
     (*it1).rest.swap((*it2).rest);
     (*it1).coeff.swap((*it2).coeff);
 }
@@ -47,6 +57,8 @@ typedef vector<epplist> epplistvector;
  *  the same way.) */
 class expairseq : public basic
 {
+    GINAC_DECLARE_REGISTERED_CLASS(expairseq, basic)
+
 // member functions
 
     // default constructor, destructor, copy constructor assignment operator and helpers
@@ -56,11 +68,9 @@ public:
         , hashtabsize(0)
 #endif // def EXPAIRSEQ_USE_HASHTAB
         {
-            debugmsg("expairseq default constructor",LOGLEVEL_CONSTRUCT);
         }
     ~expairseq()
         {
-            debugmsg("expairseq destructor",LOGLEVEL_DESTRUCT);
             destroy(0);
         }
     expairseq(expairseq const & other);
@@ -82,11 +92,11 @@ public:
     // functions overriding virtual functions from bases classes
 public:
     basic * duplicate() const;
+    void print(ostream & os, unsigned upper_precedence=0) const;
     void printraw(ostream & os) const;
     void printtree(ostream & os, unsigned indent) const;
-    void print(ostream & os, unsigned upper_precedence=0) const;
     bool info(unsigned inf) const;
-    int nops() const;
+    unsigned nops() const;
     ex op(int const i) const;
     ex & let_op(int const i);
     ex eval(int level=0) const;
@@ -186,6 +196,14 @@ protected:
 extern const expairseq some_expairseq;
 extern type_info const & typeid_expairseq;
 
-#define ex_to_expairseq(X) static_cast<expairseq const &>(*(X).bp)
+// utility functions
+inline const expairseq &ex_to_expairseq(const ex &e)
+{
+       return static_cast<const expairseq &>(*e.bp);
+}
+
+#ifndef NO_GINAC_NAMESPACE
+} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
 #endif // ndef __GINAC_EXPAIRSEQ_H__