- ASSERT macro renamed to GINAC_ASSERT
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 22 Nov 1999 19:44:58 +0000 (19:44 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Mon, 22 Nov 1999 19:44:58 +0000 (19:44 +0000)
44 files changed:
ginac/add.cpp
ginac/assertion.h
ginac/basic.cpp
ginac/basic.h
ginac/clifford.cpp
ginac/color.cpp
ginac/constant.cpp
ginac/container.pl
ginac/debugmsg.h
ginac/diff.cpp
ginac/ex.cpp
ginac/ex.h
ginac/expair.h
ginac/expairseq.cpp
ginac/exprseq.cpp
ginac/exprseq_suppl.cpp
ginac/function.cpp
ginac/function.pl
ginac/idx.cpp
ginac/indexed.cpp
ginac/inifcns.cpp
ginac/inifcns_gamma.cpp
ginac/inifcns_trans.cpp
ginac/inifcns_zeta.cpp
ginac/isospin.cpp
ginac/lorentzidx.cpp
ginac/lst.cpp
ginac/matrix.cpp
ginac/mul.cpp
ginac/ncmul.cpp
ginac/normal.cpp
ginac/numeric.cpp
ginac/power.cpp
ginac/print.cpp
ginac/printcsrc.cpp
ginac/printraw.cpp
ginac/printtree.cpp
ginac/relational.cpp
ginac/series.cpp
ginac/simp_lor.cpp
ginac/structure.cpp
ginac/structure.pl
ginac/symbol.cpp
ginac/utils.h

index 0f25d2d..6f5380c 100644 (file)
@@ -87,7 +87,7 @@ add::add(ex const & lh, ex const & rh)
     tinfo_key = TINFO_add;
     overall_coeff=exZERO();
     construct_from_2_ex(lh,rh);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 add::add(exvector const & v)
@@ -96,7 +96,7 @@ add::add(exvector const & v)
     tinfo_key = TINFO_add;
     overall_coeff=exZERO();
     construct_from_exvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 /*
@@ -112,7 +112,7 @@ add::add(epvector const & v, bool do_not_canonicalize)
     } else {
         construct_from_epvector(v);
     }
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 */
 
@@ -122,7 +122,7 @@ add::add(epvector const & v)
     tinfo_key = TINFO_add;
     overall_coeff=exZERO();
     construct_from_epvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 add::add(epvector const & v, ex const & oc)
@@ -131,18 +131,18 @@ add::add(epvector const & v, ex const & oc)
     tinfo_key = TINFO_add;
     overall_coeff=oc;
     construct_from_epvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 add::add(epvector * vp, ex const & oc)
 {
     debugmsg("add constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_add;
-    ASSERT(vp!=0);
+    GINAC_ASSERT(vp!=0);
     overall_coeff=oc;
     construct_from_epvector(*vp);
     delete vp;
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 //////////
@@ -276,13 +276,13 @@ ex add::eval(int level) const
     debugmsg("add eval",LOGLEVEL_MEMBER_FUNCTION);
 
     if ((level==1)&&(flags & status_flags::evaluated)) {
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
         for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
-            ASSERT(!is_ex_exactly_of_type((*cit).rest,add));
-            ASSERT(!(is_ex_exactly_of_type((*cit).rest,numeric)&&
+            GINAC_ASSERT(!is_ex_exactly_of_type((*cit).rest,add));
+            GINAC_ASSERT(!(is_ex_exactly_of_type((*cit).rest,numeric)&&
                      (ex_to_numeric((*cit).coeff).compare(numONE())!=0)));
         }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
         return *this;
     }
 
@@ -296,13 +296,13 @@ ex add::eval(int level) const
         return (new add(evaled_seqp))->setflag(status_flags::dynallocated);
     }
 
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
-        ASSERT(!is_ex_exactly_of_type((*cit).rest,add));
-        ASSERT(!(is_ex_exactly_of_type((*cit).rest,numeric)&&
+        GINAC_ASSERT(!is_ex_exactly_of_type((*cit).rest,add));
+        GINAC_ASSERT(!(is_ex_exactly_of_type((*cit).rest,numeric)&&
                  (ex_to_numeric((*cit).coeff).compare(numONE())!=0)));
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
 
     if (flags & status_flags::evaluated) {
         return *this;
@@ -394,19 +394,19 @@ ex add::eval(int level) const
                    setflag(status_flags::dynallocated);
     }
 
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
-        ASSERT(!is_ex_exactly_of_type((*cit).rest,add));
+        GINAC_ASSERT(!is_ex_exactly_of_type((*cit).rest,add));
         if (is_ex_exactly_of_type((*cit).rest,numeric)) {
             dbgprint();
         }
-        ASSERT(!is_ex_exactly_of_type((*cit).rest,numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type((*cit).rest,numeric));
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
 
     if (flags & status_flags::evaluated) {
-        ASSERT(seq.size()>0);
-        ASSERT((seq.size()>1)||!overall_coeff.is_equal(exZERO()));
+        GINAC_ASSERT(seq.size()>0);
+        GINAC_ASSERT((seq.size()>1)||!overall_coeff.is_equal(exZERO()));
         return *this;
     }
 
@@ -483,7 +483,7 @@ expair add::split_ex_to_pair(ex const & e) const
 {
     if (is_ex_exactly_of_type(e,mul)) {
         mul const & mulref=ex_to_mul(e);
-        ASSERT(mulref.seq.size()>1);
+        GINAC_ASSERT(mulref.seq.size()>1);
         ex const & lastfactor_rest=(*(mulref.seq.end()-1)).rest;
         ex const & lastfactor_coeff=(*(mulref.seq.end()-1)).coeff;
         if (is_ex_exactly_of_type(lastfactor_rest,numeric) &&
@@ -528,10 +528,10 @@ expair add::split_ex_to_pair(ex const & e) const
 expair add::combine_ex_with_coeff_to_pair(ex const & e,
                                           ex const & c) const
 {
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
     if (is_ex_exactly_of_type(e,mul)) {
         mul const & mulref=ex_to_mul(e);
-        ASSERT(mulref.seq.size()>1);
+        GINAC_ASSERT(mulref.seq.size()>1);
         ex const & lastfactor_rest=(*(mulref.seq.end()-1)).rest;
         ex const & lastfactor_coeff=(*(mulref.seq.end()-1)).coeff;
         if (is_ex_exactly_of_type(lastfactor_rest,numeric) &&
@@ -566,7 +566,7 @@ expair add::combine_ex_with_coeff_to_pair(ex const & e,
 expair add::combine_ex_with_coeff_to_pair(ex const & e,
                                           ex const & c) const
 {
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
     if (is_ex_exactly_of_type(e,mul)) {
         mul const & mulref=ex_to_mul(e);
         ex numfactor=mulref.overall_coeff;
@@ -594,11 +594,11 @@ expair add::combine_ex_with_coeff_to_pair(ex const & e,
 expair add::combine_pair_with_coeff_to_pair(expair const & p,
                                             ex const & c) const
 {
-    ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
 
     if (is_ex_exactly_of_type(p.rest,numeric)) {
-        ASSERT(ex_to_numeric(p.coeff).is_equal(numONE())); // should be normalized
+        GINAC_ASSERT(ex_to_numeric(p.coeff).is_equal(numONE())); // should be normalized
         return expair(ex_to_numeric(p.rest).mul_dyn(ex_to_numeric(c)),exONE());
     }
 
index 39bb4f4..b208b84 100644 (file)
 
 #include <assert.h>
 
-#if defined(DO_GINAC_ASSERT) && !defined(ASSERT)
-#define ASSERT(X) assert(X)
+#if !defined(GINAC_ASSERT)
+#if defined(DO_GINAC_ASSERT)
+#define GINAC_ASSERT(X) assert(X)
 #else
-#define ASSERT(X) ((void)0)
+#define GINAC_ASSERT(X) ((void)0)
+#endif
 #endif
 
 #endif // ndef __GINAC_ASSERTION_H__
index 1c8814d..eb4a72e 100644 (file)
@@ -53,7 +53,7 @@ basic::~basic()
 {
     debugmsg("basic destructor",LOGLEVEL_DESTRUCT);
     destroy(0);
-    ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
+    GINAC_ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
 }
 
 basic::basic(basic const & other) : flags(0), refcount(0), tinfo_key(TINFO_BASIC)
@@ -149,7 +149,7 @@ ex basic::operator[](int const i) const
 
 bool basic::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (is_equal(*other.bp)) return true;
     if (nops()>0) {
         for (int i=0; i<nops(); i++) {
@@ -348,7 +348,7 @@ int basic::compare(basic const & other) const
         return 1;
     }
 
-    ASSERT(typeid(*this)==typeid(other));
+    GINAC_ASSERT(typeid(*this)==typeid(other));
 
     int cmpval=compare_same_type(other);
     if ((cmpval!=0)&&(hash_this<0x80000000U)) {
@@ -376,7 +376,7 @@ bool basic::is_equal(basic const & other) const
 
     if (typeid_this!=typeid_other) return false;
 
-    ASSERT(typeid(*this)==typeid(other));
+    GINAC_ASSERT(typeid(*this)==typeid(other));
 
     return is_equal_same_type(other);
 }
index ef4e8cf..a0e3f6e 100644 (file)
@@ -66,7 +66,7 @@ public:
 #ifdef INLINE_BASIC_CONSTRUCTORS
     {
         destroy(0);
-        ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
+        GINAC_ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
     }
 #else
 ;
index e60ced0..16f9a4d 100644 (file)
@@ -151,7 +151,7 @@ bool clifford::info(unsigned inf) const
 
 int clifford::compare_same_type(basic const & other) const
 {
-    ASSERT(other.tinfo() == TINFO_clifford);
+    GINAC_ASSERT(other.tinfo() == TINFO_clifford);
     const clifford *o = static_cast<const clifford *>(&other);
     if (serial==o->serial) {
         return indexed::compare_same_type(other);
index b59e4b4..095a3b0 100644 (file)
@@ -96,54 +96,54 @@ void color::destroy(bool call_parent)
 color::color(color_types const t, unsigned const rl) : type(t), representation_label(rl)
 {
     debugmsg("color constructor from color_types,unsigned",LOGLEVEL_CONSTRUCT);
-    ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
     tinfo_key=TINFO_color;
-    ASSERT(all_of_type_coloridx());
+    GINAC_ASSERT(all_of_type_coloridx());
 }
 
 color::color(color_types const t, ex const & i1, unsigned const rl)
     : indexed(i1), type(t), representation_label(rl)
 {
     debugmsg("color constructor from color_types,ex,unsigned",LOGLEVEL_CONSTRUCT);
-    ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
     tinfo_key=TINFO_color;
-    ASSERT(all_of_type_coloridx());
+    GINAC_ASSERT(all_of_type_coloridx());
 }
 
 color::color(color_types const t, ex const & i1, ex const & i2, unsigned const rl)
     : indexed(i1,i2), type(t), representation_label(rl)
 {
     debugmsg("color constructor from color_types,ex,ex,unsigned",LOGLEVEL_CONSTRUCT);
-    ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
     tinfo_key=TINFO_color;
-    ASSERT(all_of_type_coloridx());
+    GINAC_ASSERT(all_of_type_coloridx());
 }
 
 color::color(color_types const t, ex const & i1, ex const & i2, ex const & i3,
              unsigned const rl) : indexed(i1,i2,i3), type(t), representation_label(rl)
 {
     debugmsg("color constructor from color_types,ex,ex,ex,unsigned",LOGLEVEL_CONSTRUCT);
-    ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
     tinfo_key=TINFO_color;
-    ASSERT(all_of_type_coloridx());
+    GINAC_ASSERT(all_of_type_coloridx());
 }
 
 color::color(color_types const t, exvector const & iv, unsigned const rl)
     : indexed(iv), type(t), representation_label(rl)
 {
     debugmsg("color constructor from color_types,exvector,unsigned",LOGLEVEL_CONSTRUCT);
-    ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
     tinfo_key=TINFO_color;
-    ASSERT(all_of_type_coloridx());
+    GINAC_ASSERT(all_of_type_coloridx());
 }
 
 color::color(color_types const t, exvector * ivp, unsigned const rl)
     : indexed(ivp), type(t), representation_label(rl)
 {
     debugmsg("color constructor from color_types,exvector *,unsigned",LOGLEVEL_CONSTRUCT);
-    ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(representation_label<MAX_REPRESENTATION_LABELS);
     tinfo_key=TINFO_color;
-    ASSERT(all_of_type_coloridx());
+    GINAC_ASSERT(all_of_type_coloridx());
 }
 
 //////////
@@ -253,7 +253,7 @@ ex color::eval(int level) const
     switch (type) {
     case color_delta8:
         {
-            ASSERT(seq.size()==2);
+            GINAC_ASSERT(seq.size()==2);
             coloridx const & idx1=ex_to_coloridx(seq[0]);
             coloridx const & idx2=ex_to_coloridx(seq[1]);
             
@@ -275,7 +275,7 @@ ex color::eval(int level) const
     case color_d:
         // check for d_{a,a,c} (=0) when a is symbolic
         {
-            ASSERT(seq.size()==3);
+            GINAC_ASSERT(seq.size()==3);
             coloridx const & idx1=ex_to_coloridx(seq[0]);
             coloridx const & idx2=ex_to_coloridx(seq[1]);
             coloridx const & idx3=ex_to_coloridx(seq[2]);
@@ -288,8 +288,8 @@ ex color::eval(int level) const
             
             // check for three numeric indices
             if (!(idx1.is_symbolic()||idx2.is_symbolic()||idx3.is_symbolic())) {
-                ASSERT(idx1.get_value()<=idx2.get_value());
-                ASSERT(idx2.get_value()<=idx3.get_value());
+                GINAC_ASSERT(idx1.get_value()<=idx2.get_value());
+                GINAC_ASSERT(idx2.get_value()<=idx3.get_value());
                 if (CMPINDICES(1,4,6)||CMPINDICES(1,5,7)||CMPINDICES(2,5,6)||
                     CMPINDICES(3,4,4)||CMPINDICES(3,5,5)) {
                     return exHALF();
@@ -308,15 +308,15 @@ ex color::eval(int level) const
         break;
     case color_f:
         {
-            ASSERT(seq.size()==3);
+            GINAC_ASSERT(seq.size()==3);
             coloridx const & idx1=ex_to_coloridx(seq[0]);
             coloridx const & idx2=ex_to_coloridx(seq[1]);
             coloridx const & idx3=ex_to_coloridx(seq[2]);
             
             // check for three numeric indices
             if (!(idx1.is_symbolic()||idx2.is_symbolic()||idx3.is_symbolic())) {
-                ASSERT(idx1.get_value()<=idx2.get_value());
-                ASSERT(idx2.get_value()<=idx3.get_value());
+                GINAC_ASSERT(idx1.get_value()<=idx2.get_value());
+                GINAC_ASSERT(idx2.get_value()<=idx3.get_value());
                 if (CMPINDICES(1,2,3)) {
                     return exONE();
                 } else if (CMPINDICES(1,4,7)||CMPINDICES(2,4,6)||
@@ -347,7 +347,7 @@ ex color::eval(int level) const
 
 int color::compare_same_type(basic const & other) const
 {
-    ASSERT(other.tinfo() == TINFO_color);
+    GINAC_ASSERT(other.tinfo() == TINFO_color);
     const color *o = static_cast<const color *>(&other);
     if (type==o->type) {
         if (representation_label==o->representation_label) {
@@ -360,7 +360,7 @@ int color::compare_same_type(basic const & other) const
 
 bool color::is_equal_same_type(basic const & other) const
 {
-    ASSERT(other.tinfo() == TINFO_color);
+    GINAC_ASSERT(other.tinfo() == TINFO_color);
     const color *o = static_cast<const color *>(&other);
     if (type!=o->type) return false;
     if (representation_label!=o->representation_label) return false;
@@ -386,11 +386,11 @@ ex color::simplify_ncmul(exvector const & v) const
         // process only delta8 objects
         if (is_ex_exactly_of_type(*it,color) && (ex_to_color(*it).type==color_delta8)) {
             color & d8=ex_to_nonconst_color(*it);
-            ASSERT(d8.seq.size()==2);
+            GINAC_ASSERT(d8.seq.size()==2);
             coloridx const & first_idx=ex_to_coloridx(d8.seq[0]);
             coloridx const & second_idx=ex_to_coloridx(d8.seq[1]);
             // delta8_{a,a} should have been contracted in color::eval()
-            ASSERT((!first_idx.is_equal(second_idx))||(!first_idx.is_symbolic()));
+            GINAC_ASSERT((!first_idx.is_equal(second_idx))||(!first_idx.is_symbolic()));
             ex saved_delta8=*it; // save to restore it later
 
             // try to contract first index
@@ -402,7 +402,7 @@ ex color::simplify_ncmul(exvector const & v) const
                     *it=saved_delta8;
                 } else {
                     // a contracted index should occur exactly twice
-                    ASSERT(replacements==2);
+                    GINAC_ASSERT(replacements==2);
                     *it=exONE();
                     something_changed=true;
                 }
@@ -417,7 +417,7 @@ ex color::simplify_ncmul(exvector const & v) const
                     *it=saved_delta8;
                 } else {
                     // a contracted index should occur exactly twice
-                    ASSERT(replacements==2);
+                    GINAC_ASSERT(replacements==2);
                     *it=exONE();
                     something_changed=true;
                 }
@@ -450,8 +450,8 @@ ex color::simplify_ncmul(exvector const & v) const
     if ((dvec.size()>=1)&&(fvec.size()>=1)) {
         for (exvector::iterator it1=dvec.begin(); it1!=dvec.end(); ++it1) {
             for (exvector::iterator it2=fvec.begin(); it2!=fvec.end(); ++it2) {
-                ASSERT(is_ex_exactly_of_type(*it1,color));
-                ASSERT(is_ex_exactly_of_type(*it2,color));
+                GINAC_ASSERT(is_ex_exactly_of_type(*it1,color));
+                GINAC_ASSERT(is_ex_exactly_of_type(*it2,color));
                 color const & col1=ex_to_color(*it1);
                 color const & col2=ex_to_color(*it2);
                 exvector iv_intersect=idx_intersect(col1.seq,col2.seq);
@@ -464,8 +464,8 @@ ex color::simplify_ncmul(exvector const & v) const
     if (dvec.size()>=2) {
         for (exvector::iterator it1=dvec.begin(); it1!=dvec.end()-1; ++it1) {
             for (exvector::iterator it2=it1+1; it2!=dvec.end(); ++it2) {
-                ASSERT(is_ex_exactly_of_type(*it1,color));
-                ASSERT(is_ex_exactly_of_type(*it2,color));
+                GINAC_ASSERT(is_ex_exactly_of_type(*it1,color));
+                GINAC_ASSERT(is_ex_exactly_of_type(*it2,color));
                 color const & col1=ex_to_color(*it1);
                 color const & col2=ex_to_color(*it2);
                 exvector iv_intersect=idx_intersect(col1.seq,col2.seq);
@@ -491,8 +491,8 @@ ex color::simplify_ncmul(exvector const & v) const
     if (fvec.size()>=2) {
         for (exvector::iterator it1=fvec.begin(); it1!=fvec.end()-1; ++it1) {
             for (exvector::iterator it2=it1+1; it2!=fvec.end(); ++it2) {
-                ASSERT(is_ex_exactly_of_type(*it1,color));
-                ASSERT(is_ex_exactly_of_type(*it2,color));
+                GINAC_ASSERT(is_ex_exactly_of_type(*it1,color));
+                GINAC_ASSERT(is_ex_exactly_of_type(*it2,color));
                 color const & col1=ex_to_color(*it1);
                 color const & col2=ex_to_color(*it2);
                 exvector iv_intersect=idx_intersect(col1.seq,col2.seq);
@@ -520,14 +520,14 @@ ex color::simplify_ncmul(exvector const & v) const
         if ((Tvecs[rl].size()>=2)&&((dvec.size()>=1)||(fvec.size()>=1))) {
             for (exvector::iterator it1=Tvecs[rl].begin(); it1!=Tvecs[rl].end()-1; ++it1) {
                 exvector iv;
-                ASSERT(is_ex_exactly_of_type(*it1,color)&&ex_to_color(*it1).type==color_T);
-                ASSERT(is_ex_exactly_of_type(*(it1+1),color)&&ex_to_color(*(it1+1)).type==color_T);
+                GINAC_ASSERT(is_ex_exactly_of_type(*it1,color)&&ex_to_color(*it1).type==color_T);
+                GINAC_ASSERT(is_ex_exactly_of_type(*(it1+1),color)&&ex_to_color(*(it1+1)).type==color_T);
                 iv.push_back(ex_to_color(*it1).seq[0]);
                 iv.push_back(ex_to_color(*(it1+1)).seq[0]);
                 
                 // d_{a,b,c} T_b T_c = 5/6 T_a
                 for (exvector::iterator it2=dvec.begin(); it2!=dvec.end(); ++it2) {
-                    ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_d);
+                    GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_d);
                     color const & dref=ex_to_color(*it2);
                     exvector iv_intersect=idx_intersect(dref.seq,iv);
                     if (iv_intersect.size()==2) {
@@ -543,7 +543,7 @@ ex color::simplify_ncmul(exvector const & v) const
 
                 // f_{a,b,c} T_b T_c = 3/2 I T_a
                 for (exvector::iterator it2=fvec.begin(); it2!=fvec.end(); ++it2) {
-                    ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_f);
+                    GINAC_ASSERT(is_ex_exactly_of_type(*it2,color)&&ex_to_color(*it2).type==color_f);
                     color const & fref=ex_to_color(*it2);
                     exvector iv_intersect=idx_intersect(fref.seq,iv);
                     if (iv_intersect.size()==2) {
@@ -681,7 +681,7 @@ void split_color_string_in_parts(exvector const & v, exvector & delta8vec,
                 dvec.push_back(*cit);
                 break;
             case color::color_T:
-                ASSERT(ex_to_color(*cit).representation_label<MAX_REPRESENTATION_LABELS);
+                GINAC_ASSERT(ex_to_color(*cit).representation_label<MAX_REPRESENTATION_LABELS);
                 if (all_color) {
                     Tvecs[ex_to_color(*cit).representation_label].push_back(*cit);
                 } else {
@@ -689,7 +689,7 @@ void split_color_string_in_parts(exvector const & v, exvector & delta8vec,
                 }
                 break;
             case color::color_ONE:
-                ASSERT(ex_to_color(*cit).representation_label<MAX_REPRESENTATION_LABELS);
+                GINAC_ASSERT(ex_to_color(*cit).representation_label<MAX_REPRESENTATION_LABELS);
                 ONEvecs[ex_to_color(*cit).representation_label].push_back(*cit);
                 break;
             default:
@@ -729,17 +729,17 @@ ex color_trace_of_one_representation_label(exvector const & v)
     if (v.size()==0) {
         return numeric(COLOR_THREE);
     } else if (v.size()==1) {
-        ASSERT(is_ex_exactly_of_type(*(v.begin()),color));
+        GINAC_ASSERT(is_ex_exactly_of_type(*(v.begin()),color));
         return exZERO();
     }
     exvector v1=v;
     ex last_element=v1.back();
-    ASSERT(is_ex_exactly_of_type(last_element,color));
-    ASSERT(ex_to_color(last_element).type==color::color_T);
+    GINAC_ASSERT(is_ex_exactly_of_type(last_element,color));
+    GINAC_ASSERT(ex_to_color(last_element).type==color::color_T);
     v1.pop_back();
     ex next_to_last_element=v1.back();
-    ASSERT(is_ex_exactly_of_type(next_to_last_element,color));
-    ASSERT(ex_to_color(next_to_last_element).type==color::color_T);
+    GINAC_ASSERT(is_ex_exactly_of_type(next_to_last_element,color));
+    GINAC_ASSERT(ex_to_color(next_to_last_element).type==color::color_T);
     v1.pop_back();
     exvector v2=v1;
 
@@ -767,7 +767,7 @@ ex color_trace_of_one_representation_label(exvector const & v)
 
 ex color_trace(exvector const & v, unsigned const rl)
 {
-    ASSERT(rl<MAX_REPRESENTATION_LABELS);
+    GINAC_ASSERT(rl<MAX_REPRESENTATION_LABELS);
     
     exvector v_rest;
     v_rest.reserve(v.size()+1); // max size if trace is empty
@@ -810,7 +810,7 @@ ex color_trace(exvector const & v, unsigned const rl)
 
 ex simplify_pure_color_string(ex const & e)
 {
-    ASSERT(is_ex_exactly_of_type(e,ncmul));
+    GINAC_ASSERT(is_ex_exactly_of_type(e,ncmul));
 
     exvector delta8vec;
     exvector fvec;
@@ -830,10 +830,10 @@ ex simplify_pure_color_string(ex const & e)
                 for (unsigned j=i+1; j<Tvecs[rl].size(); ++j) {
                     ex & t1=Tvecs[rl][i];
                     ex & t2=Tvecs[rl][j];
-                    ASSERT(is_ex_exactly_of_type(t1,color)&&
+                    GINAC_ASSERT(is_ex_exactly_of_type(t1,color)&&
                            (ex_to_color(t1).type==color::color_T)&&
                            (ex_to_color(t1).seq.size()==1));
-                    ASSERT(is_ex_exactly_of_type(t2,color)&&
+                    GINAC_ASSERT(is_ex_exactly_of_type(t2,color)&&
                            (ex_to_color(t2).type==color::color_T)&&
                            (ex_to_color(t2).seq.size()==1));
                     coloridx const & idx1=ex_to_coloridx(ex_to_color(t1).seq[0]);
@@ -915,9 +915,9 @@ ex brute_force_sum_color_indices(ex const & e)
     // find double symbolic indices
     if (iv_all.size()<2) return e;
     for (exvector::const_iterator cit1=iv_all.begin(); cit1!=iv_all.end()-1; ++cit1) {
-        ASSERT(is_ex_of_type(*cit1,coloridx));
+        GINAC_ASSERT(is_ex_of_type(*cit1,coloridx));
         for (exvector::const_iterator cit2=cit1+1; cit2!=iv_all.end(); ++cit2) {
-            ASSERT(is_ex_of_type(*cit2,coloridx));
+            GINAC_ASSERT(is_ex_of_type(*cit2,coloridx));
             if (ex_to_coloridx(*cit1).is_symbolic() && 
                 ex_to_coloridx(*cit1).is_equal(ex_to_coloridx(*cit2))) {
                 iv_double.push_back(*cit1);
index 30ccb88..f21c05e 100644 (file)
@@ -117,7 +117,7 @@ ex constant::evalf(int level) const
 
 int constant::compare_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other, constant));
+    GINAC_ASSERT(is_exactly_of_type(other, constant));
     // constant const & o=static_cast<constant &>(const_cast<basic &>(other));
     // return name.compare(o.name);
     const constant *o = static_cast<const constant *>(&other);
@@ -127,7 +127,7 @@ int constant::compare_same_type(basic const & other) const
 
 bool constant::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other, constant));
+    GINAC_ASSERT(is_exactly_of_type(other, constant));
     const constant *o = static_cast<const constant *>(&other);
     return serial==o->serial;
 }
index 7a7b3e9..798d686 100755 (executable)
@@ -72,8 +72,8 @@ if ($let_op) {
     $LET_OP_IMPLEMENTATION=<<END_OF_LET_OP_IMPLEMENTATION
 ex & ${CONTAINER}::let_op(int const i)
 {
-    ASSERT(i>=0);
-    ASSERT(i<nops());
+    GINAC_ASSERT(i>=0);
+    GINAC_ASSERT(i<nops());
 
     ${STLT}::iterator it=seq.begin();
     for (int j=0; j<i; j++) {
@@ -340,7 +340,7 @@ ${CONTAINER}::${CONTAINER}(${STLT} const & s, bool discardable) :  basic(TINFO_$
 ${CONTAINER}::${CONTAINER}(${STLT} * vp) : basic(TINFO_${CONTAINER})
 {
     debugmsg("${CONTAINER} constructor from ${STLT} *",LOGLEVEL_CONSTRUCT);
-    ASSERT(vp!=0);
+    GINAC_ASSERT(vp!=0);
     seq.swap(*vp);
     delete vp;
 }
@@ -555,7 +555,7 @@ ex ${CONTAINER}::expand(unsigned options) const
 
 bool ${CONTAINER}::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (is_equal(*other.bp)) return true;
     for (${STLT}::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
         if ((*it).has(other)) return true;
@@ -603,7 +603,7 @@ ex ${CONTAINER}::subs(lst const & ls, lst const & lr) const
 
 int ${CONTAINER}::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,${CONTAINER}));
+    GINAC_ASSERT(is_of_type(other,${CONTAINER}));
     ${CONTAINER} const & o=static_cast<${CONTAINER} const &>
                                     (const_cast<basic &>(other));
     int cmpval;
@@ -624,7 +624,7 @@ int ${CONTAINER}::compare_same_type(basic const & other) const
 
 bool ${CONTAINER}::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,${CONTAINER}));
+    GINAC_ASSERT(is_of_type(other,${CONTAINER}));
     ${CONTAINER} const & o=static_cast<${CONTAINER} const &>
                                     (const_cast<basic &>(other));
     if (seq.size()!=o.seq.size()) return false;
index 24d0f7e..d7a7766 100644 (file)
@@ -27,7 +27,7 @@
 
 #ifdef _DEBUG
 #define VERBOSE
-#define DOASSERT (VERBOSE||DEBUG)
+#define DO_GINAC_ASSERT (VERBOSE||DEBUG)
 #endif
 
 #define LOGLEVEL_CONSTRUCT          0x0001
index 167d493..7b4d489 100644 (file)
@@ -226,7 +226,7 @@ ex series::diff(symbol const & s) const
 
 ex ex::diff(symbol const & s, unsigned nth) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
 
     if ( nth==0 ) {
         return *this;
index e036af5..a5a2445 100644 (file)
@@ -43,17 +43,17 @@ namespace GiNaC {
 ex::ex() : bp(exZERO().bp)
 {
     debugmsg("ex default constructor",LOGLEVEL_CONSTRUCT);
-    ASSERT(exZERO().bp!=0);
-    ASSERT(exZERO().bp->flags & status_flags::dynallocated);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(exZERO().bp!=0);
+    GINAC_ASSERT(exZERO().bp->flags & status_flags::dynallocated);
+    GINAC_ASSERT(bp!=0);
     ++bp->refcount;
 }
 
 ex::~ex()
 {
     debugmsg("ex destructor",LOGLEVEL_DESTRUCT);
-    ASSERT(bp!=0);
-    ASSERT(bp->flags & status_flags::dynallocated);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT(bp->flags & status_flags::dynallocated);
     if (--bp->refcount == 0) {
         delete bp;
     }
@@ -62,18 +62,18 @@ ex::~ex()
 ex::ex(ex const & other) : bp(other.bp)
 {
     debugmsg("ex copy constructor",LOGLEVEL_CONSTRUCT);
-    ASSERT(bp!=0);
-    ASSERT((bp->flags) & status_flags::dynallocated);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT((bp->flags) & status_flags::dynallocated);
     ++bp->refcount;
 }
 
 ex const & ex::operator=(ex const & other)
 {
     debugmsg("ex operator=",LOGLEVEL_ASSIGNMENT);
-    ASSERT(bp!=0);
-    ASSERT(bp->flags & status_flags::dynallocated);
-    ASSERT(other.bp!=0);
-    ASSERT(other.bp->flags & status_flags::dynallocated);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+    GINAC_ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp->flags & status_flags::dynallocated);
     ++other.bp->refcount;
     basic * tmpbp=other.bp;
     if (--bp->refcount==0) {
@@ -151,10 +151,10 @@ void ex::swap(ex & other)
 {
     debugmsg("ex swap",LOGLEVEL_MEMBER_FUNCTION);
 
-    ASSERT(bp!=0);
-    ASSERT(bp->flags & status_flags::dynallocated);
-    ASSERT(other.bp!=0);
-    ASSERT(other.bp->flags & status_flags::dynallocated);
+    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;
@@ -194,37 +194,37 @@ bool ex::info(unsigned inf) const
 
 int ex::nops() const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->nops();
 }
 
 ex ex::expand(unsigned options) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->expand(options);
 }
 
 bool ex::has(ex const & other) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->has(other);
 }
 
 int ex::degree(symbol const & s) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->degree(s);
 }
 
 int ex::ldegree(symbol const & s) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->ldegree(s);
 }
 
 ex ex::coeff(symbol const & s, int const n) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->coeff(s,n);
 }
 
@@ -284,64 +284,64 @@ ex ex::denom(bool normalize) const
 
 ex ex::collect(symbol const & s) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->collect(s);
 }
 
 ex ex::eval(int level) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->eval(level);
 }
 
 ex ex::evalf(int level) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->evalf(level);
 }
 
 ex ex::subs(lst const & ls, lst const & lr) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->subs(ls,lr);
 }
 
 ex ex::subs(ex const & e) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->subs(e);
 }
 
 exvector ex::get_indices(void) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->get_indices();
 }
 
 ex ex::simplify_ncmul(exvector const & v) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->simplify_ncmul(v);
 }
 
 ex ex::operator[](ex const & index) const
 {
     debugmsg("ex operator[ex]",LOGLEVEL_OPERATOR);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return (*bp)[index];
 }
 
 ex ex::operator[](int const i) const
 {
     debugmsg("ex operator[int]",LOGLEVEL_OPERATOR);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return (*bp)[i];
 }
 
 ex ex::op(int const i) const
 {
     debugmsg("ex op()",LOGLEVEL_MEMBER_FUNCTION);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->op(i);
 }
 
@@ -349,15 +349,15 @@ ex & ex::let_op(int const i)
 {
     debugmsg("ex let_op()",LOGLEVEL_MEMBER_FUNCTION);
     makewriteable();
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->let_op(i);
 }
 
 #ifndef INLINE_EX_CONSTRUCTORS
 int ex::compare(ex const & other) const
 {
-    ASSERT(bp!=0);
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (bp==other.bp) {
         // special case: both expression point to same basic, trivially equal
         return 0; 
@@ -369,8 +369,8 @@ int ex::compare(ex const & other) const
 #ifndef INLINE_EX_CONSTRUCTORS
 bool ex::is_equal(ex const & other) const
 {
-    ASSERT(bp!=0);
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (bp==other.bp) {
         // special case: both expression point to same basic, trivially equal
         return true; 
@@ -381,19 +381,19 @@ bool ex::is_equal(ex const & other) const
 
 unsigned ex::return_type(void) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->return_type();
 }
 
 unsigned ex::return_type_tinfo(void) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->return_type_tinfo();
 }
 
 unsigned ex::gethash(void) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->gethash();
 }
 
@@ -417,8 +417,8 @@ ex ex::exncmul(ex const & rh) const
 void ex::makewriteable()
 {
     debugmsg("ex makewriteable",LOGLEVEL_MEMBER_FUNCTION);
-    ASSERT(bp!=0);
-    ASSERT(bp->flags & status_flags::dynallocated);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT(bp->flags & status_flags::dynallocated);
     if (bp->refcount > 1) {
         basic * bp2=bp->duplicate();
         ++bp2->refcount;
@@ -426,7 +426,7 @@ void ex::makewriteable()
         --bp->refcount;
         bp=bp2;
     }
-    ASSERT(bp->refcount == 1);
+    GINAC_ASSERT(bp->refcount == 1);
 }    
 
 void ex::construct_from_basic(basic const & other)
@@ -435,8 +435,8 @@ void ex::construct_from_basic(basic const & other)
         // cf. copy constructor
         ex const & tmpex = other.eval(1); // evaluate only one (top) level
         bp = tmpex.bp;
-        ASSERT(bp!=0);
-        ASSERT(bp->flags & status_flags::dynallocated);
+        GINAC_ASSERT(bp!=0);
+        GINAC_ASSERT(bp->flags & status_flags::dynallocated);
         ++bp->refcount;
         if ((other.flags & status_flags::dynallocated)&&(other.refcount==0)) {
             delete &const_cast<basic &>(other);
@@ -448,12 +448,12 @@ void ex::construct_from_basic(basic const & other)
             bp=other.duplicate();
             bp->setflag(status_flags::dynallocated);
         }
-        ASSERT(bp!=0);
+        GINAC_ASSERT(bp!=0);
         // bp->clearflag(status_flags::evaluated);
         ++bp->refcount;
     }
-    ASSERT(bp!=0);
-    ASSERT(bp->flags & status_flags::dynallocated);
+    GINAC_ASSERT(bp!=0);
+    GINAC_ASSERT(bp->flags & status_flags::dynallocated);
 }
 
 //////////
index 0de91a1..a2517a5 100644 (file)
@@ -65,9 +65,9 @@ public:
 #ifdef INLINE_EX_CONSTRUCTORS
     : bp(exZERO().bp)
         {
-            ASSERT(exZERO().bp!=0);
-            ASSERT(exZERO().bp->flags & status_flags::dynallocated);
-            ASSERT(bp!=0);
+            GINAC_ASSERT(exZERO().bp!=0);
+            GINAC_ASSERT(exZERO().bp->flags & status_flags::dynallocated);
+            GINAC_ASSERT(bp!=0);
             ++bp->refcount;
         }
 #else
@@ -77,8 +77,8 @@ public:
     ~ex()
 #ifdef INLINE_EX_CONSTRUCTORS
         {
-            ASSERT(bp!=0);
-            ASSERT(bp->flags & status_flags::dynallocated);
+            GINAC_ASSERT(bp!=0);
+            GINAC_ASSERT(bp->flags & status_flags::dynallocated);
             if (--bp->refcount == 0) {
                 delete bp;
             }
@@ -91,8 +91,8 @@ public:
 #ifdef INLINE_EX_CONSTRUCTORS
     : bp(other.bp)
         {
-            ASSERT(bp!=0);
-            ASSERT((bp->flags) & status_flags::dynallocated);
+            GINAC_ASSERT(bp!=0);
+            GINAC_ASSERT((bp->flags) & status_flags::dynallocated);
             ++bp->refcount;
         }
 #else
@@ -102,10 +102,10 @@ public:
     ex const & operator=(ex const & other)
 #ifdef INLINE_EX_CONSTRUCTORS
         {
-            ASSERT(bp!=0);
-            ASSERT(bp->flags & status_flags::dynallocated);
-            ASSERT(other.bp!=0);
-            ASSERT(other.bp->flags & status_flags::dynallocated);
+            GINAC_ASSERT(bp!=0);
+            GINAC_ASSERT(bp->flags & status_flags::dynallocated);
+            GINAC_ASSERT(other.bp!=0);
+            GINAC_ASSERT(other.bp->flags & status_flags::dynallocated);
             ++other.bp->refcount;
             basic * tmpbp=other.bp;
             if (--bp->refcount==0) {
@@ -185,8 +185,8 @@ public:
     int compare(ex const & other) const
 #ifdef INLINE_EX_CONSTRUCTORS
         {
-            ASSERT(bp!=0);
-            ASSERT(other.bp!=0);
+            GINAC_ASSERT(bp!=0);
+            GINAC_ASSERT(other.bp!=0);
             if (bp==other.bp) {
                 // special case: both expression point to same basic, trivially equal
                 return 0; 
@@ -199,8 +199,8 @@ public:
     bool is_equal(ex const & other) const
 #ifdef INLINE_EX_CONSTRUCTORS
         {
-            ASSERT(bp!=0);
-            ASSERT(other.bp!=0);
+            GINAC_ASSERT(bp!=0);
+            GINAC_ASSERT(other.bp!=0);
             if (bp==other.bp) {
                 // special case: both expression point to same basic, trivially equal
                 return true; 
index 0a98677..320de73 100644 (file)
@@ -38,7 +38,7 @@ public:
     ~expair() {}
     expair(expair const & other) : rest(other.rest), coeff(other.coeff)
     {
-        ASSERT(is_ex_exactly_of_type(coeff,numeric));
+        GINAC_ASSERT(is_ex_exactly_of_type(coeff,numeric));
     }
     expair const & operator=(expair const & other)
     {
@@ -50,12 +50,12 @@ public:
     }
     expair(ex const & r, ex const & c) : rest(r), coeff(c)
     {
-        ASSERT(is_ex_exactly_of_type(coeff,numeric));
+        GINAC_ASSERT(is_ex_exactly_of_type(coeff,numeric));
     }
     
     bool is_numeric_with_coeff_1(void) const
     {
-        ASSERT(is_ex_exactly_of_type(coeff,numeric));
+        GINAC_ASSERT(is_ex_exactly_of_type(coeff,numeric));
         return is_ex_exactly_of_type(rest,numeric) &&
                (ex_to_numeric(coeff).compare(numONE())==0);
     }
index 05b7233..360c7b9 100644 (file)
@@ -105,14 +105,14 @@ expairseq::expairseq(ex const & lh, ex const & rh) : basic(TINFO_expairseq)
 {
     debugmsg("expairseq constructor from ex,ex",LOGLEVEL_CONSTRUCT);
     construct_from_2_ex(lh,rh);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 expairseq::expairseq(exvector const & v) : basic(TINFO_expairseq)
 {
     debugmsg("expairseq constructor from exvector",LOGLEVEL_CONSTRUCT);
     construct_from_exvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 /*
@@ -128,7 +128,7 @@ expairseq::expairseq(epvector const & v, bool do_not_canonicalize) :
     } else {
         construct_from_epvector(v);
     }
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 */
 
@@ -137,17 +137,17 @@ expairseq::expairseq(epvector const & v, ex const & oc) :
 {
     debugmsg("expairseq constructor from epvector,ex",LOGLEVEL_CONSTRUCT);
     construct_from_epvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 expairseq::expairseq(epvector * vp, ex const & oc) :
     basic(TINFO_expairseq), overall_coeff(oc)
 {
     debugmsg("expairseq constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
-    ASSERT(vp!=0);
+    GINAC_ASSERT(vp!=0);
     construct_from_epvector(*vp);
     delete vp;
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 //////////
@@ -180,7 +180,7 @@ ex expairseq::op(int const i) const
     if (unsigned(i)<seq.size()) {
         return recombine_pair_to_ex(seq[i]);
     }
-    ASSERT(!overall_coeff.is_equal(default_overall_coeff()));
+    GINAC_ASSERT(!overall_coeff.is_equal(default_overall_coeff()));
     return overall_coeff;
 }
 
@@ -229,7 +229,7 @@ ex expairseq::subs(lst const & ls, lst const & lr) const
 
 int expairseq::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, expairseq));
+    GINAC_ASSERT(is_of_type(other, expairseq));
     expairseq const & o=static_cast<expairseq const &>(const_cast<basic &>(other));
 
     int cmpval;
@@ -246,7 +246,7 @@ int expairseq::compare_same_type(basic const & other) const
     //if (seq.size()==0) return 0; // empty expairseq's are equal
 
 #ifdef EXPAIRSEQ_USE_HASHTAB
-    ASSERT(hashtabsize==o.hashtabsize);
+    GINAC_ASSERT(hashtabsize==o.hashtabsize);
     if (hashtabsize==0) {
 #endif // def EXPAIRSEQ_USE_HASHTAB
         epvector::const_iterator cit1=seq.begin();
@@ -259,8 +259,8 @@ int expairseq::compare_same_type(basic const & other) const
             if (cmpval!=0) return cmpval;
         }
 
-        ASSERT(cit1==last1);
-        ASSERT(cit2==last2);
+        GINAC_ASSERT(cit1==last1);
+        GINAC_ASSERT(cit2==last2);
         
         return 0;
 #ifdef EXPAIRSEQ_USE_HASHTAB
@@ -314,7 +314,7 @@ bool expairseq::is_equal_same_type(basic const & other) const
         other.printtree(cout,0);
     }
         
-    ASSERT(hashtabsize==o.hashtabsize);
+    GINAC_ASSERT(hashtabsize==o.hashtabsize);
     
     if (hashtabsize==0) {
 #endif // def EXPAIRSEQ_USE_HASHTAB
@@ -417,7 +417,7 @@ expair expairseq::split_ex_to_pair(ex const & e) const
 expair expairseq::combine_ex_with_coeff_to_pair(ex const & e,
                                                 ex const & c) const
 {
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
 
     return expair(e,c);
 }
@@ -425,8 +425,8 @@ expair expairseq::combine_ex_with_coeff_to_pair(ex const & e,
 expair expairseq::combine_pair_with_coeff_to_pair(expair const & p,
                                                   ex const & c) const
 {
-    ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
     
     return expair(p.rest,ex_to_numeric(p.coeff).mul_dyn(ex_to_numeric(c)));
 }
@@ -448,16 +448,16 @@ ex expairseq::default_overall_coeff(void) const
 
 void expairseq::combine_overall_coeff(ex const & c)
 {
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
     overall_coeff = ex_to_numeric(overall_coeff).add_dyn(ex_to_numeric(c));
 }
 
 void expairseq::combine_overall_coeff(ex const & c1, ex const & c2)
 {
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    ASSERT(is_ex_exactly_of_type(c1,numeric));
-    ASSERT(is_ex_exactly_of_type(c2,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c1,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c2,numeric));
     overall_coeff = ex_to_numeric(overall_coeff).
                         add_dyn(ex_to_numeric(c1).mul(ex_to_numeric(c2)));
 }
@@ -480,8 +480,8 @@ void expairseq::construct_from_2_ex_via_exvector(ex const & lh, ex const & rh)
     v.push_back(rh);
     construct_from_exvector(v);
 #ifdef EXPAIRSEQ_USE_HASHTAB
-    ASSERT((hashtabsize==0)||(hashtabsize>=minhashtabsize));
-    ASSERT(hashtabsize==calc_hashtabsize(seq.size()));
+    GINAC_ASSERT((hashtabsize==0)||(hashtabsize>=minhashtabsize));
+    GINAC_ASSERT(hashtabsize==calc_hashtabsize(seq.size()));
 #endif // def EXPAIRSEQ_USE_HASHTAB
 }
 
@@ -1008,9 +1008,9 @@ unsigned expairseq::calc_hashtabsize(unsigned sz) const
     //  size=nearest_power_of_2*hashtabfactor;
     size=nearest_power_of_2/hashtabfactor;
     if (size<minhashtabsize) return 0;
-    ASSERT(hashtabsize<=0x8000000U); // really max size due to 31 bit hashing
+    GINAC_ASSERT(hashtabsize<=0x8000000U); // really max size due to 31 bit hashing
     // hashtabsize must be a power of 2
-    ASSERT((1U << log2(size))==size);
+    GINAC_ASSERT((1U << log2(size))==size);
     return size;
 }
 
@@ -1026,8 +1026,8 @@ unsigned expairseq::calc_hashindex(ex const & e) const
         // last hashtab entry is reserved for numerics
         if (hashindex==hashmask) hashindex=0;
     }
-    ASSERT(hashindex>=0);
-    ASSERT((hashindex<hashtabsize)||(hashtabsize==0));
+    GINAC_ASSERT(hashindex>=0);
+    GINAC_ASSERT((hashindex<hashtabsize)||(hashtabsize==0));
     return hashindex;
 }
 
@@ -1035,7 +1035,7 @@ void expairseq::shrink_hashtab(void)
 {
     unsigned new_hashtabsize;
     while (hashtabsize!=(new_hashtabsize=calc_hashtabsize(seq.size()))) {
-        ASSERT(new_hashtabsize<hashtabsize);
+        GINAC_ASSERT(new_hashtabsize<hashtabsize);
         if (new_hashtabsize==0) {
             hashtab.clear();
             hashtabsize=0;
@@ -1093,15 +1093,15 @@ void expairseq::remove_hashtab_entry(epvector::const_iterator element)
             }
             ++epplit;
         }
-        ASSERT(erased);
+        GINAC_ASSERT(erased);
     }
-    ASSERT(erased);
+    GINAC_ASSERT(erased);
 }
 
 void expairseq::move_hashtab_entry(epvector::const_iterator oldpos,
                                    epvector::iterator newpos)
 {
-    ASSERT(hashtabsize!=0);
+    GINAC_ASSERT(hashtabsize!=0);
     
     // calculate hashindex of element which was moved
     unsigned hashindex=calc_hashindex((*newpos).rest);
@@ -1116,7 +1116,7 @@ void expairseq::move_hashtab_entry(epvector::const_iterator oldpos,
         }
         ++epplit;
     }
-    ASSERT(epplit!=eppl.end());
+    GINAC_ASSERT(epplit!=eppl.end());
 }
 
 void expairseq::sorted_insert(epplist & eppl, epp elem)
@@ -1222,7 +1222,7 @@ void expairseq::drop_coeff_0_terms(epvector::iterator & first_numeric,
             }
         }
     }
-    ASSERT(i==current-seq.begin());
+    GINAC_ASSERT(i==current-seq.begin());
 }
 
 bool expairseq::has_coeff_0(void) const
@@ -1265,7 +1265,7 @@ void expairseq::combine_same_terms(void)
     if (hashtabsize==0) {
         canonicalize();
         combine_same_terms_sorted_seq();
-        ASSERT(!has_coeff_0());
+        GINAC_ASSERT(!has_coeff_0());
         return;
     }
 
@@ -1280,7 +1280,7 @@ void expairseq::combine_same_terms(void)
 
     unsigned number_of_zeroes=0;
 
-    ASSERT(!has_coeff_0());
+    GINAC_ASSERT(!has_coeff_0());
     build_hashtab_and_combine(first_numeric,last_non_zero,touched,number_of_zeroes);
     /*
     cout << "in combine:" << endl;
@@ -1319,11 +1319,11 @@ void expairseq::combine_same_terms(void)
     }
 
     // shrink hashtabsize to calculated value
-    ASSERT(!has_coeff_0());
+    GINAC_ASSERT(!has_coeff_0());
 
     shrink_hashtab();
 
-    ASSERT(!has_coeff_0());
+    GINAC_ASSERT(!has_coeff_0());
 }
 
 #endif // def EXPAIRSEQ_USE_HASHTAB
index e8d6406..2ba3370 100644 (file)
@@ -108,7 +108,7 @@ exprseq::exprseq(exvector const & s, bool discardable) :  basic(TINFO_exprseq)
 exprseq::exprseq(exvector * vp) : basic(TINFO_exprseq)
 {
     debugmsg("exprseq constructor from exvector *",LOGLEVEL_CONSTRUCT);
-    ASSERT(vp!=0);
+    GINAC_ASSERT(vp!=0);
     seq.swap(*vp);
     delete vp;
 }
@@ -323,7 +323,7 @@ ex exprseq::expand(unsigned options) const
 
 bool exprseq::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (is_equal(*other.bp)) return true;
     for (exvector::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
         if ((*it).has(other)) return true;
@@ -371,7 +371,7 @@ ex exprseq::subs(lst const & ls, lst const & lr) const
 
 int exprseq::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,exprseq));
+    GINAC_ASSERT(is_of_type(other,exprseq));
     exprseq const & o=static_cast<exprseq const &>
                                     (const_cast<basic &>(other));
     int cmpval;
@@ -392,7 +392,7 @@ int exprseq::compare_same_type(basic const & other) const
 
 bool exprseq::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,exprseq));
+    GINAC_ASSERT(is_of_type(other,exprseq));
     exprseq const & o=static_cast<exprseq const &>
                                     (const_cast<basic &>(other));
     if (seq.size()!=o.seq.size()) return false;
index 5e96830..8ac31b8 100644 (file)
@@ -34,8 +34,8 @@ bool exprseq::info(unsigned inf) const
 
 ex & exprseq::let_op(int const i)
 {
-    ASSERT(i>=0);
-    ASSERT(i<nops());
+    GINAC_ASSERT(i>=0);
+    GINAC_ASSERT(i<nops());
 
     return seq[i];
 }
index d853206..3ae0287 100644 (file)
@@ -192,7 +192,7 @@ void function::printraw(ostream & os) const
 {
     debugmsg("function printraw",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << "function(name=" << registered_functions()[serial].name;
     for (exvector::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
@@ -206,7 +206,7 @@ void function::print(ostream & os, unsigned upper_precedence) const
 {
     debugmsg("function print",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << registered_functions()[serial].name;
     printseq(os,'(',',',')',exprseq::precedence,function::precedence);
@@ -216,7 +216,7 @@ void function::printtree(ostream & os, unsigned indent) const
 {
     debugmsg("function printtree",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << string(indent,' ') << "function "
        << registered_functions()[serial].name
@@ -233,7 +233,7 @@ void function::printcsrc(ostream & os, unsigned type, unsigned upper_precedence)
 {
     debugmsg("function print csrc",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
        // Print function name in lowercase
     string lname;
@@ -261,7 +261,7 @@ ex function::expand(unsigned options) const
 
 ex function::eval(int level) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     exvector eseq=evalchildren(level);    
 
@@ -308,7 +308,7 @@ ex function::eval(int level) const
 
 ex function::evalf(int level) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     exvector eseq=evalfchildren(level);
     
@@ -367,7 +367,7 @@ ex function::thisexprseq(exvector * vp) const
  *  @see ex::series */
 ex function::series(symbol const & s, ex const & point, int order) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     if (registered_functions()[serial].s==0) {
         return basic::series(s, point, order);
@@ -414,7 +414,7 @@ ex function::series(symbol const & s, ex const & point, int order) const
 
 int function::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, function));
+    GINAC_ASSERT(is_of_type(other, function));
     function const & o=static_cast<function &>(const_cast<basic &>(other));
 
     if (serial!=o.serial) {
@@ -425,7 +425,7 @@ int function::compare_same_type(basic const & other) const
 
 bool function::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, function));
+    GINAC_ASSERT(is_of_type(other, function));
     function const & o=static_cast<function &>(const_cast<basic &>(other));
 
     if (serial!=o.serial) return false;
@@ -462,7 +462,7 @@ unsigned function::return_type_tinfo(void) const
 
 ex function::pdiff(unsigned diff_param) const // partial differentiation
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
     
     if (registered_functions()[serial].d==0) {
         throw(std::logic_error(string("function::pdiff(") + registered_functions()[serial].name + "): no diff function defined"));
index 7167d98..06bf2d6 100755 (executable)
@@ -420,7 +420,7 @@ void function::printraw(ostream & os) const
 {
     debugmsg("function printraw",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << "function(name=" << registered_functions()[serial].name;
     for (exvector::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
@@ -434,7 +434,7 @@ void function::print(ostream & os, unsigned upper_precedence) const
 {
     debugmsg("function print",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << registered_functions()[serial].name;
     printseq(os,'(',',',')',exprseq::precedence,function::precedence);
@@ -444,7 +444,7 @@ void function::printtree(ostream & os, unsigned indent) const
 {
     debugmsg("function printtree",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     os << string(indent,' ') << "function "
        << registered_functions()[serial].name
@@ -461,7 +461,7 @@ void function::printcsrc(ostream & os, unsigned type, unsigned upper_precedence)
 {
     debugmsg("function print csrc",LOGLEVEL_PRINT);
 
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
        // Print function name in lowercase
     string lname;
@@ -489,7 +489,7 @@ ex function::expand(unsigned options) const
 
 ex function::eval(int level) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     exvector eseq=evalchildren(level);    
 
@@ -506,7 +506,7 @@ ${eval_switch_statement}
 
 ex function::evalf(int level) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     exvector eseq=evalfchildren(level);
     
@@ -535,7 +535,7 @@ ex function::thisexprseq(exvector * vp) const
  *  \@see ex::series */
 ex function::series(symbol const & s, ex const & point, int order) const
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
 
     if (registered_functions()[serial].s==0) {
         return basic::series(s, point, order);
@@ -552,7 +552,7 @@ ${series_switch_statement}
 
 int function::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, function));
+    GINAC_ASSERT(is_of_type(other, function));
     function const & o=static_cast<function &>(const_cast<basic &>(other));
 
     if (serial!=o.serial) {
@@ -563,7 +563,7 @@ int function::compare_same_type(basic const & other) const
 
 bool function::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, function));
+    GINAC_ASSERT(is_of_type(other, function));
     function const & o=static_cast<function &>(const_cast<basic &>(other));
 
     if (serial!=o.serial) return false;
@@ -600,7 +600,7 @@ unsigned function::return_type_tinfo(void) const
 
 ex function::pdiff(unsigned diff_param) const // partial differentiation
 {
-    ASSERT(serial<registered_functions().size());
+    GINAC_ASSERT(serial<registered_functions().size());
     
     if (registered_functions()[serial].d==0) {
         throw(std::logic_error(string("function::pdiff(") + registered_functions()[serial].name + "): no diff function defined"));
index 26e91ff..f57a5ae 100644 (file)
@@ -200,13 +200,13 @@ bool idx::info(unsigned inf) const
 
 ex idx::subs(lst const & ls, lst const & lr) const
 {
-    ASSERT(ls.nops()==lr.nops());
-#ifdef DOASSERT
+    GINAC_ASSERT(ls.nops()==lr.nops());
+#ifdef DO_GINAC_ASSERT
     for (int i=0; i<ls.nops(); i++) {
-        ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
+        GINAC_ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
                is_ex_of_type(ls.op(i),idx));
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
 
     for (int i=0; i<ls.nops(); i++) {
         if (is_equal(*(ls.op(i)).bp)) {
@@ -220,7 +220,7 @@ ex idx::subs(lst const & ls, lst const & lr) const
 
 int idx::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,idx));
+    GINAC_ASSERT(is_of_type(other,idx));
     idx const & o=static_cast<idx const &>
                              (const_cast<basic &>(other));
 
@@ -248,7 +248,7 @@ int idx::compare_same_type(basic const & other) const
 
 bool idx::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,idx));
+    GINAC_ASSERT(is_of_type(other,idx));
     idx const & o=static_cast<idx const &>
                              (const_cast<basic &>(other));
 
@@ -274,7 +274,7 @@ unsigned idx::calchash(void) const
 bool idx::is_co_contra_pair(basic const & other) const
 {
     // like is_equal_same_type(), but tests for different covariant status
-    ASSERT(is_of_type(other,idx));
+    GINAC_ASSERT(is_of_type(other,idx));
     idx const & o=static_cast<idx const &>
                              (const_cast<basic &>(other));
 
@@ -366,10 +366,10 @@ exvector idx_intersect(exvector const & iv1, exvector const & iv2)
     // assumes (but does not test) that each index occurs at most twice
     exvector iv_intersect;
     for (exvector::const_iterator cit1=iv1.begin(); cit1!=iv1.end(); ++cit1) {
-        ASSERT(is_ex_of_type(*cit1,idx));
+        GINAC_ASSERT(is_ex_of_type(*cit1,idx));
         if (ex_to_idx(*cit1).is_symbolic()) {
             for (exvector::const_iterator cit2=iv2.begin(); cit2!=iv2.end(); ++cit2) {
-                ASSERT(is_ex_of_type(*cit2,idx));
+                GINAC_ASSERT(is_ex_of_type(*cit2,idx));
                 if ((*cit1).is_equal(*cit2)) {
                     iv_intersect.push_back(*cit1);
                     break;
@@ -392,8 +392,8 @@ ex permute_free_index_to_front(exvector const & iv3, exvector const & iv2,
     // match (return value,iv2) to iv3 by permuting indices
     // iv3 is always cyclic
 
-    ASSERT(iv3.size()==3);
-    ASSERT(iv2.size()==2);
+    GINAC_ASSERT(iv3.size()==3);
+    GINAC_ASSERT(iv2.size()==2);
 
     *sig=1;
     
@@ -412,8 +412,8 @@ unsigned subs_index_in_exvector(exvector & v, ex const & is, ex const & ir)
     unsigned replacements=0;
     unsigned current_replacements;
 
-    ASSERT(is_ex_of_type(is,idx));
-    ASSERT(is_ex_of_type(ir,idx));
+    GINAC_ASSERT(is_ex_of_type(is,idx));
+    GINAC_ASSERT(is_ex_of_type(ir,idx));
    
     for (it=v.begin(); it!=v.end(); ++it) {
         current_replacements=count_index(*it,is);
@@ -438,7 +438,7 @@ unsigned count_index(ex const & e, ex const & i)
 ex subs_indices(ex const & e, exvector const & idxv_subs,
                 exvector const & idxv_repl)
 {
-    ASSERT(idxv_subs.size()==idxv_repl.size());
+    GINAC_ASSERT(idxv_subs.size()==idxv_repl.size());
     ex res=e;
     for (unsigned i=0; i<idxv_subs.size(); ++i) {
         res=res.subs(idxv_subs[i]==idxv_repl[i]);
index 48a8c94..6e36eb3 100644 (file)
@@ -87,14 +87,14 @@ indexed::indexed(ex const & i1) : exprseq(i1)
 {
     debugmsg("indexed constructor from ex",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_indexed;
-    ASSERT(all_of_type_idx());
+    GINAC_ASSERT(all_of_type_idx());
 }
 
 indexed::indexed(ex const & i1, ex const & i2) : exprseq(i1,i2)
 {
     debugmsg("indexed constructor from ex,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_indexed;
-    ASSERT(all_of_type_idx());
+    GINAC_ASSERT(all_of_type_idx());
 }
 
 indexed::indexed(ex const & i1, ex const & i2, ex const & i3)
@@ -102,21 +102,21 @@ indexed::indexed(ex const & i1, ex const & i2, ex const & i3)
 {
     debugmsg("indexed constructor from ex,ex,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_indexed;
-    ASSERT(all_of_type_idx());
+    GINAC_ASSERT(all_of_type_idx());
 }
 
 indexed::indexed(exvector const & iv) : exprseq(iv)
 {
     debugmsg("indexed constructor from exvector",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_indexed;
-    ASSERT(all_of_type_idx());
+    GINAC_ASSERT(all_of_type_idx());
 }
 
 indexed::indexed(exvector * ivp) : exprseq(ivp)
 {
     debugmsg("indexed constructor from exvector *",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_indexed;
-    ASSERT(all_of_type_idx());
+    GINAC_ASSERT(all_of_type_idx());
 }
 
 //////////
@@ -188,13 +188,13 @@ exvector indexed::get_indices(void) const
 
 int indexed::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,indexed));
+    GINAC_ASSERT(is_of_type(other,indexed));
     return exprseq::compare_same_type(other);
 }
 
 bool indexed::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,indexed));
+    GINAC_ASSERT(is_of_type(other,indexed));
     return exprseq::is_equal_same_type(other);
 }
 
index de48b85..3f67d84 100644 (file)
@@ -149,8 +149,8 @@ ex lsolve(ex const &eqns, ex const &symbols)
         }
         ex sol=lsolve(lst(eqns),lst(symbols));
         
-        ASSERT(sol.nops()==1);
-        ASSERT(is_ex_exactly_of_type(sol.op(0),relational));
+        GINAC_ASSERT(sol.nops()==1);
+        GINAC_ASSERT(is_ex_exactly_of_type(sol.op(0),relational));
         
         return sol.op(0).op(1); // return rhs of first solution
     }
index c917387..bb3a74e 100644 (file)
@@ -87,7 +87,7 @@ static ex gamma_evalf(ex const & x)
 
 static ex gamma_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return psi(exZERO(),x)*gamma(x);  // diff(log(gamma(x)),x)==psi(0,x)
 }
@@ -130,7 +130,7 @@ static ex psi_evalf(ex const & n, ex const & x)
 
 static ex psi_diff(ex const & n, ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return psi(n+1, x);
 }
index ce97968..70eccdc 100644 (file)
@@ -77,7 +77,7 @@ static ex exp_eval(ex const & x)
 
 static ex exp_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
 
     return exp(x);
 }
@@ -125,7 +125,7 @@ static ex log_eval(ex const & x)
 
 static ex log_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
 
     return power(x, -1);
 }
@@ -181,7 +181,7 @@ static ex sin_eval(ex const & x)
 
 static ex sin_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return cos(x);
 }
@@ -237,7 +237,7 @@ static ex cos_eval(ex const & x)
 
 static ex cos_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
 
     return numMINUSONE()*sin(x);
 }
@@ -299,7 +299,7 @@ static ex tan_eval(ex const & x)
 
 static ex tan_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return (1+power(tan(x),exTWO()));
 }
@@ -347,7 +347,7 @@ static ex asin_eval(ex const & x)
 
 static ex asin_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return power(1-power(x,exTWO()),exMINUSHALF());
 }
@@ -395,7 +395,7 @@ static ex acos_eval(ex const & x)
 
 static ex acos_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return numMINUSONE()*power(1-power(x,exTWO()),exMINUSHALF());
 }
@@ -431,7 +431,7 @@ static ex atan_eval(ex const & x)
 
 static ex atan_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
 
     return power(1+x*x, -1);
 }
@@ -464,7 +464,7 @@ static ex atan2_eval(ex const & y, ex const & x)
 
 static ex atan2_diff(ex const & y, ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param<2);
+    GINAC_ASSERT(diff_param<2);
     
     if (diff_param==0) {
         // d/dy atan(y,x)
@@ -518,7 +518,7 @@ static ex sinh_eval(ex const & x)
 
 static ex sinh_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return cosh(x);
 }
@@ -567,7 +567,7 @@ static ex cosh_eval(ex const & x)
 
 static ex cosh_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return sinh(x);
 }
@@ -616,7 +616,7 @@ static ex tanh_eval(ex const & x)
 
 static ex tanh_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return exONE()-power(tanh(x),exTWO());
 }
@@ -652,7 +652,7 @@ static ex asinh_eval(ex const & x)
 
 static ex asinh_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return power(1+power(x,exTWO()),exMINUSHALF());
 }
@@ -694,7 +694,7 @@ static ex acosh_eval(ex const & x)
 
 static ex acosh_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return power(x-1,exMINUSHALF())*power(x+1,exMINUSHALF());
 }
@@ -733,7 +733,7 @@ static ex atanh_eval(ex const & x)
 
 static ex atanh_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return power(exONE()-power(x,exTWO()),exMINUSONE());
 }
index ae58ec1..1a850ac 100644 (file)
@@ -73,7 +73,7 @@ static ex zeta_evalf(ex const & x)
 
 static ex zeta_diff(ex const & x, unsigned diff_param)
 {
-    ASSERT(diff_param==0);
+    GINAC_ASSERT(diff_param==0);
     
     return exZERO();  // should return zeta(numONE(),x);
 }
index 672ea92..e5288e9 100644 (file)
@@ -151,7 +151,7 @@ bool isospin::info(unsigned inf) const
 
 int isospin::compare_same_type(basic const & other) const
 {
-    ASSERT(other.tinfo() == TINFO_isospin);
+    GINAC_ASSERT(other.tinfo() == TINFO_isospin);
     const isospin *o = static_cast<const isospin *>(&other);
     if (serial==o->serial) {
         return indexed::compare_same_type(other);
index 3e69d30..6d09ee1 100644 (file)
@@ -228,7 +228,7 @@ bool lorentzidx::info(unsigned inf) const
 
 lorentzidx lorentzidx::create_anonymous_representative(void) const
 {
-    ASSERT(is_symbolic());
+    GINAC_ASSERT(is_symbolic());
     lorentzidx i_copy(*this);
     i_copy.serial=0;
     i_copy.name="anonymous_representative";
index a71f5dd..227835f 100644 (file)
@@ -108,7 +108,7 @@ lst::lst(exlist const & s, bool discardable) :  basic(TINFO_lst)
 lst::lst(exlist * vp) : basic(TINFO_lst)
 {
     debugmsg("lst constructor from exlist *",LOGLEVEL_CONSTRUCT);
-    ASSERT(vp!=0);
+    GINAC_ASSERT(vp!=0);
     seq.swap(*vp);
     delete vp;
 }
@@ -308,8 +308,8 @@ int lst::nops() const
 
 ex & lst::let_op(int const i)
 {
-    ASSERT(i>=0);
-    ASSERT(i<nops());
+    GINAC_ASSERT(i>=0);
+    GINAC_ASSERT(i<nops());
 
     exlist::iterator it=seq.begin();
     for (int j=0; j<i; j++) {
@@ -334,7 +334,7 @@ ex lst::expand(unsigned options) const
 
 bool lst::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (is_equal(*other.bp)) return true;
     for (exlist::const_iterator it=seq.begin(); it!=seq.end(); ++it) {
         if ((*it).has(other)) return true;
@@ -382,7 +382,7 @@ ex lst::subs(lst const & ls, lst const & lr) const
 
 int lst::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,lst));
+    GINAC_ASSERT(is_of_type(other,lst));
     lst const & o=static_cast<lst const &>
                                     (const_cast<basic &>(other));
     int cmpval;
@@ -403,7 +403,7 @@ int lst::compare_same_type(basic const & other) const
 
 bool lst::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,lst));
+    GINAC_ASSERT(is_of_type(other,lst));
     lst const & o=static_cast<lst const &>
                                     (const_cast<basic &>(other));
     if (seq.size()!=o.seq.size()) return false;
index 3fd31fc..bacacad 100644 (file)
@@ -143,7 +143,7 @@ ex matrix::expand(unsigned options) const
  *  itself or one of the elements 'has' it. */
 bool matrix::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     
     // tautology: it is the expression itself
     if (is_equal(*other.bp)) return true;
@@ -213,7 +213,7 @@ ex matrix::evalf(int level) const
 
 int matrix::compare_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other, matrix));
+    GINAC_ASSERT(is_exactly_of_type(other, matrix));
     matrix const & o=static_cast<matrix &>(const_cast<basic &>(other));
     
     // compare number of rows
@@ -350,7 +350,7 @@ matrix matrix::transpose(void) const
  * called internally by matrix::determinant(). */
 ex determinant_numeric(const matrix & M)
 {
-    ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
+    GINAC_ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
     matrix tmp(M);
     ex det=exONE();
     ex piv;
@@ -399,7 +399,7 @@ int permutation_sign(vector<T> s)
  *  routine is only called internally by matrix::determinant(). */
 ex determinant_symbolic_perm(const matrix & M)
 {
-    ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
+    GINAC_ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
     
     if (M.rows()==1) {  // speed things up
         return M(0,0);
@@ -424,7 +424,7 @@ ex determinant_symbolic_perm(const matrix & M)
  *  called internally by matrix::determinant(). */
 ex determinant_symbolic_minor(const matrix & M)
 {
-    ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
+    GINAC_ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
     
     if (M.rows()==1) {  // end of recursion
         return M(0,0);
@@ -468,7 +468,7 @@ ex determinant_symbolic_minor(const matrix & M)
  *  that are very hard to canonicalize. */
 /*ex determinant_symbolic_leverrier(const matrix & M)
  *{
- *    ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
+ *    GINAC_ASSERT(M.rows()==M.cols());  // cannot happen, just in case...
  *    
  *    matrix B(M);
  *    matrix I(M.row, M.col);
@@ -690,7 +690,7 @@ matrix matrix::fraction_free_elim(matrix const & vars,
     }
     */
     
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     // test if we really have an upper echelon matrix
     int zero_in_last_row=-1;
     for (int r=1; r<=m; ++r) {
@@ -702,10 +702,10 @@ matrix matrix::fraction_free_elim(matrix const & vars,
                 break;
             }
         }
-        ASSERT((zero_in_this_row>zero_in_last_row)||(zero_in_this_row=n));
+        GINAC_ASSERT((zero_in_this_row>zero_in_last_row)||(zero_in_this_row=n));
         zero_in_last_row=zero_in_this_row;
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
     
     // assemble solution
     matrix sol(n,1);
@@ -747,7 +747,7 @@ matrix matrix::fraction_free_elim(matrix const & vars,
     }
     */
     
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     // test solution with echelon matrix
     for (int r=1; r<=m; ++r) {
         ex e=0;
@@ -759,7 +759,7 @@ matrix matrix::fraction_free_elim(matrix const & vars,
             cout << "b.ffe_get(" << r<<",1)=" << b.ffe_get(r,1) << endl;
             cout << "diff=" << (e-b.ffe_get(r,1)).normal() << endl;
         }
-        ASSERT((e-b.ffe_get(r,1)).normal().is_zero());
+        GINAC_ASSERT((e-b.ffe_get(r,1)).normal().is_zero());
     }
 
     // test solution with original matrix
@@ -782,9 +782,9 @@ matrix matrix::fraction_free_elim(matrix const & vars,
             ex xxx=e-rhs.ffe_get(r,1);
             cerr << "xxx=" << xxx << endl << endl;
         }
-        ASSERT((e-rhs.ffe_get(r,1)).normal().is_zero());
+        GINAC_ASSERT((e-rhs.ffe_get(r,1)).normal().is_zero());
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
     
     return sol;
 }   
index 5054fb0..78f2bd9 100644 (file)
@@ -88,7 +88,7 @@ mul::mul(ex const & lh, ex const & rh)
     tinfo_key = TINFO_mul;
     overall_coeff=exONE();
     construct_from_2_ex(lh,rh);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 mul::mul(exvector const & v)
@@ -97,7 +97,7 @@ mul::mul(exvector const & v)
     tinfo_key = TINFO_mul;
     overall_coeff=exONE();
     construct_from_exvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 /*
@@ -113,7 +113,7 @@ mul::mul(epvector const & v, bool do_not_canonicalize)
     } else {
         construct_from_epvector(v);
     }
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 */
 
@@ -123,7 +123,7 @@ mul::mul(epvector const & v)
     tinfo_key = TINFO_mul;
     overall_coeff=exONE();
     construct_from_epvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 mul::mul(epvector const & v, ex const & oc)
@@ -132,18 +132,18 @@ mul::mul(epvector const & v, ex const & oc)
     tinfo_key = TINFO_mul;
     overall_coeff=oc;
     construct_from_epvector(v);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 mul::mul(epvector * vp, ex const & oc)
 {
     debugmsg("mul constructor from epvector *,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key = TINFO_mul;
-    ASSERT(vp!=0);
+    GINAC_ASSERT(vp!=0);
     overall_coeff=oc;
     construct_from_epvector(*vp);
     delete vp;
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 mul::mul(ex const & lh, ex const & mh, ex const & rh)
@@ -157,7 +157,7 @@ mul::mul(ex const & lh, ex const & mh, ex const & rh)
     factors.push_back(rh);
     overall_coeff=exONE();
     construct_from_exvector(factors);
-    ASSERT(is_canonical());
+    GINAC_ASSERT(is_canonical());
 }
 
 //////////
@@ -257,9 +257,9 @@ ex mul::eval(int level) const
     debugmsg("mul eval",LOGLEVEL_MEMBER_FUNCTION);
 
     if ((level==1)&&(flags & status_flags::evaluated)) {
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
         for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
-            ASSERT((!is_ex_exactly_of_type((*cit).rest,mul))||
+            GINAC_ASSERT((!is_ex_exactly_of_type((*cit).rest,mul))||
                    (!(ex_to_numeric((*cit).coeff).is_integer())));
         }
 
@@ -272,9 +272,9 @@ ex mul::eval(int level) const
             do {
                 cit--;
                 if (is_ex_exactly_of_type((*cit).rest,numeric)) {
-                    ASSERT(all_numeric);
+                    GINAC_ASSERT(all_numeric);
                     if ((*cit).coeff.is_equal(exONE())) {
-                        ASSERT(all_coeff_1);
+                        GINAC_ASSERT(all_coeff_1);
                     } else {
                         all_coeff_1=false;
                     }
@@ -283,7 +283,7 @@ ex mul::eval(int level) const
                 }
             } while (cit!=seq.begin());
         }
-#endif // def DOASSERT    
+#endif // def DO_GINAC_ASSERT    
         return *this;
     }
 
@@ -321,9 +321,9 @@ ex mul::eval(int level) const
     }
     
     
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
-        ASSERT((!is_ex_exactly_of_type((*cit).rest,mul))||
+        GINAC_ASSERT((!is_ex_exactly_of_type((*cit).rest,mul))||
                (!(ex_to_numeric((*cit).coeff).is_integer())));
     }
 
@@ -336,9 +336,9 @@ ex mul::eval(int level) const
         do {
             cit--;
             if (is_ex_exactly_of_type((*cit).rest,numeric)) {
-                ASSERT(all_numeric);
+                GINAC_ASSERT(all_numeric);
                 if ((*cit).coeff.is_equal(exONE())) {
-                    ASSERT(all_coeff_1);
+                    GINAC_ASSERT(all_coeff_1);
                 } else {
                     all_coeff_1=false;
                 }
@@ -347,7 +347,7 @@ ex mul::eval(int level) const
             }
         } while (cit!=seq.begin());
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
     
     if (flags & status_flags::evaluated) {
         return *this;
@@ -481,26 +481,26 @@ ex mul::eval(int level) const
                    setflag(status_flags::dynallocated);
     }
 
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     for (epvector::const_iterator cit=seq.begin(); cit!=seq.end(); ++cit) {
-        ASSERT((!is_ex_exactly_of_type((*cit).rest,mul))||
+        GINAC_ASSERT((!is_ex_exactly_of_type((*cit).rest,mul))||
                (!(ex_to_numeric((*cit).coeff).is_integer())));
-        ASSERT(!((*cit).is_numeric_with_coeff_1()));
+        GINAC_ASSERT(!((*cit).is_numeric_with_coeff_1()));
         if (is_ex_exactly_of_type(recombine_pair_to_ex(*cit),numeric)) {
             printtree(cerr,0);
         }
-        ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*cit),numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*cit),numeric));
         /* for paranoia */
         expair p=split_ex_to_pair(recombine_pair_to_ex(*cit));
-        ASSERT(p.rest.is_equal((*cit).rest));
-        ASSERT(p.coeff.is_equal((*cit).coeff));
+        GINAC_ASSERT(p.rest.is_equal((*cit).rest));
+        GINAC_ASSERT(p.coeff.is_equal((*cit).coeff));
         /* end paranoia */
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
 
     if (flags & status_flags::evaluated) {
-        ASSERT(seq.size()>0);
-        ASSERT((seq.size()>1)||!overall_coeff.is_equal(exONE()));
+        GINAC_ASSERT(seq.size()>0);
+        GINAC_ASSERT((seq.size()>1)||!overall_coeff.is_equal(exONE()));
         return *this;
     }
 
@@ -773,23 +773,23 @@ ex mul::default_overall_coeff(void) const
 
 void mul::combine_overall_coeff(ex const & c)
 {
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    ASSERT(is_ex_exactly_of_type(c,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c,numeric));
     overall_coeff = ex_to_numeric(overall_coeff).mul_dyn(ex_to_numeric(c));
 }
 
 void mul::combine_overall_coeff(ex const & c1, ex const & c2)
 {
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    ASSERT(is_ex_exactly_of_type(c1,numeric));
-    ASSERT(is_ex_exactly_of_type(c2,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c1,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(c2,numeric));
     overall_coeff = ex_to_numeric(overall_coeff).
                         mul_dyn(ex_to_numeric(c1).power(ex_to_numeric(c2)));
 }
 
 bool mul::can_make_flat(expair const & p) const
 {
-    ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(p.coeff,numeric));
     // this assertion will probably fail somewhere
     // it would require a more careful make_flat, obeying the power laws
     // probably should return true only if p.coeff is integer
@@ -852,7 +852,7 @@ ex mul::expand(unsigned options) const
         term=expanded_seq;
         for (l=0; l<number_of_adds; l++) {
             add const & addref=ex_to_add(expanded_seq[positions_of_adds[l]].rest);
-            ASSERT(term[positions_of_adds[l]].coeff.compare(exONE())==0);
+            GINAC_ASSERT(term[positions_of_adds[l]].coeff.compare(exONE())==0);
             term[positions_of_adds[l]]=split_ex_to_pair(addref.op(k[l]));
         }
         /*
index 7d2364e..515a870 100644 (file)
@@ -198,7 +198,7 @@ ex ncmul::expand(unsigned options) const
         exvector term;
         term=expanded_seq;
         for (l=0; l<number_of_adds; l++) {
-            ASSERT(is_ex_exactly_of_type(expanded_seq[positions_of_adds[l]],add));
+            GINAC_ASSERT(is_ex_exactly_of_type(expanded_seq[positions_of_adds[l]],add));
             add const & addref=ex_to_add(expanded_seq[positions_of_adds[l]]);
             term[positions_of_adds[l]]=addref.recombine_pair_to_ex(addref.seq[k[l]]);
         }
@@ -364,7 +364,7 @@ ex ncmul::eval(int level) const
         }
         ++i;
     }
-    ASSERT(count_commutative+count_noncommutative+count_noncommutative_composite==assocseq.size());
+    GINAC_ASSERT(count_commutative+count_noncommutative+count_noncommutative_composite==assocseq.size());
 
     // ncmul(...,c1,...,c2,...) ->
     //     *(c1,c2,ncmul(...)) (pull out commutative elements)
@@ -391,7 +391,7 @@ ex ncmul::eval(int level) const
     if (count_noncommutative_composite==0) {
         // there are neither commutative nor noncommutative_composite
         // elements in assocseq
-        ASSERT(count_commutative==0);
+        GINAC_ASSERT(count_commutative==0);
 
         exvectorvector evv;
         unsignedvector rttinfos;
@@ -416,15 +416,15 @@ ex ncmul::eval(int level) const
             }
         }
 
-#ifdef DOASSERT
-        ASSERT(evv.size()==rttinfos.size());
-        ASSERT(evv.size()>0);
+#ifdef DO_GINAC_ASSERT
+        GINAC_ASSERT(evv.size()==rttinfos.size());
+        GINAC_ASSERT(evv.size()>0);
         unsigned s=0;
         for (i=0; i<evv.size(); ++i) {
             s += evv[i].size();
         }
-        ASSERT(s==assocseq.size());
-#endif // def DOASSERT
+        GINAC_ASSERT(s==assocseq.size());
+#endif // def DO_GINAC_ASSERT
         
         // if all elements are of same type, simplify the string
         if (evv.size()==1) {
@@ -509,7 +509,7 @@ unsigned ncmul::return_type(void) const
         }
     }
     // all factors checked
-    ASSERT(!all_commutative); // not all factors should commute, because this is a ncmul();
+    GINAC_ASSERT(!all_commutative); // not all factors should commute, because this is a ncmul();
     return all_commutative ? return_types::commutative : return_types::noncommutative;
 }
    
index 70447ac..391b80b 100644 (file)
@@ -220,7 +220,7 @@ static numeric lcm_of_coefficients_denominators(const ex &e)
 
 numeric ex::integer_content(void) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->integer_content();
 }
 
@@ -240,27 +240,27 @@ numeric add::integer_content(void) const
     epvector::const_iterator itend = seq.end();
     numeric c = numZERO();
     while (it != itend) {
-        ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
-        ASSERT(is_ex_exactly_of_type(it->coeff,numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
+        GINAC_ASSERT(is_ex_exactly_of_type(it->coeff,numeric));
         c = gcd(ex_to_numeric(it->coeff), c);
         it++;
     }
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
     c = gcd(ex_to_numeric(overall_coeff),c);
     return c;
 }
 
 numeric mul::integer_content(void) const
 {
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     epvector::const_iterator it = seq.begin();
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
-        ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*it),numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*it),numeric));
         ++it;
     }
-#endif // def DOASSERT
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+#endif // def DO_GINAC_ASSERT
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
     return abs(ex_to_numeric(overall_coeff));
 }
 
@@ -841,7 +841,7 @@ static ex sr_gcd(const ex &a, const ex &b, const symbol *x)
 
 numeric ex::max_coefficient(void) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->max_coefficient();
 }
 
@@ -859,11 +859,11 @@ numeric add::max_coefficient(void) const
 {
     epvector::const_iterator it = seq.begin();
     epvector::const_iterator itend = seq.end();
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
     numeric cur_max = abs(ex_to_numeric(overall_coeff));
     while (it != itend) {
         numeric a;
-        ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
         a = abs(ex_to_numeric(it->coeff));
         if (a > cur_max)
             cur_max = a;
@@ -874,15 +874,15 @@ numeric add::max_coefficient(void) const
 
 numeric mul::max_coefficient(void) const
 {
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     epvector::const_iterator it = seq.begin();
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
-        ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*it),numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*it),numeric));
         it++;
     }
-#endif // def DOASSERT
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+#endif // def DO_GINAC_ASSERT
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
     return abs(ex_to_numeric(overall_coeff));
 }
 
@@ -897,7 +897,7 @@ numeric mul::max_coefficient(void) const
 
 ex ex::smod(const numeric &xi) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->smod(xi);
 }
 
@@ -918,29 +918,29 @@ ex add::smod(const numeric &xi) const
     epvector::const_iterator it = seq.begin();
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
-        ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
         numeric coeff = GiNaC::smod(ex_to_numeric(it->coeff), xi);
         if (!coeff.is_zero())
             newseq.push_back(expair(it->rest, coeff));
         it++;
     }
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
     numeric coeff = GiNaC::smod(ex_to_numeric(overall_coeff), xi);
     return (new add(newseq,coeff))->setflag(status_flags::dynallocated);
 }
 
 ex mul::smod(const numeric &xi) const
 {
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
     epvector::const_iterator it = seq.begin();
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
-        ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*it),numeric));
+        GINAC_ASSERT(!is_ex_exactly_of_type(recombine_pair_to_ex(*it),numeric));
         it++;
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
     mul * mulcopyp=new mul(*this);
-    ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
+    GINAC_ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
     mulcopyp->overall_coeff = GiNaC::smod(ex_to_numeric(overall_coeff),xi);
     mulcopyp->clearflag(status_flags::evaluated);
     mulcopyp->clearflag(status_flags::hash_calculated);
index 4877dae..c7d926a 100644 (file)
@@ -326,7 +326,7 @@ ex numeric::evalf(int level) const
 
 int numeric::compare_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other, numeric));
+    GINAC_ASSERT(is_exactly_of_type(other, numeric));
     numeric const & o = static_cast<numeric &>(const_cast<basic &>(other));
 
     if (*value == *o.value) {
@@ -338,7 +338,7 @@ int numeric::compare_same_type(basic const & other) const
 
 bool numeric::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other,numeric));
+    GINAC_ASSERT(is_exactly_of_type(other,numeric));
     numeric const *o = static_cast<numeric const *>(&other);
     
     return is_equal(*o);
@@ -714,7 +714,7 @@ bool numeric::operator>=(numeric const & other) const
  *  if the number is really an integer before calling this method. */
 int numeric::to_int(void) const
 {
-    ASSERT(is_integer());
+    GINAC_ASSERT(is_integer());
     return cl_I_to_int(The(cl_I)(*value));
 }
 
@@ -722,7 +722,7 @@ int numeric::to_int(void) const
  *  if the number is really not complex before calling this method. */
 double numeric::to_double(void) const
 {
-    ASSERT(is_real());
+    GINAC_ASSERT(is_real());
     return cl_double_approx(realpart(*value));
 }
 
index 36b5c8b..bed6ed2 100644 (file)
@@ -93,13 +93,13 @@ void power::destroy(bool call_parent)
 power::power(ex const & lh, ex const & rh) : basic(TINFO_power), basis(lh), exponent(rh)
 {
     debugmsg("power constructor from ex,ex",LOGLEVEL_CONSTRUCT);
-    ASSERT(basis.return_type()==return_types::commutative);
+    GINAC_ASSERT(basis.return_type()==return_types::commutative);
 }
 
 power::power(ex const & lh, numeric const & rh) : basic(TINFO_power), basis(lh), exponent(rh)
 {
     debugmsg("power constructor from ex,numeric",LOGLEVEL_CONSTRUCT);
-    ASSERT(basis.return_type()==return_types::commutative);
+    GINAC_ASSERT(basis.return_type()==return_types::commutative);
 }
 
 //////////
@@ -132,8 +132,8 @@ int power::nops() const
 
 ex & power::let_op(int const i)
 {
-    ASSERT(i>=0);
-    ASSERT(i<2);
+    GINAC_ASSERT(i>=0);
+    GINAC_ASSERT(i<2);
 
     return i==0 ? basis : exponent;
 }
@@ -245,7 +245,7 @@ ex power::eval(int level) const
             || res.is_rational()) {
             return res;
         }
-        ASSERT(!num_exponent->is_integer());  // has been handled by now
+        GINAC_ASSERT(!num_exponent->is_integer());  // has been handled by now
         // ^(c1,n/m) -> *(c1^q,c1^(n/m-q)), 0<(n/m-h)<1, q integer
         if (basis_is_rational && exponent_is_rational
             && num_exponent->is_real()
@@ -284,7 +284,7 @@ ex power::eval(int level) const
         ex const & sub_exponent=sub_power.exponent;
         if (is_ex_exactly_of_type(sub_exponent,numeric)) {
             numeric const & num_sub_exponent=ex_to_numeric(sub_exponent);
-            ASSERT(num_sub_exponent!=numeric(1));
+            GINAC_ASSERT(num_sub_exponent!=numeric(1));
             if (num_exponent->is_integer() || abs(num_sub_exponent)<1) {
                 return power(sub_basis,num_sub_exponent.mul(*num_exponent));
             }
@@ -300,7 +300,7 @@ ex power::eval(int level) const
     // ^(*(...,x;c1),c2) -> ^(*(...,x;1),c2)*c1^c2 (c1, c2 numeric(), c1>0)
     // ^(*(...,x,c1),c2) -> ^(*(...,x;-1),c2)*(-c1)^c2 (c1, c2 numeric(), c1<0)
     if (exponent_is_numerical && is_ex_exactly_of_type(ebasis,mul)) {
-        ASSERT(!num_exponent->is_integer()); // should have been handled above
+        GINAC_ASSERT(!num_exponent->is_integer()); // should have been handled above
         mul const & mulref=ex_to_mul(ebasis);
         if (!mulref.overall_coeff.is_equal(exONE())) {
             numeric const & num_coeff=ex_to_numeric(mulref.overall_coeff);
@@ -314,7 +314,7 @@ ex power::eval(int level) const
                                     power(num_coeff,*num_exponent)))->
                         setflag(status_flags::dynallocated);
                 } else {
-                    ASSERT(num_coeff.compare(numZERO())<0);
+                    GINAC_ASSERT(num_coeff.compare(numZERO())<0);
                     if (num_coeff.compare(numMINUSONE())!=0) {
                         mul * mulp=new mul(mulref);
                         mulp->overall_coeff=exMINUSONE();
@@ -379,7 +379,7 @@ ex power::simplify_ncmul(exvector const & v) const
 
 int power::compare_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other, power));
+    GINAC_ASSERT(is_exactly_of_type(other, power));
     power const & o=static_cast<power const &>(const_cast<basic &>(other));
 
     int cmpval;
@@ -472,8 +472,8 @@ ex power::expand_add(add const & a, int const n) const
         term.reserve(m+1);
         for (l=0; l<m-1; l++) {
             ex const & b=a.op(l);
-            ASSERT(!is_ex_exactly_of_type(b,add));
-            ASSERT(!is_ex_exactly_of_type(b,power)||
+            GINAC_ASSERT(!is_ex_exactly_of_type(b,add));
+            GINAC_ASSERT(!is_ex_exactly_of_type(b,power)||
                    !is_ex_exactly_of_type(ex_to_power(b).exponent,numeric)||
                    !ex_to_numeric(ex_to_power(b).exponent).is_pos_integer());
             if (is_ex_exactly_of_type(b,mul)) {
@@ -484,8 +484,8 @@ ex power::expand_add(add const & a, int const n) const
         }
 
         ex const & b=a.op(l);
-        ASSERT(!is_ex_exactly_of_type(b,add));
-        ASSERT(!is_ex_exactly_of_type(b,power)||
+        GINAC_ASSERT(!is_ex_exactly_of_type(b,add));
+        GINAC_ASSERT(!is_ex_exactly_of_type(b,power)||
                !is_ex_exactly_of_type(ex_to_power(b).exponent,numeric)||
                !ex_to_numeric(ex_to_power(b).exponent).is_pos_integer());
         if (is_ex_exactly_of_type(b,mul)) {
@@ -552,8 +552,8 @@ ex power::expand_add_2(add const & a) const
 
     for (epvector::const_iterator cit0=a.seq.begin(); cit0!=last; ++cit0) {
         ex const & b=a.recombine_pair_to_ex(*cit0);
-        ASSERT(!is_ex_exactly_of_type(b,add));
-        ASSERT(!is_ex_exactly_of_type(b,power)||
+        GINAC_ASSERT(!is_ex_exactly_of_type(b,add));
+        GINAC_ASSERT(!is_ex_exactly_of_type(b,power)||
                !is_ex_exactly_of_type(ex_to_power(b).exponent,numeric)||
                !ex_to_numeric(ex_to_power(b).exponent).is_pos_integer());
         if (is_ex_exactly_of_type(b,mul)) {
@@ -570,7 +570,7 @@ ex power::expand_add_2(add const & a) const
         }
     }
 
-    ASSERT(sum.size()==(a.seq.size()*(a.seq.size()+1))/2);
+    GINAC_ASSERT(sum.size()==(a.seq.size()*(a.seq.size()+1))/2);
 
     return (new add(sum))->setflag(status_flags::dynallocated);
 }
@@ -591,8 +591,8 @@ ex power::expand_add_2(add const & a) const
         ex const & r=(*cit0).rest;
         ex const & c=(*cit0).coeff;
         
-        ASSERT(!is_ex_exactly_of_type(r,add));
-        ASSERT(!is_ex_exactly_of_type(r,power)||
+        GINAC_ASSERT(!is_ex_exactly_of_type(r,add));
+        GINAC_ASSERT(!is_ex_exactly_of_type(r,power)||
                !is_ex_exactly_of_type(ex_to_power(r).exponent,numeric)||
                !ex_to_numeric(ex_to_power(r).exponent).is_pos_integer()||
                !is_ex_exactly_of_type(ex_to_power(r).basis,add)||
@@ -624,7 +624,7 @@ ex power::expand_add_2(add const & a) const
         }
     }
 
-    ASSERT(sum.size()==(a.seq.size()*(a.seq.size()+1))/2);
+    GINAC_ASSERT(sum.size()==(a.seq.size()*(a.seq.size()+1))/2);
 
     // second part: add terms coming from overall_factor (if != 0)
     if (!a.overall_coeff.is_equal(exZERO())) {
@@ -634,7 +634,7 @@ ex power::expand_add_2(add const & a) const
         sum.push_back(expair(ex_to_numeric(a.overall_coeff).power_dyn(numTWO()),exONE()));
     }
         
-    ASSERT(sum.size()==(a_nops*(a_nops+1))/2);
+    GINAC_ASSERT(sum.size()==(a_nops*(a_nops+1))/2);
     
     return (new add(sum))->setflag(status_flags::dynallocated);
 }
index f797dc6..1df9cd2 100644 (file)
@@ -46,14 +46,14 @@ namespace GiNaC {
 void ex::print(ostream & os, unsigned upper_precedence) const
 {
     debugmsg("ex print",LOGLEVEL_PRINT);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     bp->print(os,upper_precedence);
 }
 
 void ex::dbgprint(void) const
 {
     debugmsg("ex dbgprint",LOGLEVEL_PRINT);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     bp->dbgprint();
 }
 
index a162ad8..2d0ccfd 100644 (file)
@@ -51,7 +51,7 @@ namespace GiNaC {
 void ex::printcsrc(ostream & os, unsigned type, const char *var_name) const
 {
     debugmsg("ex print csrc", LOGLEVEL_PRINT);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
        switch (type) {
                case csrc_types::ctype_float:
                        os << "float ";
index 7c66c1b..31f5606 100644 (file)
@@ -50,7 +50,7 @@ namespace GiNaC {
 void ex::printraw(ostream & os) const
 {
     debugmsg("ex printraw",LOGLEVEL_PRINT);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     os << "ex(";
     bp->printraw(os);
     os << ")";
index a7b0972..99cf56e 100644 (file)
@@ -45,7 +45,7 @@ namespace GiNaC {
 void ex::printtree(ostream & os, unsigned indent) const
 {
     debugmsg("ex printtree",LOGLEVEL_PRINT);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     // os << "refcount=" << bp->refcount << " ";
     bp->printtree(os,indent);
 }
@@ -53,7 +53,7 @@ void ex::printtree(ostream & os, unsigned indent) const
 void ex::dbgprinttree(void) const
 {
     debugmsg("ex dbgprinttree",LOGLEVEL_PRINT);
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     bp->dbgprinttree();
 }
 
index f63a297..76652e9 100644 (file)
@@ -130,8 +130,8 @@ int relational::nops() const
 
 ex & relational::let_op(int const i)
 {
-    ASSERT(i>=0);
-    ASSERT(i<2);
+    GINAC_ASSERT(i>=0);
+    GINAC_ASSERT(i<2);
 
     return i==0 ? lh : rh;
 }
@@ -170,7 +170,7 @@ ex relational::simplify_ncmul(exvector const & v) const
 
 int relational::compare_same_type(basic const & other) const
 {
-    ASSERT(is_exactly_of_type(other, relational));
+    GINAC_ASSERT(is_exactly_of_type(other, relational));
     relational const & oth=static_cast<relational const &>(const_cast<basic &>(other));
     
     int cmpval;
@@ -192,13 +192,13 @@ int relational::compare_same_type(basic const & other) const
 
 unsigned relational::return_type(void) const
 {
-    ASSERT(lh.return_type()==rh.return_type());
+    GINAC_ASSERT(lh.return_type()==rh.return_type());
     return lh.return_type();
 }
    
 unsigned relational::return_type_tinfo(void) const
 {
-    ASSERT(lh.return_type_tinfo()==rh.return_type_tinfo());
+    GINAC_ASSERT(lh.return_type_tinfo()==rh.return_type_tinfo());
     return lh.return_type_tinfo();
 }
 
index 5822825..a390dd1 100644 (file)
@@ -97,7 +97,7 @@ series::series(ex const &var_, ex const &point_, epvector const &ops_)
     : basic(TINFO_series), seq(ops_), var(var_), point(point_)
 {
     debugmsg("series constructor from ex,ex,epvector", LOGLEVEL_CONSTRUCT);
-    ASSERT(is_ex_exactly_of_type(var_, symbol));
+    GINAC_ASSERT(is_ex_exactly_of_type(var_, symbol));
 }
 
 
@@ -627,7 +627,7 @@ ex power::series(symbol const & s, ex const & point, int order) const
  *  @return an expression holding a series object */
 ex ex::series(symbol const &s, ex const &point, int order) const
 {
-    ASSERT(bp!=0);
+    GINAC_ASSERT(bp!=0);
     return bp->series(s, point, order);
 }
 
index d488e6d..05f96ae 100644 (file)
@@ -103,7 +103,7 @@ simp_lor::simp_lor(simp_lor_types const t, ex const & i1, ex const & i2) :
 {
     debugmsg("simp_lor constructor from simp_lor_types,ex,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_simp_lor;
-    ASSERT(all_of_type_lorentzidx());
+    GINAC_ASSERT(all_of_type_lorentzidx());
 }
 
 simp_lor::simp_lor(simp_lor_types const t, string const & n, ex const & i1) :
@@ -111,7 +111,7 @@ simp_lor::simp_lor(simp_lor_types const t, string const & n, ex const & i1) :
 {
     debugmsg("simp_lor constructor from simp_lor_types,string,ex",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_simp_lor;
-    ASSERT(all_of_type_lorentzidx());
+    GINAC_ASSERT(all_of_type_lorentzidx());
 }
 
 simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector const & iv) :
@@ -119,7 +119,7 @@ simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector const & iv
 {
     debugmsg("simp_lor constructor from simp_lor_types,string,exvector",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_simp_lor;
-    ASSERT(all_of_type_lorentzidx());
+    GINAC_ASSERT(all_of_type_lorentzidx());
 }
 
 simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector * ivp) :
@@ -127,7 +127,7 @@ simp_lor::simp_lor(simp_lor_types const t, string const & n, exvector * ivp) :
 {
     debugmsg("simp_lor constructor from simp_lor_types,string,exvector*",LOGLEVEL_CONSTRUCT);
     tinfo_key=TINFO_simp_lor;
-    ASSERT(all_of_type_lorentzidx());
+    GINAC_ASSERT(all_of_type_lorentzidx());
 }
 
 //////////
@@ -239,7 +239,7 @@ ex simp_lor::eval(int level) const
 
 int simp_lor::compare_same_type(basic const & other) const
 {
-    ASSERT(other.tinfo() == TINFO_simp_lor);
+    GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
     const simp_lor *o = static_cast<const simp_lor *>(&other);
     if (type==o->type) {
         if (name==o->name) {
@@ -252,7 +252,7 @@ int simp_lor::compare_same_type(basic const & other) const
 
 bool simp_lor::is_equal_same_type(basic const & other) const
 {
-    ASSERT(other.tinfo() == TINFO_simp_lor);
+    GINAC_ASSERT(other.tinfo() == TINFO_simp_lor);
     const simp_lor *o = static_cast<const simp_lor *>(&other);
     if (type!=o->type) return false;
     if (name!=o->name) return false;
@@ -329,7 +329,7 @@ simp_lor lor_vec(string const & n, ex const & mu)
 
 ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp)
 {
-    ASSERT(is_ex_exactly_of_type(m,mul));
+    GINAC_ASSERT(is_ex_exactly_of_type(m,mul));
     exvector v_contracted;
 
     // collect factors in an exvector, store squares twice
@@ -354,11 +354,11 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp)
         if (is_ex_exactly_of_type(*it,simp_lor) &&
             (ex_to_simp_lor(*it).type==simp_lor::simp_lor_g)) {
             simp_lor const & g=ex_to_simp_lor(*it);
-            ASSERT(g.seq.size()==2);
+            GINAC_ASSERT(g.seq.size()==2);
             idx const & first_idx=ex_to_lorentzidx(g.seq[0]);
             idx const & second_idx=ex_to_lorentzidx(g.seq[1]);
             // g_{mu,mu} should have been contracted in simp_lor::eval()
-            ASSERT(!first_idx.is_equal(second_idx));
+            GINAC_ASSERT(!first_idx.is_equal(second_idx));
             ex saved_g=*it; // save to restore it later
 
             // try to contract first index
@@ -371,7 +371,7 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp)
                     *it=saved_g;
                 } else {
                     // a contracted index should occur exactly once
-                    ASSERT(replacements==1);
+                    GINAC_ASSERT(replacements==1);
                     *it=exONE();
                     something_changed=true;
                 }
@@ -387,7 +387,7 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp)
                     *it=saved_g;
                 } else {
                     // a contracted index should occur exactly once
-                    ASSERT(replacements==1);
+                    GINAC_ASSERT(replacements==1);
                     *it=exONE();
                     something_changed=true;
                 }
@@ -408,8 +408,8 @@ ex simplify_simp_lor_mul(ex const & m, scalar_products const & sp)
                     (ex_to_simp_lor(*it2).type==simp_lor::simp_lor_vec)) {
                     simp_lor const & vec1=ex_to_simp_lor(*it1);
                     simp_lor const & vec2=ex_to_simp_lor(*it2);
-                    ASSERT(vec1.seq.size()==1);
-                    ASSERT(vec2.seq.size()==1);
+                    GINAC_ASSERT(vec1.seq.size()==1);
+                    GINAC_ASSERT(vec2.seq.size()==1);
                     lorentzidx const & idx1=ex_to_lorentzidx(vec1.seq[0]);
                     lorentzidx const & idx2=ex_to_lorentzidx(vec2.seq[0]);
                     if (idx1.is_symbolic() &&
@@ -506,10 +506,10 @@ void scalar_products::debugprint(void) const
 
 spmapkey scalar_products::make_key(simp_lor const & v1, simp_lor const & v2)
 {
-    ASSERT(v1.type==simp_lor::simp_lor_vec);
-    ASSERT(v2.type==simp_lor::simp_lor_vec);
+    GINAC_ASSERT(v1.type==simp_lor::simp_lor_vec);
+    GINAC_ASSERT(v2.type==simp_lor::simp_lor_vec);
     lorentzidx anon=ex_to_lorentzidx(v1.seq[0]).create_anonymous_representative();
-    ASSERT(anon.is_equal_same_type(ex_to_lorentzidx(v2.seq[0]).create_anonymous_representative()));
+    GINAC_ASSERT(anon.is_equal_same_type(ex_to_lorentzidx(v2.seq[0]).create_anonymous_representative()));
     return spmapkey(strstrpair(v1.name,v2.name),anon);
 }
 
index 55ec582..539eaf7 100644 (file)
@@ -125,13 +125,13 @@ void structure::printcsrc(ostream & os, unsigned type, unsigned upper_precedence
 
 int structure::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, structure));
+    GINAC_ASSERT(is_of_type(other, structure));
     return 0; // all structures are the same
 }
 
 bool structure::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other, structure));
+    GINAC_ASSERT(is_of_type(other, structure));
     return true; // all structures are the same
 }
 
index b6137d0..2ae1625 100755 (executable)
@@ -354,8 +354,8 @@ int ${STRUCTURE}::nops() const
 
 ex & ${STRUCTURE}::let_op(int const i)
 {
-    ASSERT(i>=0);
-    ASSERT(i<nops());
+    GINAC_ASSERT(i>=0);
+    GINAC_ASSERT(i<nops());
 
     switch (i) {
 ${let_op_statements}
@@ -378,7 +378,7 @@ ${expand_statements}
 
 bool ${STRUCTURE}::has(ex const & other) const
 {
-    ASSERT(other.bp!=0);
+    GINAC_ASSERT(other.bp!=0);
     if (is_equal(*other.bp)) return true;
 ${has_statements}
     return false;
@@ -450,7 +450,7 @@ ${subs_statements}
 
 int ${STRUCTURE}::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,${STRUCTURE}));
+    GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
     ${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
                                     (const_cast<basic &>(other));
     int cmpval;
@@ -460,7 +460,7 @@ ${compare_statements}
 
 bool ${STRUCTURE}::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,${STRUCTURE}));
+    GINAC_ASSERT(is_of_type(other,${STRUCTURE}));
     ${STRUCTURE} const & o=static_cast<${STRUCTURE} const &>
                                     (const_cast<basic &>(other));
 ${is_equal_statements}
index 2d42b5a..f1dc18d 100644 (file)
@@ -168,13 +168,13 @@ ex symbol::eval(int level) const
 
 ex symbol::subs(lst const & ls, lst const & lr) const
 {
-    ASSERT(ls.nops()==lr.nops());
-#ifdef DOASSERT
+    GINAC_ASSERT(ls.nops()==lr.nops());
+#ifdef DO_GINAC_ASSERT
     for (int i=0; i<ls.nops(); i++) {
-        ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
+        GINAC_ASSERT(is_ex_exactly_of_type(ls.op(i),symbol)||
                is_ex_of_type(ls.op(i),idx));
     }
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
 
     for (int i=0; i<ls.nops(); i++) {
         if (is_ex_exactly_of_type(ls.op(i),symbol)) {
@@ -188,7 +188,7 @@ ex symbol::subs(lst const & ls, lst const & lr) const
 
 int symbol::compare_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,symbol));
+    GINAC_ASSERT(is_of_type(other,symbol));
     const symbol *o = static_cast<const symbol *>(&other);
     if (serial==o->serial) return 0;
     return serial < o->serial ? -1 : 1;
@@ -196,7 +196,7 @@ int symbol::compare_same_type(basic const & other) const
 
 bool symbol::is_equal_same_type(basic const & other) const
 {
-    ASSERT(is_of_type(other,symbol));
+    GINAC_ASSERT(is_of_type(other,symbol));
     const symbol *o = static_cast<const symbol *>(&other);
     return serial==o->serial;
 }
index 814654c..3c33162 100644 (file)
@@ -53,7 +53,7 @@ inline unsigned rotate_left_31(unsigned n)
     if (n & 0x80000000U) {
         n=(n & 0x7FFFFFFFU) | 0x00000001U;
     }
-    ASSERT(n<0x80000000U);
+    GINAC_ASSERT(n<0x80000000U);
 
     return n;
 }