X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fadd.cpp;h=81a4f2fb1579d7147129d9c89f0763aafbd42b10;hp=241516e07283b7e49a3a7fd7bf47490bebb1c9f9;hb=cca88b51436e4b654d16a4d60cd0d1c66fcf5dd6;hpb=e08cda1854bdb82f6706ec269233577690ae00e4;ds=sidebyside diff --git a/ginac/add.cpp b/ginac/add.cpp index 241516e0..81a4f2fb 100644 --- a/ginac/add.cpp +++ b/ginac/add.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's sums of expressions. */ /* - * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2014 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 @@ -260,6 +260,16 @@ bool add::info(unsigned inf) const return inherited::info(inf); } +bool add::is_polynomial(const ex & var) const +{ + for (epvector::const_iterator i=seq.begin(); i!=seq.end(); ++i) { + if (!(i->rest).is_polynomial(var)) { + return false; + } + } + return true; +} + int add::degree(const ex & s) const { int deg = std::numeric_limits::min(); @@ -298,7 +308,7 @@ ex add::coeff(const ex & s, int n) const { std::auto_ptr coeffseq(new epvector); std::auto_ptr coeffseq_cliff(new epvector); - char rl = clifford_max_label(s); + int rl = clifford_max_label(s); bool do_clifford = (rl != -1); bool nonscalar = false; @@ -603,7 +613,7 @@ expair add::combine_pair_with_coeff_to_pair(const expair & p, return expair(p.rest,ex_to(p.coeff).mul_dyn(ex_to(c))); } - + ex add::recombine_pair_to_ex(const expair & p) const { if (ex_to(p.coeff).is_equal(*_num1_p))