X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpower.h;h=25f4f8d7d8a0e076a014903245cd9c10840f20c2;hp=a946a82f5311be8d368fced4227dd4e19fc75d2e;hb=afdd7fa8c6c0a587f7c80789198551383e8beb7b;hpb=a8507b8af1c08d9b27d98d57f95c7ca1a8671e27 diff --git a/ginac/power.h b/ginac/power.h index a946a82f..25f4f8d7 100644 --- a/ginac/power.h +++ b/ginac/power.h @@ -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 @@ -22,7 +23,13 @@ #ifndef __GINAC_POWER_H__ #define __GINAC_POWER_H__ -class power; +#include +#include + +#ifndef NO_GINAC_NAMESPACE +namespace GiNaC { +#endif // ndef NO_GINAC_NAMESPACE + class numeric; class add; @@ -100,7 +107,11 @@ protected: extern const power some_power; extern type_info const & typeid_power; -#define ex_to_power(X) static_cast(*(X).bp) +// utility functions +inline const power &ex_to_power(const ex &e) +{ + return static_cast(*e.bp); +} // wrapper functions @@ -116,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__