X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpower.cpp;h=36b5c8b46f634547f04ebade72e72f1d17e9c7a9;hp=f0b5c5adb8c566b0b965ac649badcd95b040e510;hb=68a7044bf956a75b6bd70aefa21ffe358e648e19;hpb=6b3768e8c544739ae53321539cb4d1e3112ded1b diff --git a/ginac/power.cpp b/ginac/power.cpp index f0b5c5ad..36b5c8b4 100644 --- a/ginac/power.cpp +++ b/ginac/power.cpp @@ -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 #include #include -#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 intvector; @@ -16,7 +43,7 @@ typedef vector 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