From d44ad7a1e65cfb2a8ca56382609cc22b2e6e07c4 Mon Sep 17 00:00:00 2001 From: Alexander Frink Date: Thu, 17 Feb 2000 01:42:33 +0000 Subject: [PATCH] new #define CINT_CONVERSION_WORKAROUND for ginaccint, needed for cint 5.14.x with x>26 until the derived->basic->ex conversion bug is fixed --- configure.in | 2 +- ginac/ex.h | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index 79708765..40118f71 100644 --- a/configure.in +++ b/configure.in @@ -170,7 +170,7 @@ if test "x$with_cint" != "xno"; then AC_MSG_RESULT([creating cint/Makefile]) (cd cint && \ $MAKECINT -mk Makefile.makecint -o ginaccint.bin -m \ - -D OBSCURE_CINT_HACK -D NO_NAMESPACE_GINAC \ + -D OBSCURE_CINT_HACK -D CINT_CONVERSION_WORKAROUND -D NO_NAMESPACE_GINAC \ -I .. -I $CINTSYSDIR -m -H ../ginac/ginac.h dummies.h \ -C++ dummies.cpp -C++ ginaccint.bin.cpp \ -l ./libginac.a -lcln -cint -M0x10; \ diff --git a/ginac/ex.h b/ginac/ex.h index 9f72ab55..40dd07e0 100644 --- a/ginac/ex.h +++ b/ginac/ex.h @@ -123,6 +123,14 @@ public: ; #endif // def INLINE_EX_CONSTRUCTORS +#ifdef CINT_CONVERSION_WORKAROUND + // workaround to fix the missing automatic derived->basic->ex conversion + const ex & operator=(const basic & other) + { + return *this=ex(other); + } +#endif // def CINT_CONVERSION_WORKAROUND + // other constructors public: ex(const basic & other) @@ -217,6 +225,9 @@ public: unsigned nops() const; ex expand(unsigned options=0) const; bool has(const ex & other) const; +#ifdef CINT_CONVERSION_WORKAROUND + bool has(basic const & other) const { return has(ex(other)); } +#endif // def CINT_CONVERSION_WORKAROUND int degree(const symbol & s) const; int ldegree(const symbol & s) const; ex coeff(const symbol & s, int n=1) const; @@ -229,6 +240,9 @@ public: numeric integer_content(void) const; ex primpart(const symbol &x) const; ex primpart(const symbol &x, const ex &cont) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex primpart(const symbol &x, const basic &cont) const { return primpart(x,ex(cont)); } +#endif // def CINT_CONVERSION_WORKAROUND ex normal(int level = 0) const; ex smod(const numeric &xi) const; numeric max_coefficient(void) const; @@ -237,11 +251,20 @@ public: ex evalf(int level = 0) const; ex diff(const symbol & s, unsigned nth = 1) const; ex series(const symbol & s, const ex & point, int order = 6) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex series(const symbol & s, const basic & point, int order = 6) const { return series(s,ex(point),order); } +#endif // def CINT_CONVERSION_WORKAROUND ex subs(const lst & ls, const lst & lr) const; ex subs(const ex & e) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex subs(const basic & e) const { return subs(ex(e)); } +#endif // def CINT_CONVERSION_WORKAROUND exvector get_indices(void) const; ex simplify_ncmul(const exvector & v) const; ex operator[](const ex & index) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex operator[](const basic & index) const { return operator[](ex(index)); } +#endif // def CINT_CONVERSION_WORKAROUND ex operator[](int i) const; ex op(int i) const; ex & let_op(int i); @@ -261,6 +284,9 @@ public: #else ; #endif // def INLINE_EX_CONSTRUCTORS +#ifdef CINT_CONVERSION_WORKAROUND + int compare(const basic & other) const { return compare(ex(other)); } +#endif // def CINT_CONVERSION_WORKAROUND bool is_equal(const ex & other) const #ifdef INLINE_EX_CONSTRUCTORS { @@ -275,6 +301,9 @@ public: #else ; #endif // def INLINE_EX_CONSTRUCTORS +#ifdef CINT_CONVERSION_WORKAROUND + bool is_equal(const basic & other) const { return is_equal(ex(other)); } +#endif // def CINT_CONVERSION_WORKAROUND bool is_zero(void) const {return compare(_ex0())==0;}; unsigned return_type(void) const; @@ -282,8 +311,17 @@ public: unsigned gethash(void) const; ex exadd(const ex & rh) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex exadd(const basic & rh) const { return exadd(ex(rh)); } +#endif // def CINT_CONVERSION_WORKAROUND ex exmul(const ex & rh) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex exmul(const basic & rh) const { return exmul(ex(rh)); } +#endif // def CINT_CONVERSION_WORKAROUND ex exncmul(const ex & rh) const; +#ifdef CINT_CONVERSION_WORKAROUND + ex exncmul(const basic & rh) const { return exncmul(ex(rh)); } +#endif // def CINT_CONVERSION_WORKAROUND private: void construct_from_basic(const basic & other); void construct_from_int(int i); -- 2.44.0