]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.h
Modification in output of last returned expression (for ginaccint)
[ginac.git] / ginac / ex.h
index f2c0a03e5133cec2457e67630e73f53968bbe9c9..313bd6c76ea5f2edadbec496322a2f8090c6e503 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's light-weight expression handles. */
 
 /*
- *  GiNaC Copyright (C) 1999 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2000 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
@@ -38,21 +38,13 @@ class status_flags;
 class symbol;
 class lst;
 
-// typedef vector<ex> exvector;
-
-// enum definitions
+extern ex const & _ex0(void);  /* FIXME: should this pollute headers? */
 
-ex const & exZERO(void);
-ex const & exONE(void);
-ex const & exTWO(void);
-ex const & exTHREE(void);
-ex const & exMINUSONE(void);
-ex const & exHALF(void);
-ex const & exMINUSHALF(void);
+// typedef vector<ex> exvector;
 
 #define INLINE_EX_CONSTRUCTORS
 
-/** Lightweight interface to GiNaC's symbolic objects. Basically all it does is
+/** Lightweight wrapper for GiNaC's symbolic objects.  Basically all it does is
  *  to hold a pointer to the other objects, manage the reference counting and
  *  provide methods for manipulation of these objects. */
 class ex
@@ -65,10 +57,10 @@ class ex
 public:
     ex()
 #ifdef INLINE_EX_CONSTRUCTORS
-    : bp(exZERO().bp)
+    : bp(_ex0().bp)
         {
-            GINAC_ASSERT(exZERO().bp!=0);
-            GINAC_ASSERT(exZERO().bp->flags & status_flags::dynallocated);
+            GINAC_ASSERT(_ex0().bp!=0);
+            GINAC_ASSERT(_ex0().bp->flags & status_flags::dynallocated);
             GINAC_ASSERT(bp!=0);
             ++bp->refcount;
 #ifdef OBSCURE_CINT_HACK
@@ -165,7 +157,7 @@ public:
     void dbgprint(void) const;
     void dbgprinttree(void) const;
     bool info(unsigned inf) const;
-    int nops() const;
+    unsigned nops() const;
     ex expand(unsigned options=0) const;
     bool has(ex const & other) const;
     int degree(symbol const & s) const;
@@ -224,7 +216,7 @@ public:
 #else
 ;
 #endif // def INLINE_EX_CONSTRUCTORS
-    bool is_zero(void) const {return compare(exZERO()) == 0;};
+    bool is_zero(void) const {return compare(_ex0())==0;};
         
     unsigned return_type(void) const;
     unsigned return_type_tinfo(void) const;
@@ -258,7 +250,6 @@ protected:
             }
             last_created_or_assigned_bp=bp;
             ++last_created_or_assigned_bp->refcount;
-            last_created_or_assigned_bp_modified=true;
         }
 #endif // def OBSCURE_CINT_HACK
 
@@ -268,7 +259,6 @@ public:
     basic *bp;
 #ifdef OBSCURE_CINT_HACK
     static basic *last_created_or_assigned_bp;
-    static bool last_created_or_assigned_bp_modified;
 #endif // def OBSCURE_CINT_HACK
 };
 
@@ -279,7 +269,7 @@ inline bool are_ex_trivially_equal(const ex &e1, const ex &e2)
 }
 
 // wrapper functions around member functions
-inline int nops(ex const & thisex)
+inline unsigned nops(ex const & thisex)
 { return thisex.nops(); }
 
 inline ex expand(ex const & thisex, unsigned options = 0)