X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fpower.cpp;h=a30182ef1b7320d5088d6d3ad542a6336ac33e9c;hp=0d24a04f950f312c54934ae5b8d2a0e994e7e117;hb=5ef801553eb39aed7bd2df9dd1aff9d752c3ea9d;hpb=7bc96470ee0dd5c59a8ea1a29b74a781668606a1 diff --git a/ginac/power.cpp b/ginac/power.cpp index 0d24a04f..a30182ef 100644 --- a/ginac/power.cpp +++ b/ginac/power.cpp @@ -518,27 +518,26 @@ ex power::evalm() const // from mul.cpp extern bool tryfactsubs(const ex &, const ex &, int &, lst &); -ex power::subs(const lst & ls, const lst & lr, unsigned options) const +ex power::subs(const exmap & m, unsigned options) const { - const ex &subsed_basis = basis.subs(ls, lr, options); - const ex &subsed_exponent = exponent.subs(ls, lr, options); + const ex &subsed_basis = basis.subs(m, options); + const ex &subsed_exponent = exponent.subs(m, options); if (!are_ex_trivially_equal(basis, subsed_basis) || !are_ex_trivially_equal(exponent, subsed_exponent)) - return power(subsed_basis, subsed_exponent).subs_one_level(ls, lr, options); + return power(subsed_basis, subsed_exponent).subs_one_level(m, options); if (!(options & subs_options::subs_algebraic)) - return subs_one_level(ls, lr, options); + return subs_one_level(m, options); - lst::const_iterator its, itr; - for (its = ls.begin(), itr = lr.begin(); its != ls.end(); ++its, ++itr) { + for (exmap::const_iterator it = m.begin(); it != m.end(); ++it) { int nummatches = std::numeric_limits::max(); lst repls; - if (tryfactsubs(*this, *its, nummatches, repls)) - return (ex_to((*this) * power(itr->subs(ex(repls), subs_options::subs_no_pattern) / its->subs(ex(repls), subs_options::subs_no_pattern), nummatches))).subs_one_level(ls, lr, options); + if (tryfactsubs(*this, it->first, nummatches, repls)) + return (ex_to((*this) * power(it->second.subs(ex(repls), subs_options::subs_no_pattern) / it->first.subs(ex(repls), subs_options::subs_no_pattern), nummatches))).subs_one_level(m, options); } - return subs_one_level(ls, lr, options); + return subs_one_level(m, options); } ex power::eval_ncmul(const exvector & v) const