]> www.ginac.de Git - ginac.git/blobdiff - ginac/lorentzidx.cpp
pseries::expand(): do not generate zero terms.
[ginac.git] / ginac / lorentzidx.cpp
index 67e5576b8730979d6cf42874f6965488f771c987..ca88d94a5ca5ddc4f3ab3edc1fc791df5830838c 100644 (file)
@@ -49,28 +49,6 @@ lorentzidx::lorentzidx() : orthogonal_only(false), dim_parallel_space(0)
        tinfo_key = TINFO_lorentzidx;
 }
 
-lorentzidx::~lorentzidx() 
-{
-       debugmsg("lorentzidx destructor",LOGLEVEL_DESTRUCT);
-       destroy(false);
-}
-
-lorentzidx::lorentzidx(const lorentzidx & other)
-{
-       debugmsg("lorentzidx copy constructor",LOGLEVEL_CONSTRUCT);
-       copy(other);
-}
-
-const lorentzidx & lorentzidx::operator=(const lorentzidx & other)
-{
-       debugmsg("lorentzidx operator=",LOGLEVEL_ASSIGNMENT);
-       if (this != &other) {
-               destroy(true);
-               copy(other);
-       }
-       return *this;
-}
-
 // protected
 
 void lorentzidx::copy(const lorentzidx & other)
@@ -193,12 +171,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);
@@ -282,6 +254,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
 //////////