X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fsimp_lor.cpp;h=0734439efa10b5b2c68d2b821a68438fceb20bc9;hp=3454b5a0166eb011b506eb3488f2aef69c0ab917;hb=dad107ff48f68d45e72469a8716df375ae145cf3;hpb=1bd972bf8e4eeeb8aec6081100876e81a7f18450 diff --git a/ginac/simp_lor.cpp b/ginac/simp_lor.cpp index 3454b5a0..0734439e 100644 --- a/ginac/simp_lor.cpp +++ b/ginac/simp_lor.cpp @@ -35,9 +35,7 @@ #include "debugmsg.h" #include "utils.h" -#ifndef NO_NAMESPACE_GINAC namespace GiNaC { -#endif // ndef NO_NAMESPACE_GINAC GINAC_IMPLEMENT_REGISTERED_CLASS(simp_lor, indexed) @@ -233,9 +231,11 @@ ex simp_lor::eval(int level) const // at least one off-diagonal return _ex0(); } - } else if (idx1.is_symbolic() && - idx1.is_co_contra_pair(idx2)) { - return Dim() - 2; + } else if (idx1.is_symbolic() && idx1.is_co_contra_pair(idx2)) { + if (idx1.is_orthogonal_only()) + return Dim() - idx1.get_dim_parallel_space(); + else + return Dim(); } } @@ -434,7 +434,7 @@ ex simplify_simp_lor_mul(const ex & m, const scalar_products & sp) ex simplify_simp_lor(const ex & e, const scalar_products & sp) { // all simplification is done on expanded objects - ex e_expanded=e.expand(); + ex e_expanded = e.expand(); // simplification of sum=sum of simplifications if (is_ex_exactly_of_type(e_expanded,add)) { @@ -505,6 +505,4 @@ spmapkey scalar_products::make_key(const simp_lor & v1, const simp_lor & v2) return spmapkey(strstrpair(v1.name,v2.name),anon); } -#ifndef NO_NAMESPACE_GINAC } // namespace GiNaC -#endif // ndef NO_NAMESPACE_GINAC