]> www.ginac.de Git - ginac.git/blobdiff - ginac/ncmul.cpp
clifford_unit: fix possible bugs due to wrong operator[!=]= usage.
[ginac.git] / ginac / ncmul.cpp
index 21f7730c841fe13ce9b41083058ced5e7b68d6f3..5a7b94f8733adcebc7d1b83d7b5390ea23aef696 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's non-commutative products of expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2008 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
@@ -335,8 +335,11 @@ ex ncmul::eval(int level) const
        exvector assocseq;
        assocseq.reserve(factors);
        cit = evaledseq.begin();
+       make_flat_inserter mf(evaledseq, true);
        while (cit != citend)
-               append_factors(assocseq, *cit++);
+       {       ex factor = mf.handle_factor(*(cit++), 1);
+               append_factors(assocseq, factor);
+       }
        
        // ncmul(x) -> x
        if (assocseq.size()==1) return *(seq.begin());