]> www.ginac.de Git - ginac.git/blobdiff - ginac/coloridx.cpp
- Changed behaviour of .evalf() to not evalf any exponents.
[ginac.git] / ginac / coloridx.cpp
index 60e4596815de4a7544645c8a811816510975514a..3e871fbe9fbf83dc140d008ceb818616aa4b2ab5 100644 (file)
 #include <stdexcept>
 
 #include "coloridx.h"
+#include "archive.h"
 #include "utils.h"
 #include "debugmsg.h"
 
-#ifndef NO_GINAC_NAMESPACE
+#ifndef NO_NAMESPACE_GINAC
 namespace GiNaC {
-#endif // ndef NO_GINAC_NAMESPACE
+#endif // ndef NO_NAMESPACE_GINAC
+
+GINAC_IMPLEMENT_REGISTERED_CLASS(coloridx, idx)
 
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
@@ -70,12 +73,12 @@ const coloridx & coloridx::operator=(const coloridx & other)
 
 void coloridx::copy(const coloridx & other)
 {
-    idx::copy(other);
+    inherited::copy(other);
 }
 
 void coloridx::destroy(bool call_parent)
 {
-    if (call_parent) idx::destroy(call_parent);
+    if (call_parent) inherited::destroy(call_parent);
 }
 
 //////////
@@ -110,6 +113,28 @@ coloridx::coloridx(unsigned v, bool cov) : idx(v,cov)
     tinfo_key=TINFO_coloridx;
 }
 
+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+coloridx::coloridx(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+    debugmsg("coloridx constructor from archive_node", LOGLEVEL_CONSTRUCT);
+}
+
+/** Unarchive the object. */
+ex coloridx::unarchive(const archive_node &n, const lst &sym_lst)
+{
+    return (new coloridx(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void coloridx::archive(archive_node &n) const
+{
+    inherited::archive(n);
+}
+
 //////////
 // functions overriding virtual functions from bases classes
 //////////
@@ -215,6 +240,6 @@ bool coloridx::info(unsigned inf) const
 const coloridx some_coloridx;
 const type_info & typeid_coloridx=typeid(some_coloridx);
 
-#ifndef NO_GINAC_NAMESPACE
+#ifndef NO_NAMESPACE_GINAC
 } // namespace GiNaC
-#endif // ndef NO_GINAC_NAMESPACE
+#endif // ndef NO_NAMESPACE_GINAC