]> www.ginac.de Git - ginac.git/blobdiff - ginac/pseries.cpp
- fix LaTeX-output bug reported by Stefan, remove obsolete has(matrix,ex).
[ginac.git] / ginac / pseries.cpp
index f23bbdfdd940a08859258e4e26dc6cad6ef84906..1477449c0bf3233f6f829549c14ad46cf3515f15 100644 (file)
@@ -142,7 +142,7 @@ void pseries::print(const print_context & c, unsigned level) const
 
        } else {
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << "(";
                
                std::string par_open = is_of_type(c, print_latex) ? "{(" : "(";
@@ -198,7 +198,7 @@ void pseries::print(const print_context & c, unsigned level) const
                                Order(power(var-point,i->coeff)).print(c);
                }
 
-               if (precedence <= level)
+               if (precedence() <= level)
                        c.s << ")";
        }
 }
@@ -393,13 +393,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) const
+ex pseries::subs(const lst & ls, const lst & lr, bool no_pattern) 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);
+               return convert_to_poly(true).subs(ls, lr, no_pattern);
        
        // Otherwise construct a new series with substituted coefficients and
        // expansion point
@@ -407,10 +407,10 @@ ex pseries::subs(const lst & ls, const lst & lr) 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), it->coeff));
+               newseq.push_back(expair(it->rest.subs(ls, lr, no_pattern), it->coeff));
                ++it;
        }
-       return (new pseries(relational(var,point.subs(ls, lr)), newseq))->setflag(status_flags::dynallocated);
+       return (new pseries(relational(var,point.subs(ls, lr, no_pattern)), newseq))->setflag(status_flags::dynallocated);
 }
 
 /** Implementation of ex::expand() for a power series.  It expands all the
@@ -490,7 +490,7 @@ ex basic::series(const relational & r, int order, unsigned options) const
        const symbol &s = static_cast<symbol &>(*r.lhs().bp);
        
        if (!coeff.is_zero())
-               seq.push_back(expair(coeff, numeric(0)));
+               seq.push_back(expair(coeff, _ex0()));
        
        int n;
        for (n=1; n<order; ++n) {
@@ -925,12 +925,4 @@ ex ex::series(const ex & r, int order, unsigned options) const
        return e;
 }
 
-//////////
-// static member variables
-//////////
-
-// protected
-
-unsigned pseries::precedence = 38;  // for clarity just below add::precedence
-
 } // namespace GiNaC