]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.h
Make sure add::eval() collects all numeric terms.
[ginac.git] / ginac / symbol.h
index bd894c9479dad78eb0a985eb2243ced0dcf73be9..eefd27c80672583ab37f5ae1be2b544fa0b805c2 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's symbolic objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2008 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#ifndef __GINAC_SYMBOL_H__
-#define __GINAC_SYMBOL_H__
+#ifndef GINAC_SYMBOL_H
+#define GINAC_SYMBOL_H
 
-#include <string>
-#include <typeinfo>
 #include "basic.h"
 #include "ex.h"
 #include "ptr.h"
+#include "archive.h"
+
+#include <string>
+#include <typeinfo>
 
 namespace GiNaC {
 
@@ -36,7 +38,6 @@ namespace GiNaC {
 class symbol : public basic
 {
        GINAC_DECLARE_REGISTERED_CLASS(symbol, basic)
-
        // other constructors
 public:
        explicit symbol(const std::string & initname);
@@ -56,6 +57,10 @@ public:
        ex real_part() const;
        ex imag_part() const;
        bool is_polynomial(const ex & var) 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:
        ex derivative(const symbol & s) const;
        bool is_equal_same_type(const basic & other) const;
@@ -81,6 +86,7 @@ protected:
 private:
        static unsigned next_serial;
 };
+GINAC_DECLARE_UNARCHIVER(symbol);
 
 
 /** Specialization of symbol to real domain */
@@ -99,6 +105,7 @@ public:
 
        realsymbol* duplicate() const { return new realsymbol(*this); }
 };
+GINAC_DECLARE_UNARCHIVER(realsymbol);
 
 
 /** Specialization of symbol to real domain */
@@ -113,7 +120,8 @@ public:
 
        possymbol* duplicate() const { return new possymbol(*this); }
 };
+GINAC_DECLARE_UNARCHIVER(possymbol);
 
 } // namespace GiNaC
 
-#endif // ndef __GINAC_SYMBOL_H__
+#endif // ndef GINAC_SYMBOL_H