X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fadd.h;h=1943805621a0e0b691896a687fdbd77a7cb3fae6;hp=0545bcd2e1fd9d3710ce01e01054ee1bdadafff7;hb=955cb185a85535ab328ffedbfccdc508ce80fa91;hpb=487e5659efe401683eee0381b0d23f967ffffc3c diff --git a/ginac/add.h b/ginac/add.h index 0545bcd2..19438056 100644 --- a/ginac/add.h +++ b/ginac/add.h @@ -25,6 +25,10 @@ #include +#ifndef NO_GINAC_NAMESPACE +namespace GiNaC { +#endif // ndef NO_GINAC_NAMESPACE + /** Sum of expressions. */ class add : public expairseq { @@ -56,8 +60,8 @@ public: // functions overriding virtual functions from bases classes public: basic * duplicate() const; - void printraw(ostream & os) const; void print(ostream & os, unsigned upper_precedence=0) const; + void printraw(ostream & os) const; void printcsrc(ostream & os, unsigned type, unsigned upper_precedence=0) const; bool info(unsigned inf) const; int degree(symbol const & s) const; @@ -79,8 +83,6 @@ protected: unsigned return_type_tinfo(void) const; ex thisexpairseq(epvector const & v, ex const & oc) const; ex thisexpairseq(epvector * vp, ex const & oc) const; - void printpair(ostream & os, expair const & p, - unsigned upper_precedence) const; expair split_ex_to_pair(ex const & e) const; expair combine_ex_with_coeff_to_pair(ex const & e, ex const & c) const; @@ -106,6 +108,14 @@ protected: extern const add some_add; extern type_info const & typeid_add; -#define ex_to_add(X) static_cast(*(X).bp) +// utility functions +inline const add &ex_to_add(const ex &e) +{ + return static_cast(*e.bp); +} + +#ifndef NO_GINAC_NAMESPACE +} // namespace GiNaC +#endif // ndef NO_GINAC_NAMESPACE #endif // ndef __GINAC_ADD_H__