X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcolor.cpp;h=095a3b0c13564820cacdf328b529fec2ce1bf3a0;hp=33dc647cfbe3bba70a7984372c1d41546a34f533;hb=24fe247f9ed16114a765a01c593fec5c4a2f591c;hpb=487e5659efe401683eee0381b0d23f967ffffc3c diff --git a/ginac/color.cpp b/ginac/color.cpp index 33dc647c..095a3b0c 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -33,6 +33,9 @@ #include "ncmul.h" #include "numeric.h" #include "relational.h" +#include "debugmsg.h" + +namespace GiNaC { ////////// // default constructor, destructor, copy constructor assignment operator and helpers @@ -93,54 +96,54 @@ void color::destroy(bool call_parent) color::color(color_types const t, unsigned const rl) : type(t), representation_label(rl) { debugmsg("color constructor from color_types,unsigned",LOGLEVEL_CONSTRUCT); - ASSERT(representation_label(&other); if (type==o->type) { if (representation_label==o->representation_label) { @@ -357,7 +360,7 @@ int color::compare_same_type(basic const & other) const bool color::is_equal_same_type(basic const & other) const { - ASSERT(other.tinfo() == TINFO_color); + GINAC_ASSERT(other.tinfo() == TINFO_color); const color *o = static_cast(&other); if (type!=o->type) return false; if (representation_label!=o->representation_label) return false; @@ -383,11 +386,11 @@ ex color::simplify_ncmul(exvector const & v) const // process only delta8 objects if (is_ex_exactly_of_type(*it,color) && (ex_to_color(*it).type==color_delta8)) { color & d8=ex_to_nonconst_color(*it); - ASSERT(d8.seq.size()==2); + GINAC_ASSERT(d8.seq.size()==2); coloridx const & first_idx=ex_to_coloridx(d8.seq[0]); coloridx const & second_idx=ex_to_coloridx(d8.seq[1]); // delta8_{a,a} should have been contracted in color::eval() - ASSERT((!first_idx.is_equal(second_idx))||(!first_idx.is_symbolic())); + GINAC_ASSERT((!first_idx.is_equal(second_idx))||(!first_idx.is_symbolic())); ex saved_delta8=*it; // save to restore it later // try to contract first index @@ -399,7 +402,7 @@ ex color::simplify_ncmul(exvector const & v) const *it=saved_delta8; } else { // a contracted index should occur exactly twice - ASSERT(replacements==2); + GINAC_ASSERT(replacements==2); *it=exONE(); something_changed=true; } @@ -414,7 +417,7 @@ ex color::simplify_ncmul(exvector const & v) const *it=saved_delta8; } else { // a contracted index should occur exactly twice - ASSERT(replacements==2); + GINAC_ASSERT(replacements==2); *it=exONE(); something_changed=true; } @@ -447,8 +450,8 @@ ex color::simplify_ncmul(exvector const & v) const if ((dvec.size()>=1)&&(fvec.size()>=1)) { for (exvector::iterator it1=dvec.begin(); it1!=dvec.end(); ++it1) { for (exvector::iterator it2=fvec.begin(); it2!=fvec.end(); ++it2) { - ASSERT(is_ex_exactly_of_type(*it1,color)); - ASSERT(is_ex_exactly_of_type(*it2,color)); + GINAC_ASSERT(is_ex_exactly_of_type(*it1,color)); + GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)); color const & col1=ex_to_color(*it1); color const & col2=ex_to_color(*it2); exvector iv_intersect=idx_intersect(col1.seq,col2.seq); @@ -461,8 +464,8 @@ ex color::simplify_ncmul(exvector const & v) const if (dvec.size()>=2) { for (exvector::iterator it1=dvec.begin(); it1!=dvec.end()-1; ++it1) { for (exvector::iterator it2=it1+1; it2!=dvec.end(); ++it2) { - ASSERT(is_ex_exactly_of_type(*it1,color)); - ASSERT(is_ex_exactly_of_type(*it2,color)); + GINAC_ASSERT(is_ex_exactly_of_type(*it1,color)); + GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)); color const & col1=ex_to_color(*it1); color const & col2=ex_to_color(*it2); exvector iv_intersect=idx_intersect(col1.seq,col2.seq); @@ -488,8 +491,8 @@ ex color::simplify_ncmul(exvector const & v) const if (fvec.size()>=2) { for (exvector::iterator it1=fvec.begin(); it1!=fvec.end()-1; ++it1) { for (exvector::iterator it2=it1+1; it2!=fvec.end(); ++it2) { - ASSERT(is_ex_exactly_of_type(*it1,color)); - ASSERT(is_ex_exactly_of_type(*it2,color)); + GINAC_ASSERT(is_ex_exactly_of_type(*it1,color)); + GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)); color const & col1=ex_to_color(*it1); color const & col2=ex_to_color(*it2); exvector iv_intersect=idx_intersect(col1.seq,col2.seq); @@ -517,14 +520,14 @@ ex color::simplify_ncmul(exvector const & v) const if ((Tvecs[rl].size()>=2)&&((dvec.size()>=1)||(fvec.size()>=1))) { for (exvector::iterator it1=Tvecs[rl].begin(); it1!=Tvecs[rl].end()-1; ++it1) { exvector iv; - ASSERT(is_ex_exactly_of_type(*it1,color)&&ex_to_color(*it1).type==color_T); - ASSERT(is_ex_exactly_of_type(*(it1+1),color)&&ex_to_color(*(it1+1)).type==color_T); + GINAC_ASSERT(is_ex_exactly_of_type(*it1,color)&&ex_to_color(*it1).type==color_T); + GINAC_ASSERT(is_ex_exactly_of_type(*(it1+1),color)&&ex_to_color(*(it1+1)).type==color_T); iv.push_back(ex_to_color(*it1).seq[0]); iv.push_back(ex_to_color(*(it1+1)).seq[0]); // d_{a,b,c} T_b T_c = 5/6 T_a for (exvector::iterator it2=dvec.begin(); it2!=dvec.end(); ++it2) { - ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_d); + GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_d); color const & dref=ex_to_color(*it2); exvector iv_intersect=idx_intersect(dref.seq,iv); if (iv_intersect.size()==2) { @@ -540,7 +543,7 @@ ex color::simplify_ncmul(exvector const & v) const // f_{a,b,c} T_b T_c = 3/2 I T_a for (exvector::iterator it2=fvec.begin(); it2!=fvec.end(); ++it2) { - ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_f); + GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_f); color const & fref=ex_to_color(*it2); exvector iv_intersect=idx_intersect(fref.seq,iv); if (iv_intersect.size()==2) { @@ -678,7 +681,7 @@ void split_color_string_in_parts(exvector const & v, exvector & delta8vec, dvec.push_back(*cit); break; case color::color_T: - ASSERT(ex_to_color(*cit).representation_label=0)&&((++counter[l])>COLOR_EIGHT)) { + while ((l>=0)&&((++counter[l])>(int)COLOR_EIGHT)) { counter[l]=1; l--; } @@ -962,15 +965,4 @@ void append_exvector_to_exvector(exvector & dest, exvector const & source) } } - - - - - - - - - - - - +} // namespace GiNaC