+
+// performance-critical inlined method implementations
+
+inline
+ex::ex()
+{
+ extern const class numeric *_num0_p;
+ bp = (basic*)_num0_p;
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+ ++bp->refcount;
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::~ex()
+{
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+ if (--bp->refcount == 0)
+ delete bp;
+}
+
+inline
+ex::ex(const ex & other) : bp(other.bp)
+{
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT((bp->flags) & status_flags::dynallocated);
+ ++bp->refcount;
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex & ex::operator=(const ex & other)
+{
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+ GINAC_ASSERT(other.bp!=0);
+ GINAC_ASSERT(other.bp->flags & status_flags::dynallocated);
+ // NB: must first increment other.bp->refcount, since other might be *this.
+ ++other.bp->refcount;
+ if (--bp->refcount==0)
+ delete bp;
+ bp = other.bp;
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+ return *this;
+}
+
+inline
+ex::ex(const basic & other)
+{
+ construct_from_basic(other);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(int i)
+{
+ construct_from_int(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(unsigned int i)
+{
+ construct_from_uint(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(long i)
+{
+ construct_from_long(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(unsigned long i)
+{
+ construct_from_ulong(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(double const d)
+{
+ construct_from_double(d);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(const std::string &s, const ex &l)
+{
+ construct_from_string_and_lst(s, l);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+int ex::compare(const ex & other) const
+{
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(other.bp!=0);
+ if (bp==other.bp) // trivial case: both expressions point to same basic
+ return 0;
+ return bp->compare(*other.bp);
+}
+
+inline
+bool ex::is_equal(const ex & other) const
+{
+ GINAC_ASSERT(bp!=0);
+ GINAC_ASSERT(other.bp!=0);
+ if (bp==other.bp) // trivial case: both expressions point to same basic
+ return true;
+ return bp->is_equal(*other.bp);
+}
+
+