]> www.ginac.de Git - ginac.git/blobdiff - ginac/simp_lor.cpp
* New funny timing added: compute an antipode in Yukawa theory.
[ginac.git] / ginac / simp_lor.cpp
index 3454b5a0166eb011b506eb3488f2aef69c0ab917..0734439efa10b5b2c68d2b821a68438fceb20bc9 100644 (file)
@@ -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