+
+// performance-critical inlined method implementations
+
+inline
+ex::ex() : bp(_ex0().bp)
+{
+ /*debugmsg("ex default ctor",LOGLEVEL_CONSTRUCT);*/
+ GINAC_ASSERT(_ex0().bp!=0);
+ GINAC_ASSERT(_ex0().bp->flags & status_flags::dynallocated);
+ GINAC_ASSERT(bp!=0);
+ ++bp->refcount;
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::~ex()
+{
+ /*debugmsg("ex dtor",LOGLEVEL_DESTRUCT);*/
+ 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)
+{
+ /*debugmsg("ex copy ctor",LOGLEVEL_CONSTRUCT);*/
+ 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)
+{
+ /*debugmsg("ex operator=",LOGLEVEL_ASSIGNMENT);*/
+ 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)
+{
+ /*debugmsg("ex ctor from basic",LOGLEVEL_CONSTRUCT);*/
+ construct_from_basic(other);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(int i)
+{
+ /*debugmsg("ex ctor from int",LOGLEVEL_CONSTRUCT);*/
+ 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)
+{
+ /*debugmsg("ex ctor from unsigned int",LOGLEVEL_CONSTRUCT);*/
+ construct_from_uint(i);
+#ifdef OBSCURE_CINT_HACK
+ update_last_created_or_assigned_bp();
+#endif // def OBSCURE_CINT_HACK
+}
+
+inline
+ex::ex(long i)
+{
+ /*debugmsg("ex ctor from long",LOGLEVEL_CONSTRUCT);*/
+ 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)
+{
+ /*debugmsg("ex ctor from unsigned long",LOGLEVEL_CONSTRUCT);*/
+ 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)
+{
+ /*debugmsg("ex ctor from double",LOGLEVEL_CONSTRUCT);*/
+ 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)
+{
+ /*debugmsg("ex ctor from string,lst",LOGLEVEL_CONSTRUCT);*/
+ 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);
+}
+
+