]> www.ginac.de Git - ginac.git/blobdiff - ginac/simp_lor.cpp
Adapted to new version 1.2.5.
[ginac.git] / ginac / simp_lor.cpp
index 06eef8ee6b03b5058784291c62565ac66abfc78f..0850a3adc42da46915619f26a3d787848be5d481 100644 (file)
@@ -4,7 +4,7 @@
  *  No real implementation yet, to be done.     */
 
 /*
- *  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
@@ -31,7 +31,6 @@
 #include "simp_lor.h"
 #include "ex.h"
 #include "mul.h"
-#include "symbol.h"
 #include "debugmsg.h"
 #include "utils.h"
 
@@ -231,7 +230,7 @@ ex simp_lor::eval(int level) const
                        }
                } else if (idx1.is_symbolic() &&
                           idx1.is_co_contra_pair(idx2)) {
-                       return Dim()-idx1.get_dim_parallel_space();
+                       return Dim() - 2;
                }
        }
 
@@ -314,7 +313,7 @@ bool simp_lor::all_of_type_lorentzidx(void) const
 //////////
 
 const simp_lor some_simp_lor;
-const type_info & typeid_simp_lor = typeid(some_simp_lor);
+const std::type_info & typeid_simp_lor = typeid(some_simp_lor);
 
 //////////
 // friend functions
@@ -457,12 +456,6 @@ ex simplify_simp_lor(const ex & e, const scalar_products & sp)
        return e_expanded;
 }
 
-//ex Dim(void)   // FIXME: what's going on here?
-//{
-//    static symbol * d=new symbol("dim");
-//    return *d;
-//}
-
 //////////
 // helper classes
 //////////
@@ -487,10 +480,10 @@ bool scalar_products::is_defined(const simp_lor & v1, const simp_lor & v2) const
 
 ex scalar_products::evaluate(const simp_lor & v1, const simp_lor & v2) const
 {
-       if (v1.compare_same_type(v2)>0) {
-               return evaluate(v2,v1);
-       }
-       return spm.find(make_key(v1,v2))->second;
+       if (v1.compare_same_type(v2)>0)
+               return evaluate(v2, v1);
+       
+       return (*spm.find(make_key(v1,v2))).second;
 }
 
 void scalar_products::debugprint(void) const
@@ -500,8 +493,8 @@ void scalar_products::debugprint(void) const
                const spmapkey & k=(*cit).first;
                std::cerr << "item key=((" << k.first.first
                          << "," << k.first.second << "),";
-               k.second.printraw(cerr);
-               cerr << ") value=" << (*cit).second << std::endl;
+               k.second.printraw(std::cerr);
+               std::cerr << ") value=" << (*cit).second << std::endl;
        }
 }