return *this;
}
+ex pseries::evalm() const
+{
+ // evalm each coefficient
+ epvector newseq;
+ bool something_changed = false;
+ for (epvector::const_iterator i=seq.begin(); i!=seq.end(); ++i) {
+ if (something_changed) {
+ ex newcoeff = i->rest.evalm();
+ if (!newcoeff.is_zero())
+ newseq.push_back(expair(newcoeff, i->coeff));
+ }
+ else {
+ ex newcoeff = i->rest.evalm();
+ if (!are_ex_trivially_equal(newcoeff, i->rest)) {
+ something_changed = true;
+ newseq.reserve(seq.size());
+ std::copy(seq.begin(), i, std::back_inserter<epvector>(newseq));
+ if (!newcoeff.is_zero())
+ newseq.push_back(expair(newcoeff, i->coeff));
+ }
+ }
+ }
+ if (something_changed)
+ return (new pseries(var==point, newseq))->setflag(status_flags::dynallocated);
+ else
+ return *this;
+}
+
ex pseries::subs(const exmap & m, unsigned options) const
{
// If expansion variable is being substituted, convert the series to a
}
const ex& sym = r.lhs();
// find existing minimal degree
- int real_ldegree = basis.expand().ldegree(sym-r.rhs());
+ ex eb = basis.expand();
+ int real_ldegree = 0;
+ if (eb.info(info_flags::rational_function))
+ real_ldegree = eb.ldegree(sym-r.rhs());
if (real_ldegree == 0) {
int orderloop = 0;
do {