]> www.ginac.de Git - ginac.git/blobdiff - ginac/expairseq.h
- put everything in "GiNaC" namespace
[ginac.git] / ginac / expairseq.h
index e6511e8e2d36f4b4a699a39661db11b41a456ec3..a14cecaac00d5bddf852f430d0ee5673243a68d1 100644 (file)
@@ -1,18 +1,33 @@
-/** @file expairseq.h */
-
-#ifndef _EXPAIRSEQ_H_
-#define _EXPAIRSEQ_H_
+/** @file expairseq.h
+ *
+ *  Interface to sequences of expression pairs. */
+
+/*
+ *  GiNaC Copyright (C) 1999 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  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
+ */
+
+#ifndef __GINAC_EXPAIRSEQ_H__
+#define __GINAC_EXPAIRSEQ_H__
 
 #include <vector>
 #include <list>
+#include <ginac/expair.h>
 
-class expairseq;
-
-#include "basic.h"
-#include "ex.h"
-#include "numeric.h"
-#include "debugmsg.h"
-#include "expair.h"
+namespace GiNaC {
 
 //#define EXPAIRSEQ_USE_HASHTAB
 
@@ -21,7 +36,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);
 }
@@ -41,16 +55,14 @@ class expairseq : public basic
 
     // default constructor, destructor, copy constructor assignment operator and helpers
 public:
-    expairseq() : basic(TINFO_EXPAIRSEQ)
+    expairseq() : basic(TINFO_expairseq)
 #ifdef EXPAIRSEQ_USE_HASHTAB
         , 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);
@@ -176,8 +188,12 @@ protected:
 extern const expairseq some_expairseq;
 extern type_info const & typeid_expairseq;
 
-#define ex_to_expairseq(X) static_cast<expairseq const &>(*(X).bp)
-
-#endif // ndef _EXPAIRSEQ_H_
+// utility functions
+inline const expairseq &ex_to_expairseq(const ex &e)
+{
+       return static_cast<const expairseq &>(*e.bp);
+}
 
+} // namespace GiNaC
 
+#endif // ndef __GINAC_EXPAIRSEQ_H__