]> www.ginac.de Git - ginac.git/blobdiff - ginac/lorentzidx.h
- put everything in "GiNaC" namespace
[ginac.git] / ginac / lorentzidx.h
index 001494088735c39fc96002ab234e442bc9cc48af..1a429021ef9abb0cc2550c0c13143ccbca47b393 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
@@ -26,6 +27,8 @@
 #include <vector>
 #include <ginac/idx.h>
 
+namespace GiNaC {
+
 class lorentzidx : public idx
 {
     friend class simp_lor;
@@ -80,8 +83,12 @@ 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))
+} // namespace GiNaC
 
 #endif // ndef __GINAC_LORENTZIDX_H__