]> www.ginac.de Git - ginac.git/blobdiff - ginac/simp_lor.h
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / simp_lor.h
index 8efe1b3dd6e87aa7edc8709c7146a6c7c5749eaa..643a6d91f5d49ce51fb70fc7c87d77823ebd34c8 100644 (file)
@@ -2,19 +2,36 @@
  *
  *  Interface to GiNaC's simp_lor objects. */
 
-#ifndef _SIMP_LOR_H_
-#define _SIMP_LOR_H_
+/*
+ *  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 _SIMP__GINAC_LOR_H__
+#define _SIMP__GINAC_LOR_H__
 
 #include <string>
 #include <vector>
 #include <utility>
 #include <map>
 #include <iostream>
+#include <ginac/indexed.h>
+#include <ginac/lorentzidx.h>
 
-class simp_lor;
-
-#include "indexed.h"
-#include "lorentzidx.h"
+namespace GiNaC {
 
 typedef pair<string,string> strstrpair;
 typedef pair<strstrpair,lorentzidx> spmapkey;
@@ -136,10 +153,16 @@ protected:
 extern const simp_lor some_simp_lor;
 extern type_info const & typeid_simp_lor;
 
-// macros
+// utility functions
+inline const simp_lor &ex_to_simp_lor(const ex &e)
+{
+       return static_cast<const simp_lor &>(*e.bp);
+}
 
-#define ex_to_simp_lor(X) static_cast<simp_lor const &>(*(X).bp)
-#define ex_to_nonconst_simp_lor(X) static_cast<simp_lor &>(*(X).bp)
+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);
@@ -147,6 +170,6 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp);
 ex simplify_simp_lor(ex const & e, scalar_products const & sp);
 ex Dim(void);
 
-#endif // ndef _SIMP_LOR_H_
-
+} // namespace GiNaC
 
+#endif // ndef _SIMP__GINAC_LOR_H__