]> www.ginac.de Git - ginac.git/blobdiff - ginac/power.h
#ifndef around namespace GiNaC { }
[ginac.git] / ginac / power.h
index 8533a0693ed1639807fbc301d585bbccc7e94e66..25f4f8d7d8a0e076a014903245cd9c10840f20c2 100644 (file)
@@ -1,7 +1,8 @@
 /** @file power.h
  *
- *  Interface to GiNaC's symbolic exponentiation (basis^exponent).
- *
+ *  Interface to GiNaC's symbolic exponentiation (basis^exponent). */
+
+/*
  *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
 #include <ginac/basic.h>
 #include <ginac/ex.h>
 
+#ifndef NO_GINAC_NAMESPACE
+namespace GiNaC {
+#endif // ndef NO_GINAC_NAMESPACE
+
 class numeric;
 class add;
 
@@ -102,7 +107,11 @@ protected:
 extern const power some_power;
 extern type_info const & typeid_power;
 
-#define ex_to_power(X) static_cast<power const &>(*(X).bp)
+// utility functions
+inline const power &ex_to_power(const ex &e)
+{
+       return static_cast<const power &>(*e.bp);
+}
 
 // wrapper functions
 
@@ -118,5 +127,8 @@ inline ex pow(ex const & b, ex const & e)
 inline ex sqrt(ex const & a)
 { return power(a,exHALF()); }
 
-#endif // ndef __GINAC_POWER_H__
+#ifndef NO_GINAC_NAMESPACE
+} // namespace GiNaC
+#endif // ndef NO_GINAC_NAMESPACE
 
+#endif // ndef __GINAC_POWER_H__