]> 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 f0b5c5adb8c566b0b965ac649badcd95b040e510..36b5c8b46f634547f04ebade72e72f1d17e9c7a9 100644 (file)
@@ -2,11 +2,38 @@
  *
  *  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
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #include <vector>
 #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;
 
@@ -16,7 +43,7 @@ typedef vector<int> intvector;
 
 // public
 
-power::power() : basic(TINFO_POWER)
+power::power() : basic(TINFO_power)
 {
     debugmsg("power default constructor",LOGLEVEL_CONSTRUCT);
 }
@@ -63,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);
@@ -486,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[]
@@ -693,3 +720,5 @@ unsigned power::precedence=60;
 
 const power some_power;
 type_info const & typeid_power=typeid(some_power);
+
+} // namespace GiNaC