]> www.ginac.de Git - ginac.git/blobdiff - ginac/coloridx.cpp
* New funny timing added: compute an antipode in Yukawa theory.
[ginac.git] / ginac / coloridx.cpp
index a227ea9b32f7bdceebbb6c7a659aea3705ab40c9..cb8b629ee86295b709c469ecf97b69701341198b 100644 (file)
@@ -27,9 +27,7 @@
 #include "utils.h"
 #include "debugmsg.h"
 
-#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
-#endif // ndef NO_NAMESPACE_GINAC
 
 GINAC_IMPLEMENT_REGISTERED_CLASS(coloridx, idx)
 
@@ -47,28 +45,6 @@ coloridx::coloridx()
        tinfo_key=TINFO_coloridx;
 }
 
-coloridx::~coloridx() 
-{
-       debugmsg("coloridx destructor",LOGLEVEL_DESTRUCT);
-       destroy(false);
-}
-
-coloridx::coloridx(const coloridx & other)
-{
-       debugmsg("coloridx copy constructor",LOGLEVEL_CONSTRUCT);
-       copy(other);
-}
-
-const coloridx & coloridx::operator=(const coloridx & other)
-{
-       debugmsg("coloridx operator=",LOGLEVEL_ASSIGNMENT);
-       if (this != &other) {
-               destroy(true);
-               copy(other);
-       }
-       return *this;
-}
-
 // protected
 
 void coloridx::copy(const coloridx & other)
@@ -87,6 +63,10 @@ void coloridx::destroy(bool call_parent)
 
 // public
 
+/** Construct symbolic color index, using an automatically generated unique name.
+ *
+ *  @param cov Index is covariant (contravariant otherwise)
+ *  @return newly constructed index */
 coloridx::coloridx(bool cov) : idx(cov)
 {
        debugmsg("coloridx constructor from bool",LOGLEVEL_CONSTRUCT);
@@ -95,18 +75,33 @@ coloridx::coloridx(bool cov) : idx(cov)
        tinfo_key=TINFO_coloridx;
 }
 
+/** Construct symbolic color index with specified name.
+ *
+ *  @param n Symbolic index name
+ *  @param cov Index is covariant (contravariant otherwise)
+ *  @return newly constructed index */
 coloridx::coloridx(const std::string & n, bool cov) : idx(n,cov)
 {
        debugmsg("coloridx constructor from string,bool",LOGLEVEL_CONSTRUCT);
        tinfo_key=TINFO_coloridx;
 }
 
+/** Construct symbolic color index with specified name.
+ *
+ *  @param n Symbolic index name
+ *  @param cov Index is covariant (contravariant otherwise)
+ *  @return newly constructed index */
 coloridx::coloridx(const char * n, bool cov) : idx(n,cov)
 {
        debugmsg("coloridx constructor from char*,bool",LOGLEVEL_CONSTRUCT);
        tinfo_key=TINFO_coloridx;
 }
 
+/** Construct numeric color index with specified value.
+ *
+ *  @param v Numeric index value
+ *  @param cov Index is covariant (contravariant otherwise)
+ *  @return newly constructed index */
 coloridx::coloridx(unsigned v, bool cov) : idx(v,cov)
 {
        debugmsg("coloridx constructor from unsigned,bool",LOGLEVEL_CONSTRUCT);
@@ -141,12 +136,6 @@ void coloridx::archive(archive_node &n) const
 
 // public
 
-basic * coloridx::duplicate() const
-{
-       debugmsg("coloridx duplicate",LOGLEVEL_DUPLICATE);
-       return new coloridx(*this);
-}
-
 void coloridx::printraw(std::ostream & os) const
 {
        debugmsg("coloridx printraw",LOGLEVEL_PRINT);
@@ -216,31 +205,9 @@ bool coloridx::info(unsigned inf) const
        return idx::info(inf);
 }
 
-//////////
-// new virtual functions which can be overridden by derived classes
-//////////
-
-// none
-
-//////////
-// non-virtual functions in this class
-//////////
-
-// none
-
-//////////
-// static member variables
-//////////
-
-// none
-
-//////////
-// global constants
-//////////
-
-const coloridx some_coloridx;
-const std::type_info & typeid_coloridx = typeid(some_coloridx);
+int coloridx::compare_same_type(const basic & other) const
+{
+       return inherited::compare_same_type(other);
+}
 
-#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_NAMESPACE_GINAC