]> www.ginac.de Git - ginac.git/blobdiff - ginac/lortensor.cpp
- g~mu_mu contraction returns Dim for general Lorentz indices and Dim-dimP
[ginac.git] / ginac / lortensor.cpp
index 0238adcb629a8f4ad3b98ff59ab98e727123c3e8..e8f4f87312d9070d5e2b826affbeddb40f60bf37 100644 (file)
@@ -31,7 +31,6 @@
 #include "add.h"
 #include "mul.h"
 #include "debugmsg.h"
-#include "flags.h"
 #include "lst.h"
 #include "lortensor.h"
 #include "operators.h"
@@ -60,28 +59,6 @@ lortensor::lortensor() : inherited(TINFO_lortensor), type(invalid)
        name=autoname_prefix()+ToString(serial);
 }
 
-lortensor::~lortensor()
-{
-       debugmsg("lortensor destructor",LOGLEVEL_DESTRUCT);
-       destroy(false);
-}
-
-lortensor::lortensor(const lortensor & other)
-{
-       debugmsg("lortensor copy constructor",LOGLEVEL_CONSTRUCT);
-       copy (other);
-}
-
-const lortensor & lortensor::operator=(const lortensor & other)
-{
-       debugmsg("lortensor operator=",LOGLEVEL_ASSIGNMENT);
-       if (this != & other) {
-               destroy(true);
-               copy(other);
-       }
-       return *this;
-}
-
 //protected
 
 void lortensor::copy(const lortensor & other)
@@ -260,12 +237,6 @@ void lortensor::archive(archive_node &n) const
 
 //public
 
-basic * lortensor::duplicate() const
-{
-       debugmsg("lortensor duplicate",LOGLEVEL_DUPLICATE);
-       return new lortensor(*this);
-}
-
 void lortensor::printraw(std::ostream & os) const
 {
        debugmsg("lortensor printraw",LOGLEVEL_PRINT);
@@ -350,7 +321,10 @@ ex lortensor::eval(int level) const
                                return _ex0();
                        }
                } else if (idx1.is_symbolic() && idx1.is_co_contra_pair(idx2)) {
-                       return Dim() - 2;
+                       if (idx1.is_orthogonal_only())
+                               return Dim() - idx1.get_dim_parallel_space();
+                       else
+                               return Dim();
                }
        }
        return this -> hold();