#include "basic.h"
#include "operators.h"
-#ifndef NO_GINAC_NAMESPACE
+#ifndef NO_NAMESPACE_GINAC
namespace GiNaC {
-#endif // ndef NO_GINAC_NAMESPACE
+#endif // ndef NO_NAMESPACE_GINAC
class ex;
class expand_options;
class symbol;
class lst;
-extern const ex & _ex0(void); /* FIXME: should this pollute headers? */
+// Sorry, this is the only constant to pollute the global scope, the other ones
+// are defined in utils.h and not visible from outside.
+extern const ex & _ex0(void); // single ex(numeric(0))
// typedef vector<ex> exvector;
;
#endif // def INLINE_EX_CONSTRUCTORS
- ex(int i);
- ex(unsigned int i);
- ex(long i);
- ex(unsigned long i);
- ex(double const d);
+ ex(int i)
+#ifdef INLINE_EX_CONSTRUCTORS
+ {
+ construct_from_int(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+ }
+#else
+;
+#endif // def INLINE_EX_CONSTRUCTORS
+
+ ex(unsigned int i)
+#ifdef INLINE_EX_CONSTRUCTORS
+ {
+ construct_from_uint(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+ }
+#else
+;
+#endif // def INLINE_EX_CONSTRUCTORS
+
+ ex(long i)
+#ifdef INLINE_EX_CONSTRUCTORS
+ {
+ construct_from_long(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+ }
+#else
+;
+#endif // def INLINE_EX_CONSTRUCTORS
+ ex(unsigned long i)
+#ifdef INLINE_EX_CONSTRUCTORS
+ {
+ construct_from_ulong(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+ }
+#else
+;
+#endif // def INLINE_EX_CONSTRUCTORS
+
+ ex(double const d)
+#ifdef INLINE_EX_CONSTRUCTORS
+ {
+ construct_from_double(d);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+ }
+#else
+;
+#endif // def INLINE_EX_CONSTRUCTORS
+
+
// functions overriding virtual functions from bases classes
// none
ex coeff(const symbol & s, int n=1) const;
ex lcoeff(const symbol & s) const { return coeff(s, degree(s)); }
ex tcoeff(const symbol & s) const { return coeff(s, ldegree(s)); }
- ex numer(bool normalize = true) const;
- ex denom(bool normalize = true) const;
+ ex numer(void) const;
+ ex denom(void) const;
ex unit(const symbol &x) const;
ex content(const symbol &x) const;
numeric integer_content(void) const;
ex operator[](int i) const;
ex op(int i) const;
ex & let_op(int i);
+ ex lhs(void) const;
+ ex rhs(void) const;
int compare(const ex & other) const
#ifdef INLINE_EX_CONSTRUCTORS
{
ex exncmul(const ex & rh) const;
private:
void construct_from_basic(const basic & other);
+ void construct_from_int(int i);
+ void construct_from_uint(unsigned int i);
+ void construct_from_long(long i);
+ void construct_from_ulong(unsigned long i);
+ void construct_from_double(double d);
void makewriteable();
#ifdef OBSCURE_CINT_HACK
}
last_created_or_assigned_bp=bp;
++last_created_or_assigned_bp->refcount;
+ last_created_or_assigned_exp=(long)(void *)(this);
}
#endif // def OBSCURE_CINT_HACK
public:
basic *bp;
#ifdef OBSCURE_CINT_HACK
- static basic *last_created_or_assigned_bp;
+ static basic * last_created_or_assigned_bp;
+ static basic * dummy_bp;
+ static long last_created_or_assigned_exp;
#endif // def OBSCURE_CINT_HACK
};
inline ex coeff(const ex & thisex, const symbol & s, int n=1)
{ return thisex.coeff(s, n); }
-inline ex numer(const ex & thisex, bool normalize = true)
-{ return thisex.numer(normalize); }
+inline ex numer(const ex & thisex)
+{ return thisex.numer(); }
-inline ex denom(const ex & thisex, bool normalize = true)
-{ return thisex.denom(normalize); }
+inline ex denom(const ex & thisex)
+{ return thisex.denom(); }
inline ex normal(const ex & thisex, int level=0)
{ return thisex.normal(level); }
inline ex subs(const ex & thisex, const lst & ls, const lst & lr)
{ return thisex.subs(ls, lr); }
+inline ex op(const ex & thisex, int i)
+{ return thisex.op(i); }
+
+inline ex lhs(const ex & thisex)
+{ return thisex.lhs(); }
+
+inline ex rhs(const ex & thisex)
+{ return thisex.rhs(); }
+
+inline bool is_zero(const ex & thisex)
+{ return thisex.is_zero(); }
+
inline void swap(ex & e1, ex & e2)
{ e1.swap(e2); }
-#ifndef NO_GINAC_NAMESPACE
+#ifndef NO_NAMESPACE_GINAC
} // namespace GiNaC
-#endif // ndef NO_GINAC_NAMESPACE
+#endif // ndef NO_NAMESPACE_GINAC
#endif // ndef __GINAC_EX_H__