int factor, int &nummatches, const std::vector<bool> &subsed,
std::vector<bool> &matched)
{
+ GINAC_ASSERT(subsed.size() == e.nops());
+ GINAC_ASSERT(matched.size() == e.nops());
+
if (factor == (int)pat.nops())
return true;
if(is_a<mul>(pattern)) {
exmap repls;
int nummatches = std::numeric_limits<int>::max();
- std::vector<bool> subsed(seq.size(), false);
- std::vector<bool> matched(seq.size(), false);
+ std::vector<bool> subsed(nops(), false);
+ std::vector<bool> matched(nops(), false);
if(algebraic_match_mul_with_mul(*this, pattern, repls, 0, nummatches,
subsed, matched))
return true;
ex mul::algebraic_subs_mul(const exmap & m, unsigned options) const
{
- std::vector<bool> subsed(seq.size(), false);
- exvector subsresult(seq.size());
+ std::vector<bool> subsed(nops(), false);
ex divide_by = 1;
ex multiply_by = 1;
if (is_exactly_a<mul>(it->first)) {
retry1:
int nummatches = std::numeric_limits<int>::max();
- std::vector<bool> currsubsed(seq.size(), false);
+ std::vector<bool> currsubsed(nops(), false);
exmap repls;
if(!algebraic_match_mul_with_mul(*this, it->first, repls, 0, nummatches, subsed, currsubsed))