]> www.ginac.de Git - ginac.git/commitdiff
- ginac/operators.cpp: added some missing debugmsg()'s, which would have
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 5 Jun 2000 13:45:14 +0000 (13:45 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Mon, 5 Jun 2000 13:45:14 +0000 (13:45 +0000)
  come in handy if they had been around before Cint's show-stopper bug.  ;-)
- INSTALL, cint/ginaccint.bin.cpp: Updated Cint-copyright.
- ginac/*: deleted some #ifdef CINT_CONVERSION_WORKAROUND's.

INSTALL
cint/ginaccint.bin.cpp
configure
ginac/ex.cpp
ginac/ex.h
ginac/function.pl
ginac/numeric.h
ginac/operators.cpp

diff --git a/INSTALL b/INSTALL
index 5f595f562269319532669b43511e6d5730eaa364..0c629b5af7bea61732b3b0287de285abce88b41e 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -107,8 +107,7 @@ Here is an overview to gives you an idea if you can expect GiNaCcint
 to compile, install and work properly:
 
  Cint version |   is known to work with   |  is known not to work with
 to compile, install and work properly:
 
  Cint version |   is known to work with   |  is known not to work with
---------------+---------------------------+-----------------------------
- < 5.14.37    |                           | (incompatible with GiNaC)
-   5.14.38    | egcs 1.1.1 (problematic)  | gcc.2.95.2
+--------------+---------------------------+------------------------------
+ < 5.14.39    | `verboten' by license (please bite your favorite lawyer)
    5.14.39    | egcs 1.1.1, gcc.2.95.2    | gcc <= 2.7.2.3
    5.14.40    | egcs 1.1.1, gcc.2.95.2    | gcc <= 2.7.2.3
    5.14.39    | egcs 1.1.1, gcc.2.95.2    | gcc <= 2.7.2.3
    5.14.40    | egcs 1.1.1, gcc.2.95.2    | gcc <= 2.7.2.3
index 2641c18bce006a7f3175ab630237a81dd7098b2b..065c27c8396b83c96a7d454d940da80e84cbc614 100644 (file)
@@ -160,8 +160,7 @@ void process_tempfile(string const & command)
 #endif // def OBSCURE_CINT_HACK
     return;
 }
 #endif // def OBSCURE_CINT_HACK
     return;
 }
-//----+----#----+----#----+----#----+----#----+----#----+----#----+----#----+----#
-//  __,  _______  Cint: Copyright 1995-2000 Masaharu Goto and Agilent Technologies, JP." << endl
+
 void greeting(void)
 {
     cout << "Welcome to GiNaC-cint (" << PACKAGE << " V" << VERSION << ")" << endl;
 void greeting(void)
 {
     cout << "Welcome to GiNaC-cint (" << PACKAGE << " V" << VERSION << ")" << endl;
index f71fb2769c1e614b16f3bd10f243272728e65837..4355667833d0b375a3992203bf458552d4e91658 100755 (executable)
--- a/configure
+++ b/configure
@@ -3060,7 +3060,7 @@ fi
     echo "$ac_t""creating cint/Makefile" 1>&6
     (cd cint && \
     $MAKECINT -mk Makefile.makecint -o ginaccint.bin -m \
     echo "$ac_t""creating cint/Makefile" 1>&6
     (cd cint && \
     $MAKECINT -mk Makefile.makecint -o ginaccint.bin -m \
-      -D OBSCURE_CINT_HACK -cc "$CXXFLAGS" \
+      -D OBSCURE_CINT_HACK "$CPPFLAGS" -cc "$CXXFLAGS" \
       -I .. -I $CINTSYSDIR -m -H ../ginac/ginac.h \
       -C++ ginaccint.bin.cpp \
       -l -L../ginac/.libs -lginac -lcln \
       -I .. -I $CINTSYSDIR -m -H ../ginac/ginac.h \
       -C++ ginaccint.bin.cpp \
       -l -L../ginac/.libs -lginac -lcln \
index 5c6853a766bb8e9b27bf59b08b3215e0f627b011..474b9fd3e075a6d26180a874334d88522700b83e 100644 (file)
@@ -482,8 +482,10 @@ void ex::construct_from_basic(const basic & other)
         }
     } else {
         if (other.flags & status_flags::dynallocated) {
         }
     } else {
         if (other.flags & status_flags::dynallocated) {
+            // it's on the heap, so just copy bp:
             bp = &const_cast<basic &>(other);
         } else {
             bp = &const_cast<basic &>(other);
         } else {
+            // create a duplicate on the heap:
             bp = other.duplicate();
             bp->setflag(status_flags::dynallocated);
         }
             bp = other.duplicate();
             bp->setflag(status_flags::dynallocated);
         }
index b5e511e6e51f9330904e63908456148d77ec48b8..c7e1da8cb538d097faf31e55292d76d177f7db02 100644 (file)
@@ -121,13 +121,6 @@ public:
 ;
 #endif // def INLINE_EX_CONSTRUCTORS
 
 ;
 #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:
 
     // other constructors
 public:
@@ -239,9 +232,6 @@ public:
     unsigned nops() const;
     ex expand(unsigned options=0) const;
     bool has(const ex & other) const;
     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;
     int degree(const symbol & s) const;
     int ldegree(const symbol & s) const;
     ex coeff(const symbol & s, int n=1) const;
@@ -254,9 +244,6 @@ public:
     numeric integer_content(void) const;
     ex primpart(const symbol &x) const;
     ex primpart(const symbol &x, const ex &cont) const;
     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 to_rational(lst &repl_lst) const;
     ex smod(const numeric &xi) const;
     ex normal(int level = 0) const;
     ex to_rational(lst &repl_lst) const;
     ex smod(const numeric &xi) const;
@@ -266,20 +253,11 @@ public:
     ex evalf(int level = 0) const;
     ex diff(const symbol & s, unsigned nth = 1) const;
     ex series(const ex & r, int order) const;
     ex evalf(int level = 0) const;
     ex diff(const symbol & s, unsigned nth = 1) const;
     ex series(const ex & r, int order) const;
-#ifdef CINT_CONVERSION_WORKAROUND
-    ex series(const basic & r, int order) const { return series(ex(r),order); }
-#endif // def CINT_CONVERSION_WORKAROUND
     ex subs(const lst & ls, const lst & lr) const;
     ex subs(const ex & e) const;
     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;
     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);
     ex operator[](int i) const;
     ex op(int i) const;
     ex & let_op(int i);
@@ -299,9 +277,6 @@ public:
 #else
 ;
 #endif // def INLINE_EX_CONSTRUCTORS
 #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
         {
     bool is_equal(const ex & other) const
 #ifdef INLINE_EX_CONSTRUCTORS
         {
@@ -316,9 +291,6 @@ public:
 #else
 ;
 #endif // def INLINE_EX_CONSTRUCTORS
 #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;
     bool is_zero(void) const {return compare(_ex0())==0;};
         
     unsigned return_type(void) const;
@@ -326,17 +298,8 @@ public:
     unsigned gethash(void) const;
 
     ex exadd(const ex & rh) const;
     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;
     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;
     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);
 private:
     void construct_from_basic(const basic & other);
     void construct_from_int(int i);
index 16936d5a17eda54969eafc60645b158c539fec66..36b7c7b7f034c371b786809f559de594200be215 100755 (executable)
@@ -35,33 +35,6 @@ sub generate {
 }
 
 $declare_function_macro_namespace = <<'END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NAMESPACE';
 }
 
 $declare_function_macro_namespace = <<'END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NAMESPACE';
-#ifdef CINT_CONVERSION_WORKAROUND
-
-#define DECLARE_FUNCTION_1P(NAME) \
-extern const unsigned function_index_##NAME; \
-inline GiNaC::function NAME(const GiNaC::ex & p1) { \
-    return GiNaC::function(function_index_##NAME, p1); \
-} \
-inline GiNaC::function NAME(const GiNaC::basic & p1) { \
-    return GiNaC::function(function_index_##NAME, GiNaC::ex(p1)); \
-}
-#define DECLARE_FUNCTION_2P(NAME) \
-extern const unsigned function_index_##NAME; \
-inline GiNaC::function NAME(const GiNaC::ex & p1, const GiNaC::ex & p2) { \
-    return GiNaC::function(function_index_##NAME, p1, p2); \
-} \
-inline GiNaC::function NAME(const GiNaC::basic & p1, const GiNaC::ex & p2) { \
-    return GiNaC::function(function_index_##NAME, GiNaC::ex(p1), p2); \
-} \
-inline GiNaC::function NAME(const GiNaC::ex & p1, const GiNaC::basic & p2) { \
-    return GiNaC::function(function_index_##NAME, p1, GiNaC::ex(p2)); \
-} \
-inline GiNaC::function NAME(const GiNaC::basic & p1, const GiNaC::basic & p2) { \
-    return GiNaC::function(function_index_##NAME, GiNaC::ex(p1), GiNaC::ex(p2)); \
-}
-
-#else // def CINT_CONVERSION_WORKAROUND
-
 #define DECLARE_FUNCTION_1P(NAME) \
 extern const unsigned function_index_##NAME; \
 inline GiNaC::function NAME(const GiNaC::ex & p1) { \
 #define DECLARE_FUNCTION_1P(NAME) \
 extern const unsigned function_index_##NAME; \
 inline GiNaC::function NAME(const GiNaC::ex & p1) { \
@@ -73,8 +46,6 @@ inline GiNaC::function NAME(const GiNaC::ex & p1, const GiNaC::ex & p2) { \
     return GiNaC::function(function_index_##NAME, p1, p2); \
 }
 
     return GiNaC::function(function_index_##NAME, p1, p2); \
 }
 
-#endif // def CINT_CONVERSION_WORKAROUND
-
 END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NAMESPACE
 
 $declare_function_macro_namespace .= generate_from_to(
 END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NAMESPACE
 
 $declare_function_macro_namespace .= generate_from_to(
@@ -88,33 +59,6 @@ inline GiNaC::function NAME(${SEQ1}) { \\
 END_OF_DECLARE_FUNCTION_MACRO_NAMESPACE
 
 $declare_function_macro_no_namespace = <<'END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NO_NAMESPACE';
 END_OF_DECLARE_FUNCTION_MACRO_NAMESPACE
 
 $declare_function_macro_no_namespace = <<'END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NO_NAMESPACE';
-#ifdef CINT_CONVERSION_WORKAROUND
-
-#define DECLARE_FUNCTION_1P(NAME) \
-extern const unsigned function_index_##NAME; \
-inline function NAME(const ex & p1) { \
-    return function(function_index_##NAME, p1); \
-} \
-inline function NAME(const basic & p1) { \
-    return function(function_index_##NAME, ex(p1)); \
-}
-#define DECLARE_FUNCTION_2P(NAME) \
-extern const unsigned function_index_##NAME; \
-inline function NAME(const ex & p1, const ex & p2) { \
-    return function(function_index_##NAME, p1, p2); \
-} \
-inline function NAME(const basic & p1, const ex & p2) { \
-    return function(function_index_##NAME, ex(p1), p2); \
-} \
-inline function NAME(const ex & p1, const basic & p2) { \
-    return function(function_index_##NAME, p1, ex(p2)); \
-} \
-inline function NAME(const basic & p1, const basic & p2) { \
-    return function(function_index_##NAME, ex(p1), ex(p2)); \
-}
-
-#else // def CINT_CONVERSION_WORKAROUND
-
 #define DECLARE_FUNCTION_1P(NAME) \
 extern const unsigned function_index_##NAME; \
 inline function NAME(const ex & p1) { \
 #define DECLARE_FUNCTION_1P(NAME) \
 extern const unsigned function_index_##NAME; \
 inline function NAME(const ex & p1) { \
@@ -126,8 +70,6 @@ inline function NAME(const ex & p1, const ex & p2) { \
     return function(function_index_##NAME, p1, p2); \
 }
 
     return function(function_index_##NAME, p1, p2); \
 }
 
-#endif // def CINT_CONVERSION_WORKAROUND
-
 END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NO_NAMESPACE
 
 $declare_function_macro_no_namespace .= generate_from_to(
 END_OF_DECLARE_FUNCTION_1_AND_2P_MACRO_NO_NAMESPACE
 
 $declare_function_macro_no_namespace .= generate_from_to(
index 51ee5e8f9b6a8c5d67f473962292b74dbafb2b86..fc45a5d8c175a973d5a3aae874afa684d44d5d96 100644 (file)
@@ -256,13 +256,6 @@ numeric isqrt(const numeric & x);
 numeric gcd(const numeric & a, const numeric & b);
 numeric lcm(const numeric & a, const numeric & b);
 
 numeric gcd(const numeric & a, const numeric & b);
 numeric lcm(const numeric & a, const numeric & b);
 
-/** Exception thrown by numeric members to signal failure */
-struct numeric_fail
-{
-    int failval;
-    numeric_fail(int n) { failval = n; }
-};
-
 // wrapper functions around member functions
 inline numeric pow(const numeric & x, const numeric & y)
 { return x.power(y); }
 // wrapper functions around member functions
 inline numeric pow(const numeric & x, const numeric & y)
 { return x.power(y); }
index ea256a8ecb597bb30b4e23c4a87c277be453d7e3..f901760e72e3eb0421f6a4d076aed1d3e04ba8de 100644 (file)
@@ -58,7 +58,7 @@ ex operator*(const ex & lh, const ex & rh)
 
 ex operator/(const ex & lh, const ex & rh)
 {
 
 ex operator/(const ex & lh, const ex & rh)
 {
-    debugmsg("operator*(ex,ex)",LOGLEVEL_OPERATOR);
+    debugmsg("operator/(ex,ex)",LOGLEVEL_OPERATOR);
     return lh.exmul(power(rh,_ex_1()));
 }
 
     return lh.exmul(power(rh,_ex_1()));
 }
 
@@ -159,27 +159,32 @@ const numeric & operator/=(numeric & lh, const numeric & rh)
 
 ex operator+(const ex & lh)
 {
 
 ex operator+(const ex & lh)
 {
+    debugmsg("operator+(ex)",LOGLEVEL_OPERATOR);
     return lh;
 }
 
 ex operator-(const ex & lh)
 {
     return lh;
 }
 
 ex operator-(const ex & lh)
 {
+    debugmsg("operator-(ex)",LOGLEVEL_OPERATOR);
     return lh.exmul(_ex_1());
 }
 
 numeric operator+(const numeric & lh)
 {
     return lh.exmul(_ex_1());
 }
 
 numeric operator+(const numeric & lh)
 {
+    debugmsg("operator+(numeric)",LOGLEVEL_OPERATOR);
     return lh;
 }
 
 numeric operator-(const numeric & lh)
 {
     return lh;
 }
 
 numeric operator-(const numeric & lh)
 {
+    debugmsg("operator-(numeric)",LOGLEVEL_OPERATOR);
     return _num_1()*lh;
 }
 
 /** Numeric prefix increment.  Adds 1 and returns incremented number. */
 numeric& operator++(numeric & rh)
 {
     return _num_1()*lh;
 }
 
 /** Numeric prefix increment.  Adds 1 and returns incremented number. */
 numeric& operator++(numeric & rh)
 {
+    debugmsg("operator++(numeric)",LOGLEVEL_OPERATOR);
     rh = rh+_num1();
     return rh;
 }
     rh = rh+_num1();
     return rh;
 }
@@ -187,6 +192,7 @@ numeric& operator++(numeric & rh)
 /** Numeric prefix decrement.  Subtracts 1 and returns decremented number. */
 numeric& operator--(numeric & rh)
 {
 /** Numeric prefix decrement.  Subtracts 1 and returns decremented number. */
 numeric& operator--(numeric & rh)
 {
+    debugmsg("operator--(numeric)",LOGLEVEL_OPERATOR);
     rh = rh-_num1();
     return rh;
 }
     rh = rh-_num1();
     return rh;
 }
@@ -195,6 +201,7 @@ numeric& operator--(numeric & rh)
  *  incremented by 1. */
 numeric operator++(numeric & lh, int)
 {
  *  incremented by 1. */
 numeric operator++(numeric & lh, int)
 {
+    debugmsg("operator++(numeric,int)",LOGLEVEL_OPERATOR);
     numeric tmp = lh;
     lh = lh+_num1();
     return tmp;
     numeric tmp = lh;
     lh = lh+_num1();
     return tmp;
@@ -204,6 +211,7 @@ numeric operator++(numeric & lh, int)
  *  decremented by 1. */
 numeric operator--(numeric & lh, int)
 {
  *  decremented by 1. */
 numeric operator--(numeric & lh, int)
 {
+    debugmsg("operator--(numeric,int)",LOGLEVEL_OPERATOR);
     numeric tmp = lh;
     lh = lh-_num1();
     return tmp;
     numeric tmp = lh;
     lh = lh-_num1();
     return tmp;
@@ -247,86 +255,6 @@ relational operator>=(const ex & lh, const ex & rh)
     return relational(lh,rh,relational::greater_or_equal);
 }
 
     return relational(lh,rh,relational::greater_or_equal);
 }
 
-/*
-
-// binary relational operators ex with numeric
-
-relational operator==(const ex & lh, const numeric & rh)
-{
-    debugmsg("operator==(ex,numeric)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::equal);
-}
-
-relational operator!=(const ex & lh, const numeric & rh)
-{
-    debugmsg("operator!=(ex,numeric)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::not_equal);
-}
-
-relational operator<(const ex & lh, const numeric & rh)
-{
-    debugmsg("operator<(ex,numeric)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::less);
-}
-
-relational operator<=(const ex & lh, const numeric & rh)
-{
-    debugmsg("operator<=(ex,numeric)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::less_or_equal);
-}
-
-relational operator>(const ex & lh, const numeric & rh)
-{
-    debugmsg("operator>(ex,numeric)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::greater);
-}
-
-relational operator>=(const ex & lh, const numeric & rh)
-{
-    debugmsg("operator>=(ex,numeric)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::greater_or_equal);
-}
-
-// binary relational operators numeric with ex
-
-relational operator==(const numeric & lh, const ex & rh)
-{
-    debugmsg("operator==(numeric,ex)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::equal);
-}
-
-relational operator!=(const numeric & lh, const ex & rh)
-{
-    debugmsg("operator!=(numeric,ex)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::not_equal);
-}
-
-relational operator<(const numeric & lh, const ex & rh)
-{
-    debugmsg("operator<(numeric,ex)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::less);
-}
-
-relational operator<=(const numeric & lh, const ex & rh)
-{
-    debugmsg("operator<=(numeric,ex)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::less_or_equal);
-}
-
-relational operator>(const numeric & lh, const ex & rh)
-{
-    debugmsg("operator>(numeric,ex)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::greater);
-}
-
-relational operator>=(const numeric & lh, const ex & rh)
-{
-    debugmsg("operator>=(numeric,ex)",LOGLEVEL_OPERATOR);
-    return relational(lh,rh,relational::greater_or_equal);
-}
-
-*/
-
 // input/output stream operators
 
 ostream & operator<<(ostream & os, const ex & e)
 // input/output stream operators
 
 ostream & operator<<(ostream & os, const ex & e)