X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?a=blobdiff_plain;f=ginac%2Fexpairseq.cpp;h=246424f7559ff394651c5c7ee0564993fc8380ea;hb=9711eff3300caffadf44b3b1bf7c6e096f26bfaa;hp=5a52efe1edf59d8364dccf19dc3d87d5911b90fe;hpb=57b66d879a72c007eabe081420de11757b5bcf90;p=ginac.git diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp index 5a52efe1..246424f7 100644 --- a/ginac/expairseq.cpp +++ b/ginac/expairseq.cpp @@ -3,7 +3,7 @@ * Implementation of sequences of expression pairs. */ /* - * GiNaC Copyright (C) 1999-2000 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2001 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 @@ -38,7 +38,7 @@ namespace GiNaC { #error "FIXME: expair_needs_further_processing not yet implemented for hashtabs, sorry. A.F." #endif // def EXPAIRSEQ_USE_HASHTAB -GINAC_IMPLEMENT_REGISTERED_CLASS(expairseq, basic) +GINAC_IMPLEMENT_REGISTERED_CLASS_NO_CTORS(expairseq, basic) ////////// // helper classes @@ -191,7 +191,7 @@ void expairseq::archive(archive_node &n) const while (i != iend) { n.add_ex("rest", i->rest); n.add_ex("coeff", i->coeff); - i++; + ++i; } n.add_ex("overall_coeff", overall_coeff); } @@ -271,7 +271,7 @@ void expairseq::printtree(std::ostream & os, unsigned indent) const for (epplist::const_iterator it=hashtab[i].begin(); it!=hashtab[i].end(); ++it) { os << *it-seq.begin() << " "; - this_bin_fill++; + ++this_bin_fill; } os << std::endl; cum_fill += this_bin_fill; @@ -914,7 +914,7 @@ void expairseq::make_flat(const exvector & v) cit=v.begin(); while (cit!=citend) { if (cit->bp->tinfo()==tinfo()) { - nexpairseqs++; + ++nexpairseqs; noperands+=ex_to_expairseq(*cit).seq.size(); } ++cit; @@ -965,7 +965,7 @@ void expairseq::make_flat(const epvector & v) cit = v.begin(); while (cit!=citend) { if (cit->rest.bp->tinfo()==tinfo()) { - nexpairseqs++; + ++nexpairseqs; noperands += ex_to_expairseq((*cit).rest).seq.size(); } ++cit; @@ -1090,7 +1090,7 @@ void expairseq::canonicalize(void) do { last_numeric--; } while (is_ex_exactly_of_type((*last_numeric).rest,numeric)); - last_numeric++; + ++last_numeric; sort(last_numeric,seq.end(),expair_is_less()); } } @@ -1197,11 +1197,11 @@ unsigned expairseq::calc_hashindex(const ex & e) const unsigned hash=e.gethash(); unsigned hashindex; if (is_a_numeric_hash(hash)) { - hashindex=hashmask; + hashindex = hashmask; } else { - hashindex=hash & hashmask; + hashindex = hash & hashmask; // last hashtab entry is reserved for numerics - if (hashindex==hashmask) hashindex=0; + if (hashindex==hashmask) hashindex = 0; } GINAC_ASSERT(hashindex>=0); GINAC_ASSERT((hashindex"; - printpair(cout,*it,0); - cout << "\n"; - cout << "pair1:" << std::endl; - (*it_last).rest.printtree(cout); - (*it_last).coeff.printtree(cout); - cout << "pair2:" << std::endl; - (*it).rest.printtree(cout); - (*it).coeff.printtree(cout); + printpair(std::clog,*it_last,0); + std::clog << ">"; + printpair(std::clog,*it,0); + std::clog << "\n"; + std::clog << "pair1:" << std::endl; + (*it_last).rest.printtree(std::clog); + (*it_last).coeff.printtree(std::clog); + std::clog << "pair2:" << std::endl; + (*it).rest.printtree(std::clog); + (*it).coeff.printtree(std::clog); return 0; } } @@ -1688,7 +1687,7 @@ epvector * expairseq::subschildren(const lst & ls, const lst & lr) const if (!are_ex_trivially_equal((*cit).rest,subsed_ex)) { // something changed, copy seq, subs and return it - epvector *s=new epvector; + epvector *s = new epvector; s->reserve(seq.size()); // copy parts of seq which are known not to have changed @@ -1729,13 +1728,6 @@ unsigned expairseq::minhashtabsize=0x1000U; unsigned expairseq::hashtabfactor=1; #endif // def EXPAIRSEQ_USE_HASHTAB -////////// -// global constants -////////// - -const expairseq some_expairseq; -const type_info & typeid_expairseq=typeid(some_expairseq); - #ifndef NO_NAMESPACE_GINAC } // namespace GiNaC #endif // ndef NO_NAMESPACE_GINAC