]> www.ginac.de Git - ginac.git/blobdiff - ginac/power.cpp
- rotate_31() and golden_hash_ratio() moved to utils.h
[ginac.git] / ginac / power.cpp
index 39ad89988e24659964ca4900480a41eea4dffb9a..36b5c8b46f634547f04ebade72e72f1d17e9c7a9 100644 (file)
@@ -1,7 +1,8 @@
 /** @file power.cpp
  *
- *  Implementation of GiNaC's symbolic exponentiation (basis^exponent).
- *
+ *  Implementation of 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 <iostream>
 #include <stdexcept>
 
-#include "ginac.h"
+#include "power.h"
+#include "expairseq.h"
+#include "add.h"
+#include "mul.h"
+#include "numeric.h"
+#include "relational.h"
+#include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 typedef vector<int> intvector;
 
@@ -33,7 +43,7 @@ typedef vector<int> intvector;
 
 // public
 
-power::power() : basic(TINFO_POWER)
+power::power() : basic(TINFO_power)
 {
     debugmsg("power default constructor",LOGLEVEL_CONSTRUCT);
 }
@@ -80,13 +90,13 @@ void power::destroy(bool call_parent)
 
 // public
 
-power::power(ex const & lh, ex const & rh) : basic(TINFO_POWER), basis(lh), exponent(rh)
+power::power(ex const & lh, ex const & rh) : basic(TINFO_power), basis(lh), exponent(rh)
 {
     debugmsg("power constructor from ex,ex",LOGLEVEL_CONSTRUCT);
     ASSERT(basis.return_type()==return_types::commutative);
 }
 
-power::power(ex const & lh, numeric const & rh) : basic(TINFO_POWER), basis(lh), exponent(rh)
+power::power(ex const & lh, numeric const & rh) : basic(TINFO_power), basis(lh), exponent(rh)
 {
     debugmsg("power constructor from ex,numeric",LOGLEVEL_CONSTRUCT);
     ASSERT(basis.return_type()==return_types::commutative);
@@ -503,7 +513,7 @@ ex power::expand_add(add const & a, int const n) const
         cout << "end term" << endl;
         */
 
-        // TODO: optimize!!!!!!!!
+        // TODO: optimize this
         sum.push_back((new mul(term))->setflag(status_flags::dynallocated));
         
         // increment k[]
@@ -710,3 +720,5 @@ unsigned power::precedence=60;
 
 const power some_power;
 type_info const & typeid_power=typeid(some_power);
+
+} // namespace GiNaC