]> www.ginac.de Git - ginac.git/blobdiff - ginac/power.h
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / power.h
index a946a82f5311be8d368fced4227dd4e19fc75d2e..3d9ae57433dbe44c41eeca88aa559e55638651f2 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
 #ifndef __GINAC_POWER_H__
 #define __GINAC_POWER_H__
 
-class power;
+#include <ginac/basic.h>
+#include <ginac/ex.h>
+
+namespace GiNaC {
+
 class numeric;
 class add;
 
@@ -100,7 +105,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
 
@@ -116,5 +125,6 @@ inline ex pow(ex const & b, ex const & e)
 inline ex sqrt(ex const & a)
 { return power(a,exHALF()); }
 
-#endif // ndef __GINAC_POWER_H__
+} // namespace GiNaC
 
+#endif // ndef __GINAC_POWER_H__