X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fsimp_lor.cpp;h=a102b74e4d3a36abe4b9852c0384e39e5a43acfd;hp=ea488dc616b41e6a696ff35635f36ddcfd57b03e;hb=afdd7fa8c6c0a587f7c80789198551383e8beb7b;hpb=487e5659efe401683eee0381b0d23f967ffffc3c diff --git a/ginac/simp_lor.cpp b/ginac/simp_lor.cpp index ea488dc6..a102b74e 100644 --- a/ginac/simp_lor.cpp +++ b/ginac/simp_lor.cpp @@ -32,6 +32,11 @@ #include "ex.h" #include "mul.h" #include "symbol.h" +#include "debugmsg.h" + +#ifndef NO_GINAC_NAMESPACE +namespace GiNaC { +#endif // ndef NO_GINAC_NAMESPACE ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -100,7 +105,7 @@ simp_lor::simp_lor(simp_lor_types const t, ex const & i1, ex const & i2) : { debugmsg("simp_lor constructor from simp_lor_types,ex,ex",LOGLEVEL_CONSTRUCT); tinfo_key=TINFO_simp_lor; - ASSERT(all_of_type_lorentzidx()); + GINAC_ASSERT(all_of_type_lorentzidx()); } simp_lor::simp_lor(simp_lor_types const t, string const & n, ex const & i1) : @@ -108,7 +113,7 @@ simp_lor::simp_lor(simp_lor_types const t, string const & n, ex const & i1) : { debugmsg("simp_lor constructor from simp_lor_types,string,ex",LOGLEVEL_CONSTRUCT); tinfo_key=TINFO_simp_lor; - ASSERT(all_of_type_lorentzidx()); + GINAC_ASSERT(all_of_type_lorentzidx()); } simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector const & iv) : @@ -116,7 +121,7 @@ simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector const & iv { debugmsg("simp_lor constructor from simp_lor_types,string,exvector",LOGLEVEL_CONSTRUCT); tinfo_key=TINFO_simp_lor; - ASSERT(all_of_type_lorentzidx()); + GINAC_ASSERT(all_of_type_lorentzidx()); } simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector * ivp) : @@ -124,7 +129,7 @@ simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector * ivp) : { debugmsg("simp_lor constructor from simp_lor_types,string,exvector*",LOGLEVEL_CONSTRUCT); tinfo_key=TINFO_simp_lor; - ASSERT(all_of_type_lorentzidx()); + GINAC_ASSERT(all_of_type_lorentzidx()); } ////////// @@ -236,7 +241,7 @@ ex simp_lor::eval(int level) const int simp_lor::compare_same_type(basic const & other) const { - ASSERT(other.tinfo() == TINFO_simp_lor); + GINAC_ASSERT(other.tinfo() == TINFO_simp_lor); const simp_lor *o = static_cast(&other); if (type==o->type) { if (name==o->name) { @@ -249,7 +254,7 @@ int simp_lor::compare_same_type(basic const & other) const bool simp_lor::is_equal_same_type(basic const & other) const { - ASSERT(other.tinfo() == TINFO_simp_lor); + GINAC_ASSERT(other.tinfo() == TINFO_simp_lor); const simp_lor *o = static_cast(&other); if (type!=o->type) return false; if (name!=o->name) return false; @@ -326,7 +331,7 @@ simp_lor lor_vec(string const & n, ex const & mu) ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) { - ASSERT(is_ex_exactly_of_type(m,mul)); + GINAC_ASSERT(is_ex_exactly_of_type(m,mul)); exvector v_contracted; // collect factors in an exvector, store squares twice @@ -351,11 +356,11 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) if (is_ex_exactly_of_type(*it,simp_lor) && (ex_to_simp_lor(*it).type==simp_lor::simp_lor_g)) { simp_lor const & g=ex_to_simp_lor(*it); - ASSERT(g.seq.size()==2); + GINAC_ASSERT(g.seq.size()==2); idx const & first_idx=ex_to_lorentzidx(g.seq[0]); idx const & second_idx=ex_to_lorentzidx(g.seq[1]); // g_{mu,mu} should have been contracted in simp_lor::eval() - ASSERT(!first_idx.is_equal(second_idx)); + GINAC_ASSERT(!first_idx.is_equal(second_idx)); ex saved_g=*it; // save to restore it later // try to contract first index @@ -368,7 +373,7 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) *it=saved_g; } else { // a contracted index should occur exactly once - ASSERT(replacements==1); + GINAC_ASSERT(replacements==1); *it=exONE(); something_changed=true; } @@ -384,7 +389,7 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) *it=saved_g; } else { // a contracted index should occur exactly once - ASSERT(replacements==1); + GINAC_ASSERT(replacements==1); *it=exONE(); something_changed=true; } @@ -405,8 +410,8 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp) (ex_to_simp_lor(*it2).type==simp_lor::simp_lor_vec)) { simp_lor const & vec1=ex_to_simp_lor(*it1); simp_lor const & vec2=ex_to_simp_lor(*it2); - ASSERT(vec1.seq.size()==1); - ASSERT(vec2.seq.size()==1); + GINAC_ASSERT(vec1.seq.size()==1); + GINAC_ASSERT(vec2.seq.size()==1); lorentzidx const & idx1=ex_to_lorentzidx(vec1.seq[0]); lorentzidx const & idx2=ex_to_lorentzidx(vec2.seq[0]); if (idx1.is_symbolic() && @@ -503,12 +508,13 @@ void scalar_products::debugprint(void) const spmapkey scalar_products::make_key(simp_lor const & v1, simp_lor const & v2) { - ASSERT(v1.type==simp_lor::simp_lor_vec); - ASSERT(v2.type==simp_lor::simp_lor_vec); + GINAC_ASSERT(v1.type==simp_lor::simp_lor_vec); + GINAC_ASSERT(v2.type==simp_lor::simp_lor_vec); lorentzidx anon=ex_to_lorentzidx(v1.seq[0]).create_anonymous_representative(); - ASSERT(anon.is_equal_same_type(ex_to_lorentzidx(v2.seq[0]).create_anonymous_representative())); + GINAC_ASSERT(anon.is_equal_same_type(ex_to_lorentzidx(v2.seq[0]).create_anonymous_representative())); return spmapkey(strstrpair(v1.name,v2.name),anon); } - - +#ifndef NO_GINAC_NAMESPACE +} // namespace GiNaC +#endif // ndef NO_GINAC_NAMESPACE