}
+/** Re-expansion of a pseries object. */
+ex pseries::series(const symbol & s, const ex & p, int order) const
+{
+ if (var.is_equal(s) && point.is_equal(p)) {
+ if (order > degree(s))
+ return *this;
+ else {
+ epvector new_seq;
+ epvector::const_iterator it = seq.begin(), itend = seq.end();
+ while (it != itend) {
+ int o = ex_to_numeric(it->coeff).to_int();
+ if (o >= order) {
+ new_seq.push_back(expair(Order(_ex1()), o));
+ break;
+ }
+ new_seq.push_back(*it);
+ it++;
+ }
+ return pseries(var, point, new_seq);
+ }
+ } else
+ return convert_to_poly().series(s, p, order);
+}
+
+
/** Compute the truncated series expansion of an expression.
* This function returns an expression containing an object of class pseries to
* represent the series. If the series does not terminate within the given
ex coeff(const symbol &s, int n=1) const;
ex eval(int level=0) const;
ex evalf(int level=0) const;
+ ex series(const symbol & s, const ex & p, int order) const;
ex normal(lst &sym_lst, lst &repl_lst, int level=0) const;
ex subs(const lst & ls, const lst & lr) const;
protected: