X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fexpairseq.cpp;h=7c6e5223653889730407aa0fd5a246417cc06f6d;hp=90ec763528c7374542eac6e026da263b7e7de33f;hb=5bf87cea66bb2071222c2910ed68c2649a98906c;hpb=f9afb6aca6a971650dff63b11ca8c2ef18506690 diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 90ec7635..7c6e5223 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -375,17 +375,6 @@ ex expairseq::conjugate() const return result; } -bool expairseq::is_polynomial(const ex & var) const -{ - if (!is_exactly_a(*this) && !is_exactly_a(*this)) - return basic::is_polynomial(var); - for (epvector::const_iterator i=seq.begin(); i!=seq.end(); ++i) { - if (!(i->rest).is_polynomial(var)) - return false; - } - return true; -} - bool expairseq::match(const ex & pattern, exmap & repl_lst) const { // This differs from basic::match() because we want "a+b+c+d" to @@ -464,7 +453,7 @@ ex expairseq::subs(const exmap & m, unsigned options) const { std::auto_ptr vp = subschildren(m, options); if (vp.get()) - return ex_to(thisexpairseq(vp, overall_coeff, true)); + return ex_to(thisexpairseq(vp, overall_coeff, (options & subs_options::no_index_renaming) == 0)); else if ((options & subs_options::algebraic) && is_exactly_a(*this)) return static_cast(this)->algebraic_subs_mul(m, options); else @@ -884,7 +873,7 @@ void expairseq::construct_from_2_ex(const ex &lh, const ex &rh) } void expairseq::construct_from_2_expairseq(const expairseq &s1, - const expairseq &s2) + const expairseq &s2) { combine_overall_coeff(s1.overall_coeff); combine_overall_coeff(s2.overall_coeff); @@ -939,7 +928,7 @@ void expairseq::construct_from_2_expairseq(const expairseq &s1, } void expairseq::construct_from_expairseq_ex(const expairseq &s, - const ex &e) + const ex &e) { combine_overall_coeff(s.overall_coeff); if (is_exactly_a(e)) { @@ -1004,7 +993,7 @@ void expairseq::construct_from_exvector(const exvector &v) { // simplifications: +(a,+(b,c),d) -> +(a,b,c,d) (associativity) // +(d,b,c,a) -> +(a,b,c,d) (canonicalization) - // +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric()) + // +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric) // (same for (+,*) -> (*,^) make_flat(v); @@ -1020,8 +1009,8 @@ void expairseq::construct_from_epvector(const epvector &v, bool do_index_renamin { // simplifications: +(a,+(b,c),d) -> +(a,b,c,d) (associativity) // +(d,b,c,a) -> +(a,b,c,d) (canonicalization) - // +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric()) - // (same for (+,*) -> (*,^) + // +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric) + // same for (+,*) -> (*,^) make_flat(v, do_index_renaming); #if EXPAIRSEQ_USE_HASHTAB @@ -1443,7 +1432,7 @@ bool expairseq::has_coeff_0() const } void expairseq::add_numerics_to_hashtab(epvector::iterator first_numeric, - epvector::const_iterator last_non_zero) + epvector::const_iterator last_non_zero) { if (first_numeric == seq.end()) return; // no numerics