X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fexpairseq.cpp;h=90ec763528c7374542eac6e026da263b7e7de33f;hp=6057a85ef0c0f14a3303058ae9cbd7d04a24e16c;hb=f9afb6aca6a971650dff63b11ca8c2ef18506690;hpb=def26469ff96228c66e877bb5594e7d9a24b638f;ds=sidebyside diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 6057a85e..90ec7635 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -3,7 +3,7 @@ * Implementation of sequences of expression pairs. */ /* - * GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2011 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,12 +20,6 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include -#include -#include -#include -#include - #include "expairseq.h" #include "lst.h" #include "add.h" @@ -36,11 +30,17 @@ #include "archive.h" #include "operators.h" #include "utils.h" +#include "hash_seed.h" #include "indexed.h" +#include #if EXPAIRSEQ_USE_HASHTAB #include #endif // EXPAIRSEQ_USE_HASHTAB +#include +#include +#include +#include namespace GiNaC { @@ -141,11 +141,9 @@ expairseq::expairseq(std::auto_ptr vp, const ex &oc, bool do_index_ren // archiving ////////// -expairseq::expairseq(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst) -#if EXPAIRSEQ_USE_HASHTAB - , hashtabsize(0) -#endif +void expairseq::read_archive(const archive_node &n, lst &sym_lst) { + inherited::read_archive(n, sym_lst); archive_node::archive_node_cit first = n.find_first("rest"); archive_node::archive_node_cit last = n.find_last("coeff"); ++last; @@ -177,7 +175,6 @@ void expairseq::archive(archive_node &n) const n.add_ex("overall_coeff", overall_coeff); } -DEFAULT_UNARCHIVE(expairseq) ////////// // functions overriding virtual functions from base classes @@ -374,9 +371,7 @@ ex expairseq::conjugate() const return *this; } ex result = thisexpairseq(newepv ? *newepv : seq, x); - if (newepv) { - delete newepv; - } + delete newepv; return result; } @@ -615,8 +610,7 @@ unsigned expairseq::return_type() const unsigned expairseq::calchash() const { - const void* this_tinfo = (const void*)typeid(*this).name(); - unsigned v = golden_ratio_hash((p_int)this_tinfo); + unsigned v = make_hash_seed(typeid(*this)); epvector::const_iterator i = seq.begin(); const epvector::const_iterator end = seq.end(); while (i != end) {