]> www.ginac.de Git - ginac.git/blobdiff - ginac/expairseq.cpp
Transform abs(x)^n => x^n if x is real and n is even.
[ginac.git] / ginac / expairseq.cpp
index 2649b4b8b6c28d51089c00fe012ed48dbe028e72..7c6e5223653889730407aa0fd5a246417cc06f6d 100644 (file)
@@ -453,7 +453,7 @@ ex expairseq::subs(const exmap & m, unsigned options) const
 {
        std::auto_ptr<epvector> vp = subschildren(m, options);
        if (vp.get())
-               return ex_to<basic>(thisexpairseq(vp, overall_coeff, true));
+               return ex_to<basic>(thisexpairseq(vp, overall_coeff, (options & subs_options::no_index_renaming) == 0));
        else if ((options & subs_options::algebraic) && is_exactly_a<mul>(*this))
                return static_cast<const mul *>(this)->algebraic_subs_mul(m, options);
        else
@@ -873,7 +873,7 @@ void expairseq::construct_from_2_ex(const ex &lh, const ex &rh)
 }
 
 void expairseq::construct_from_2_expairseq(const expairseq &s1,
-                                                                                  const expairseq &s2)
+                                           const expairseq &s2)
 {
        combine_overall_coeff(s1.overall_coeff);
        combine_overall_coeff(s2.overall_coeff);
@@ -928,7 +928,7 @@ void expairseq::construct_from_2_expairseq(const expairseq &s1,
 }
 
 void expairseq::construct_from_expairseq_ex(const expairseq &s,
-                                                                                       const ex &e)
+                                            const ex &e)
 {
        combine_overall_coeff(s.overall_coeff);
        if (is_exactly_a<numeric>(e)) {
@@ -993,7 +993,7 @@ void expairseq::construct_from_exvector(const exvector &v)
 {
        // simplifications: +(a,+(b,c),d) -> +(a,b,c,d) (associativity)
        //                  +(d,b,c,a) -> +(a,b,c,d) (canonicalization)
-       //                  +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric())
+       //                  +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric)
        //                  (same for (+,*) -> (*,^)
 
        make_flat(v);
@@ -1009,8 +1009,8 @@ void expairseq::construct_from_epvector(const epvector &v, bool do_index_renamin
 {
        // simplifications: +(a,+(b,c),d) -> +(a,b,c,d) (associativity)
        //                  +(d,b,c,a) -> +(a,b,c,d) (canonicalization)
-       //                  +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric())
-       //                  (same for (+,*) -> (*,^)
+       //                  +(...,x,*(x,c1),*(x,c2)) -> +(...,*(x,1+c1+c2)) (c1, c2 numeric)
+       //                  same for (+,*) -> (*,^)
 
        make_flat(v, do_index_renaming);
 #if EXPAIRSEQ_USE_HASHTAB
@@ -1432,7 +1432,7 @@ bool expairseq::has_coeff_0() const
 }
 
 void expairseq::add_numerics_to_hashtab(epvector::iterator first_numeric,
-                                                                               epvector::const_iterator last_non_zero)
+                                        epvector::const_iterator last_non_zero)
 {
        if (first_numeric == seq.end()) return; // no numerics