]> www.ginac.de Git - ginac.git/blobdiff - ginac/ncmul.cpp
- implemented global class registry (for class basic and derived classes)
[ginac.git] / ginac / ncmul.cpp
index d3a6883f985ebfa884b1655b3d77de8b3136099a..d7d97b957fa7d517abd10804c4bdb74e44df53c3 100644 (file)
@@ -28,6 +28,7 @@
 #include "ex.h"
 #include "add.h"
 #include "mul.h"
+#include "archive.h"
 #include "debugmsg.h"
 #include "utils.h"
 
@@ -35,6 +36,8 @@
 namespace GiNaC {
 #endif // ndef NO_GINAC_NAMESPACE
 
+GINAC_IMPLEMENT_REGISTERED_CLASS(ncmul, exprseq)
+
 //////////
 // default constructor, destructor, copy constructor assignment operator and helpers
 //////////
@@ -73,12 +76,12 @@ ncmul const & ncmul::operator=(ncmul const & other)
 
 void ncmul::copy(ncmul const & other)
 {
-    exprseq::copy(other);
+    inherited::copy(other);
 }
 
 void ncmul::destroy(bool call_parent)
 {
-    if (call_parent) exprseq::destroy(call_parent);
+    if (call_parent) inherited::destroy(call_parent);
 }
 
 //////////
@@ -88,28 +91,28 @@ void ncmul::destroy(bool call_parent)
 // public
 
 ncmul::ncmul(ex const & lh, ex const & rh) :
-    exprseq(lh,rh)
+    inherited(lh,rh)
 {
     debugmsg("ncmul constructor from ex,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
 }
 
 ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3) :
-    exprseq(f1,f2,f3)
+    inherited(f1,f2,f3)
 {
     debugmsg("ncmul constructor from 3 ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
 }
 
 ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
-      ex const & f4) : exprseq(f1,f2,f3,f4)
+      ex const & f4) : inherited(f1,f2,f3,f4)
 {
     debugmsg("ncmul constructor from 4 ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
 }
 
 ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
-      ex const & f4, ex const & f5) : exprseq(f1,f2,f3,f4,f5)
+      ex const & f4, ex const & f5) : inherited(f1,f2,f3,f4,f5)
 {
     debugmsg("ncmul constructor from 5 ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
@@ -117,23 +120,46 @@ ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
 
 ncmul::ncmul(ex const & f1, ex const & f2, ex const & f3,
       ex const & f4, ex const & f5, ex const & f6) :
-    exprseq(f1,f2,f3,f4,f5,f6)
+    inherited(f1,f2,f3,f4,f5,f6)
 {
     debugmsg("ncmul constructor from 6 ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
 }
 
-ncmul::ncmul(exvector const & v, bool discardable) : exprseq(v,discardable)
+ncmul::ncmul(exvector const & v, bool discardable) : inherited(v,discardable)
 {
     debugmsg("ncmul constructor from exvector,bool",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
 }
 
-ncmul::ncmul(exvector * vp) : exprseq(vp)
+ncmul::ncmul(exvector * vp) : inherited(vp)
 {
     debugmsg("ncmul constructor from exvector *",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_ncmul;
 }
+
+//////////
+// archiving
+//////////
+
+/** Construct object from archive_node. */
+ncmul::ncmul(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+{
+    debugmsg("ncmul constructor from archive_node", LOGLEVEL_CONSTRUCT);
+}
+
+/** Unarchive the object. */
+ex ncmul::unarchive(const archive_node &n, const lst &sym_lst)
+{
+    return (new ncmul(n, sym_lst))->setflag(status_flags::dynallocated);
+}
+
+/** Archive the object. */
+void ncmul::archive(archive_node &n) const
+{
+    inherited::archive(n);
+}
+
     
 //////////
 // functions overriding virtual functions from bases classes
@@ -514,7 +540,7 @@ ex ncmul::thisexprseq(exvector * vp) const
 
 int ncmul::compare_same_type(basic const & other) const
 {
-    return exprseq::compare_same_type(other);
+    return inherited::compare_same_type(other);
 }
 
 unsigned ncmul::return_type(void) const