]> www.ginac.de Git - ginac.git/blobdiff - ginac/matrix.h
Don't force every algebraic class to implement archiving/unarchiving.
[ginac.git] / ginac / matrix.h
index 8544c9db9698a0b7cb05bc3699be3ef873dc8b05..e48f3d8a19942773de59f3f50c189f04bee63845 100644 (file)
@@ -27,6 +27,7 @@
 #include <string>
 #include "basic.h"
 #include "ex.h"
+#include "archive.h"
 
 namespace GiNaC {
 
@@ -124,6 +125,10 @@ public:
        ex real_part() const;
        ex imag_part() const;
 
+       /** Save (a.k.a. serialize) object into archive. */
+       void archive(archive_node& n) const;
+       /** Read (a.k.a. deserialize) object from archive. */
+       void read_archive(const archive_node& n, lst& syms);
 protected:
        bool match_same_type(const basic & other) const;
        unsigned return_type() const { return return_types::noncommutative; };
@@ -170,6 +175,7 @@ protected:
        unsigned col;             ///< number of columns
        exvector m;               ///< representation (cols indexed first)
 };
+GINAC_DECLARE_UNARCHIVER(matrix); 
 
 
 // wrapper functions around member functions