]> www.ginac.de Git - ginac.git/blobdiff - ginac/pseries.cpp
use new-style print methods
[ginac.git] / ginac / pseries.cpp
index e9887055f2e76b95c2d9a86d69e6d669d16c6347..48dfa1ebbf7d98337954ccac7ef116f9f7e1fef2 100644 (file)
@@ -396,13 +396,13 @@ ex pseries::evalf(int level) const
        return (new pseries(relational(var,point), new_seq))->setflag(status_flags::dynallocated | status_flags::evaluated);
 }
 
-ex pseries::subs(const lst & ls, const lst & lr, unsigned options) const
+ex pseries::subs(const exmap & m, unsigned options) const
 {
        // If expansion variable is being substituted, convert the series to a
        // polynomial and do the substitution there because the result might
        // no longer be a power series
-       if (ls.has(var))
-               return convert_to_poly(true).subs(ls, lr, options);
+       if (m.find(var) != m.end())
+               return convert_to_poly(true).subs(m, options);
        
        // Otherwise construct a new series with substituted coefficients and
        // expansion point
@@ -410,10 +410,10 @@ ex pseries::subs(const lst & ls, const lst & lr, unsigned options) const
        newseq.reserve(seq.size());
        epvector::const_iterator it = seq.begin(), itend = seq.end();
        while (it != itend) {
-               newseq.push_back(expair(it->rest.subs(ls, lr, options), it->coeff));
+               newseq.push_back(expair(it->rest.subs(m, options), it->coeff));
                ++it;
        }
-       return (new pseries(relational(var,point.subs(ls, lr, options)), newseq))->setflag(status_flags::dynallocated);
+       return (new pseries(relational(var,point.subs(m, options)), newseq))->setflag(status_flags::dynallocated);
 }
 
 /** Implementation of ex::expand() for a power series.  It expands all the
@@ -503,7 +503,7 @@ ex basic::series(const relational & r, int order, unsigned options) const
        epvector seq;
        numeric fac = 1;
        ex deriv = *this;
-       ex coeff = deriv.subs(r);
+       ex coeff = deriv.subs(r, subs_options::no_pattern);
        const symbol &s = ex_to<symbol>(r.lhs());
        
        if (!coeff.is_zero())
@@ -519,7 +519,7 @@ ex basic::series(const relational & r, int order, unsigned options) const
                if (deriv.is_zero())  // Series terminates
                        return pseries(r, seq);
 
-               coeff = deriv.subs(r);
+               coeff = deriv.subs(r, subs_options::no_pattern);
                if (!coeff.is_zero())
                        seq.push_back(expair(fac.inverse() * coeff, n));
        }
@@ -861,7 +861,7 @@ ex power::series(const relational & r, int order, unsigned options) const
        // Basis is not a series, may there be a singularity?
        bool must_expand_basis = false;
        try {
-               basis.subs(r);
+               basis.subs(r, subs_options::no_pattern);
        } catch (pole_error) {
                must_expand_basis = true;
        }
@@ -871,7 +871,7 @@ ex power::series(const relational & r, int order, unsigned options) const
                return basic::series(r, order, options);
                
        // Is the expression of type 0^something?
-       if (!must_expand_basis && !basis.subs(r).is_zero())
+       if (!must_expand_basis && !basis.subs(r, subs_options::no_pattern).is_zero())
                return basic::series(r, order, options);
 
        // Singularity encountered, is the basis equal to (var - point)?