]> www.ginac.de Git - ginac.git/blobdiff - ginac/lorentzidx.h
#ifndef around namespace GiNaC { }
[ginac.git] / ginac / lorentzidx.h
index 8f9bbf40a4fb5495ff1660de5028cec3d964fbe9..260296efe7883c5cc19de06249239bbf6b88ce06 100644 (file)
@@ -1,7 +1,8 @@
 /** @file lorentzidx.h
  *
- *  Interface to GiNaC's lorentz indices.
- *
+ *  Interface to GiNaC's lorentz indices. */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
 
 #include <string>
 #include <vector>
+#include <ginac/idx.h>
+
+#ifndef NO_GINAC_NAMESPACE
+namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
 
 class lorentzidx : public idx
 {
@@ -79,8 +85,14 @@ protected:
 extern const lorentzidx some_lorentzidx;
 extern type_info const & typeid_lorentzidx;
 
-// macros
+// utility functions
+inline const lorentzidx &ex_to_lorentzidx(const ex &e)
+{
+       return static_cast<const lorentzidx &>(*e.bp);
+}
 
-#define ex_to_lorentzidx(X) (static_cast<lorentzidx const &>(*(X).bp))
+#ifndef NO_GINAC_NAMESPACE
+} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
 #endif // ndef __GINAC_LORENTZIDX_H__