X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fncmul.cpp;h=adc36a524491ee2e72047d92281eafd5c1d22c72;hp=2c0d736536367459a48dc9be689f73d3b895c190;hb=d41f7533018d9f9444c98466432e4d84deedaa04;hpb=def26469ff96228c66e877bb5594e7d9a24b638f diff --git a/ginac/ncmul.cpp b/ginac/ncmul.cpp index 2c0d7365..adc36a52 100644 --- a/ginac/ncmul.cpp +++ b/ginac/ncmul.cpp @@ -3,7 +3,7 @@ * Implementation of GiNaC's non-commutative products of expressions. */ /* - * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2010 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 @@ -20,10 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include - #include "ncmul.h" #include "ex.h" #include "add.h" @@ -34,6 +30,10 @@ #include "indexed.h" #include "utils.h" +#include +#include +#include + namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(ncmul, exprseq, @@ -92,8 +92,7 @@ ncmul::ncmul(std::auto_ptr vp) : inherited(vp) // archiving ////////// -DEFAULT_ARCHIVING(ncmul) - + ////////// // functions overriding virtual functions from base classes ////////// @@ -340,15 +339,15 @@ ex ncmul::eval(int level) const if (assocseq.empty()) return _ex1; // determine return types - unsignedvector rettypes; - rettypes.reserve(assocseq.size()); + unsignedvector rettypes(assocseq.size()); size_t i = 0; size_t count_commutative=0; size_t count_noncommutative=0; size_t count_noncommutative_composite=0; cit = assocseq.begin(); citend = assocseq.end(); while (cit != citend) { - switch (rettypes[i] = cit->return_type()) { + rettypes[i] = cit->return_type(); + switch (rettypes[i]) { case return_types::commutative: count_commutative++; break; @@ -652,4 +651,6 @@ ex hold_ncmul(const exvector & v) status_flags::evaluated); } +GINAC_BIND_UNARCHIVER(ncmul); + } // namespace GiNaC