+
+ // default ctor, dtor, copy ctor, assignment operator and helpers
+public:
+ ex();
+ ~ex();
+ ex(const ex & other);
+ ex & operator=(const ex & other);
+ // other ctors
+public:
+ ex(const basic & other);
+ ex(int i);
+ ex(unsigned int i);
+ ex(long i);
+ ex(unsigned long i);
+ ex(double const d);
+ /** Construct ex from string and a list of symbols. The input grammar is
+ * similar to the GiNaC output format. All symbols to be used in the
+ * expression must be specified in a lst in the second argument. Undefined
+ * symbols and other parser errors will throw an exception. */
+ ex(const std::string &s, const ex &l);
+
+ // non-virtual functions in this class
+public:
+ /** Efficiently swap the contents of two expressions. */
+ void swap(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);
+
+ basic * tmpbp = bp;
+ bp = other.bp;
+ other.bp = tmpbp;
+ }
+
+ void print(const print_context & c, unsigned level = 0) const;
+ void printtree(std::ostream & os) const;
+ void dbgprint(void) const;
+ void dbgprinttree(void) const;
+ bool info(unsigned inf) const { return bp->info(inf); }
+ unsigned nops() const { return bp->nops(); }
+ ex expand(unsigned options=0) const;
+ bool has(const ex & pattern) const { return bp->has(pattern); }
+ ex map(map_function & f) const { return bp->map(f); }
+ ex map(ex (*f)(const ex & e)) const;
+ bool find(const ex & pattern, lst & found) const;
+ int degree(const ex & s) const { return bp->degree(s); }
+ int ldegree(const ex & s) const { return bp->ldegree(s); }
+ ex coeff(const ex & s, int n = 1) const { return bp->coeff(s, n); }
+ ex lcoeff(const ex & s) const { return coeff(s, degree(s)); }
+ ex tcoeff(const ex & s) const { return coeff(s, ldegree(s)); }
+ ex numer(void) const;
+ ex denom(void) const;
+ ex numer_denom(void) const;
+ ex unit(const symbol &x) const;
+ ex content(const symbol &x) const;
+ numeric integer_content(void) const;
+ ex primpart(const symbol &x) const;
+ ex primpart(const symbol &x, const ex &cont) const;
+ ex normal(int level = 0) const;
+ ex to_rational(lst &repl_lst) const { return bp->to_rational(repl_lst); }
+ ex smod(const numeric &xi) const { return bp->smod(xi); }
+ numeric max_coefficient(void) const;
+ ex collect(const ex & s, bool distributed = false) const { return bp->collect(s, distributed); }
+ ex eval(int level = 0) const { return bp->eval(level); }
+ ex evalf(int level = 0) const { return bp->evalf(level); }
+ ex evalm(void) const { return bp->evalm(); }
+ ex diff(const symbol & s, unsigned nth = 1) const;
+ ex series(const ex & r, int order, unsigned options = 0) const;
+ bool match(const ex & pattern) const;
+ bool match(const ex & pattern, lst & repl_lst) const { return bp->match(pattern, repl_lst); }
+ ex subs(const lst & ls, const lst & lr, bool no_pattern = false) const { return bp->subs(ls, lr, no_pattern); }
+ ex subs(const ex & e, bool no_pattern = false) const { return bp->subs(e, no_pattern); }
+ exvector get_free_indices(void) const { return bp->get_free_indices(); }
+ ex simplify_indexed(void) const;
+ ex simplify_indexed(const scalar_products & sp) const;
+ ex symmetrize(void) const;
+ ex symmetrize(const lst & l) const;
+ ex antisymmetrize(void) const;
+ ex antisymmetrize(const lst & l) const;
+ ex symmetrize_cyclic(void) const;
+ ex symmetrize_cyclic(const lst & l) const;
+ ex simplify_ncmul(const exvector & v) const { return bp->simplify_ncmul(v); }
+ ex operator[](const ex & index) const;
+ ex operator[](int i) const;
+ ex op(int i) const { return bp->op(i); }
+ ex & let_op(int i);
+ ex lhs(void) const;
+ ex rhs(void) const;
+ int compare(const ex & other) const;
+ bool is_equal(const ex & other) const;
+ bool is_zero(void) const { extern const ex _ex0; return is_equal(_ex0); }
+
+ unsigned return_type(void) const { return bp->return_type(); }
+ unsigned return_type_tinfo(void) const { return bp->return_type_tinfo(); }
+ unsigned gethash(void) const { return bp->gethash(); }
+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 construct_from_string_and_lst(const std::string &s, const ex &l);
+ void makewriteable();
+
+#ifdef OBSCURE_CINT_HACK
+public:
+ static bool last_created_or_assigned_bp_can_be_converted_to_ex(void)
+ {
+ if (last_created_or_assigned_bp==0) return false;
+ if ((last_created_or_assigned_bp->flags &
+ status_flags::dynallocated)==0) return false;
+ if ((last_created_or_assigned_bp->flags &
+ status_flags::evaluated)==0) return false;
+ return true;
+ }
+protected:
+ void update_last_created_or_assigned_bp(void)
+ {
+ if (last_created_or_assigned_bp!=0) {
+ if (--last_created_or_assigned_bp->refcount == 0) {
+ delete last_created_or_assigned_bp;
+ }
+ }
+ 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
+
+// member variables