]> www.ginac.de Git - ginac.git/blobdiff - ginac/numeric.h
Univariate Hensel lifting now uses upoly.
[ginac.git] / ginac / numeric.h
index 0456b81de8af5d4877b793096d6acadae66c5d69..28bef0a06e172549699a3c4e2e8074f60accf176 100644 (file)
@@ -3,7 +3,7 @@
  *  Makes the interface to the underlying bignum package available. */
 
 /*
- *  GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2008 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
@@ -25,6 +25,7 @@
 
 #include "basic.h"
 #include "ex.h"
+#include "archive.h"
 
 #include <stdexcept>
 #include <vector>
@@ -105,6 +106,7 @@ public:
 public:
        unsigned precedence() const {return 30;}
        bool info(unsigned inf) const;
+       bool is_polynomial(const ex & var) const;
        int degree(const ex & s) const;
        int ldegree(const ex & s) const;
        ex coeff(const ex & s, int n = 1) const;
@@ -119,6 +121,12 @@ public:
        ex smod(const numeric &xi) const;
        numeric max_coefficient() const;
        ex conjugate() const;
+       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:
        /** Implementation of ex::diff for a numeric always returns 0.
         *  @see ex::diff */
@@ -148,6 +156,7 @@ public:
        const numeric & operator=(double d);
        const numeric & operator=(const char *s);
        const numeric inverse() const;
+       numeric step() const;
        int csgn() const;
        int compare(const numeric &other) const;
        bool is_equal(const numeric &other) const;
@@ -180,7 +189,7 @@ public:
        const numeric denom() const;
        int int_length() const;
        // converting routines for interfacing with CLN:
-       numeric(const cln::cl_N &z);
+       explicit numeric(const cln::cl_N &z);
 
 protected:
        void print_numeric(const print_context & c, const char *par_open, const char *par_close, const char *imag_sym, const char *mul_sym, unsigned level) const;
@@ -196,6 +205,7 @@ protected:
 protected:
        cln::cl_N value;
 };
+GINAC_DECLARE_UNARCHIVER(numeric); 
 
 
 // global constants
@@ -250,6 +260,9 @@ inline const numeric pow(const numeric &x, const numeric &y)
 inline const numeric inverse(const numeric &x)
 { return x.inverse(); }
 
+inline numeric step(const numeric &x)
+{ return x.step(); }
+
 inline int csgn(const numeric &x)
 { return x.csgn(); }
 
@@ -259,6 +272,9 @@ inline bool is_zero(const numeric &x)
 inline bool is_positive(const numeric &x)
 { return x.is_positive(); }
 
+inline bool is_negative(const numeric &x)
+{ return x.is_negative(); }
+
 inline bool is_integer(const numeric &x)
 { return x.is_integer(); }