]> www.ginac.de Git - ginac.git/blobdiff - ginac/add.cpp
Speed up power::real_part() and power::imag_part().
[ginac.git] / ginac / add.cpp
index 41f2096e646f909f672581b0ea4b4f2d194b42e3..9110491e3246a7fc750f96fce18bdb3895e7fc24 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's sums of expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2011 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -316,14 +316,14 @@ ex add::coeff(const ex & s, int n) const
        epvector::const_iterator i = seq.begin(), end = seq.end();
        while (i != end) {
                ex restcoeff = i->rest.coeff(s, n);
-               if (!restcoeff.is_zero()) {
-                       if (do_clifford) {
-                               if (clifford_max_label(restcoeff) == -1) {
-                                       coeffseq_cliff->push_back(combine_ex_with_coeff_to_pair(ncmul(restcoeff, dirac_ONE(rl)), i->coeff));
+               if (!restcoeff.is_zero()) {
+                       if (do_clifford) {
+                               if (clifford_max_label(restcoeff) == -1) {
+                                       coeffseq_cliff->push_back(combine_ex_with_coeff_to_pair(ncmul(restcoeff, dirac_ONE(rl)), i->coeff));
                                } else {
-                                       coeffseq_cliff->push_back(combine_ex_with_coeff_to_pair(restcoeff, i->coeff));
+                                       coeffseq_cliff->push_back(combine_ex_with_coeff_to_pair(restcoeff, i->coeff));
                                        nonscalar = true;
-                               }
+                               }
                        }
                        coeffseq->push_back(combine_ex_with_coeff_to_pair(restcoeff, i->coeff));
                }
@@ -575,7 +575,7 @@ expair add::split_ex_to_pair(const ex & e) const
 }
 
 expair add::combine_ex_with_coeff_to_pair(const ex & e,
-                                                                                 const ex & c) const
+                                          const ex & c) const
 {
        GINAC_ASSERT(is_exactly_a<numeric>(c));
        if (is_exactly_a<mul>(e)) {
@@ -601,7 +601,7 @@ expair add::combine_ex_with_coeff_to_pair(const ex & e,
 }
 
 expair add::combine_pair_with_coeff_to_pair(const expair & p,
-                                                                                       const ex & c) const
+                                            const ex & c) const
 {
        GINAC_ASSERT(is_exactly_a<numeric>(p.coeff));
        GINAC_ASSERT(is_exactly_a<numeric>(c));