]> www.ginac.de Git - ginac.git/blobdiff - ginac/simp_lor.h
container.pl: can now generate constructors for an arbitary number
[ginac.git] / ginac / simp_lor.h
index 643a6d91f5d49ce51fb70fc7c87d77823ebd34c8..77e7c4d9f259946693aa7044e722af97833a7478 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's simp_lor objects. */
 
 /*
- *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *  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 <utility>
 #include <map>
 #include <iostream>
-#include <ginac/indexed.h>
-#include <ginac/lorentzidx.h>
+#include "indexed.h"
+#include "lorentzidx.h"
 
+#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
+#endif // ndef NO_NAMESPACE_GINAC
 
 typedef pair<string,string> strstrpair;
 typedef pair<strstrpair,lorentzidx> spmapkey;
@@ -39,7 +41,7 @@ typedef pair<strstrpair,lorentzidx> spmapkey;
 class spmapkey_is_less
 {
 public:
-    bool operator()(spmapkey const & lh, spmapkey const & rh) const
+    bool operator()(const spmapkey & lh, const spmapkey & rh) const
     {
         /*
         cerr << "spmapkey_is_less" << endl;
@@ -68,12 +70,12 @@ class simp_lor;
 class scalar_products
 {
 public:
-    void reg(simp_lor const & v1, simp_lor const & v2, ex const & sp);
-    bool is_defined(simp_lor const & v1, simp_lor const & v2) const;
-    ex evaluate(simp_lor const & v1, simp_lor const & v2) const;
+    void reg(const simp_lor & v1, const simp_lor & v2, const ex & sp);
+    bool is_defined(const simp_lor & v1, const simp_lor & v2) const;
+    ex evaluate(const simp_lor & v1, const simp_lor & v2) const;
     void debugprint(void) const;
 protected:
-    static spmapkey make_key(simp_lor const & v1, simp_lor const & v2);
+    static spmapkey make_key(const simp_lor & v1, const simp_lor & v2);
 protected:
     spmap spm;
 };
@@ -84,10 +86,10 @@ class simp_lor : public indexed
 // friends
 
     friend class scalar_products;
-    friend simp_lor lor_g(ex const & mu, ex const & nu);
-    friend simp_lor lor_vec(string const & n, ex const & mu);
-    friend ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp);
-    friend ex simplify_simp_lor(ex const & e, scalar_products const & sp);
+    friend simp_lor lor_g(const ex & mu, const ex & nu);
+    friend simp_lor lor_vec(const string & n, const ex & mu);
+    friend ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp);
+    friend ex simplify_simp_lor(const ex & e, const scalar_products & sp);
     
 // types
 
@@ -103,19 +105,19 @@ public:
 public:
     simp_lor();
     ~simp_lor();
-    simp_lor(simp_lor const & other);
-    simp_lor const & operator=(simp_lor const & other);
+    simp_lor(const simp_lor & other);
+    const simp_lor & operator=(const simp_lor & other);
 protected:
-    void copy(simp_lor const & other); 
+    void copy(const simp_lor & other); 
     void destroy(bool call_parent);
 
     // other constructors
 protected:
     simp_lor(simp_lor_types const t);
-    simp_lor(simp_lor_types const t, ex const & i1, ex const & i2);
-    simp_lor(simp_lor_types const t, string const & n, ex const & i1);
-    simp_lor(simp_lor_types const t, string const & n, exvector const & iv);
-    simp_lor(simp_lor_types const t, string const & n, exvector * ivp);
+    simp_lor(simp_lor_types const t, const ex & i1, const ex & i2);
+    simp_lor(simp_lor_types const t, const string & n, const ex & i1);
+    simp_lor(simp_lor_types const t, const string & n, const exvector & iv);
+    simp_lor(simp_lor_types const t, const string & n, exvector * ivp);
     
     // functions overriding virtual functions from base classes
 public:
@@ -127,11 +129,11 @@ public:
     bool info(unsigned inf) const;
     ex eval(int level=0) const;
 protected:
-    int compare_same_type(basic const & other) const;
-    bool is_equal_same_type(basic const & other) const;
+    int compare_same_type(const basic & other) const;
+    bool is_equal_same_type(const basic & other) const;
     unsigned return_type(void) const;
     unsigned return_type_tinfo(void) const;
-    ex thisexprseq(exvector const & v) const;
+    ex thisexprseq(const exvector & v) const;
     ex thisexprseq(exvector * vp) const;
 
     // new virtual functions which can be overridden by derived classes
@@ -151,7 +153,7 @@ protected:
 // global constants
 
 extern const simp_lor some_simp_lor;
-extern type_info const & typeid_simp_lor;
+extern const type_info & typeid_simp_lor;
 
 // utility functions
 inline const simp_lor &ex_to_simp_lor(const ex &e)
@@ -164,12 +166,14 @@ inline simp_lor &ex_to_nonconst_simp_lor(const ex &e)
        return static_cast<simp_lor &>(*e.bp);
 }
 
-simp_lor lor_g(ex const & mu, ex const & nu);
-simp_lor lor_vec(string const & n, ex const & mu);
-ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp);
-ex simplify_simp_lor(ex const & e, scalar_products const & sp);
+simp_lor lor_g(const ex & mu, const ex & nu);
+simp_lor lor_vec(const string & n, const ex & mu);
+ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp);
+ex simplify_simp_lor(const ex & e, const scalar_products & sp=scalar_products());
 ex Dim(void);
 
+#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
+#endif // ndef NO_NAMESPACE_GINAC
 
 #endif // ndef _SIMP__GINAC_LOR_H__