]> www.ginac.de Git - ginac.git/blobdiff - ginac/lorentzidx.cpp
* New funny timing added: compute an antipode in Yukawa theory.
[ginac.git] / ginac / lorentzidx.cpp
index 6a367be65c1deec6068f2e08546de67dbec7efbf..783316c48b9f173547abcdd16cc1d70ac5baf948 100644 (file)
@@ -29,9 +29,7 @@
 #include "utils.h"
 #include "debugmsg.h"
 
-#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
 
 GINAC_IMPLEMENT_REGISTERED_CLASS(lorentzidx, idx)
 
@@ -171,12 +169,6 @@ void lorentzidx::archive(archive_node &n) const
 
 // public
 
-basic * lorentzidx::duplicate() const
-{
-       debugmsg("lorentzidx duplicate",LOGLEVEL_DUPLICATE);
-       return new lorentzidx(*this);
-}
-
 void lorentzidx::printraw(std::ostream & os) const
 {
        debugmsg("lorentzidx printraw",LOGLEVEL_PRINT);
@@ -260,6 +252,18 @@ bool lorentzidx::info(unsigned inf) const
        return inherited::info(inf);
 }
 
+int lorentzidx::compare_same_type(const basic & other) const
+{
+       GINAC_ASSERT(is_of_type(other, lorentzidx));
+       const lorentzidx &o = static_cast<const lorentzidx &>(other);
+
+       if (orthogonal_only != o.orthogonal_only)
+               return orthogonal_only ? -1 : 1;
+       if (dim_parallel_space != o.dim_parallel_space)
+               return dim_parallel_space < o.dim_parallel_space ? -1 : 1;
+       return inherited::compare_same_type(other);
+}
+
 //////////
 // non-virtual functions in this class
 //////////
@@ -290,6 +294,4 @@ ex Dim(void)
        return *d;
 }
 
-#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC