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)
tinfo_key = TINFO_add;
overall_coeff=exZERO();
construct_from_exvector(v);
- ASSERT(is_canonical());
+ GINAC_ASSERT(is_canonical());
}
/*
} else {
construct_from_epvector(v);
}
- ASSERT(is_canonical());
+ GINAC_ASSERT(is_canonical());
}
*/
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)
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());
}
//////////
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;
}
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;
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;
}
{
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) &&
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) &&
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;
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());
}
#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__
{
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)
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++) {
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)) {
if (typeid_this!=typeid_other) return false;
- ASSERT(typeid(*this)==typeid(other));
+ GINAC_ASSERT(typeid(*this)==typeid(other));
return is_equal_same_type(other);
}
#ifdef INLINE_BASIC_CONSTRUCTORS
{
destroy(0);
- ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
+ GINAC_ASSERT((!(flags & status_flags::dynallocated))||(refcount==0));
}
#else
;
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);
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());
}
//////////
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]);
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]);
// 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();
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)||
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) {
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;
// 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
*it=saved_delta8;
} else {
// a contracted index should occur exactly twice
- ASSERT(replacements==2);
+ GINAC_ASSERT(replacements==2);
*it=exONE();
something_changed=true;
}
*it=saved_delta8;
} else {
// a contracted index should occur exactly twice
- ASSERT(replacements==2);
+ GINAC_ASSERT(replacements==2);
*it=exONE();
something_changed=true;
}
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);
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);
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);
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) {
// 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) {
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 {
}
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:
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;
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
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;
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]);
// 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);
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);
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;
}
$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++) {
${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;
}
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;
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;
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;
#ifdef _DEBUG
#define VERBOSE
-#define DOASSERT (VERBOSE||DEBUG)
+#define DO_GINAC_ASSERT (VERBOSE||DEBUG)
#endif
#define LOGLEVEL_CONSTRUCT 0x0001
ex ex::diff(symbol const & s, unsigned nth) const
{
- ASSERT(bp!=0);
+ GINAC_ASSERT(bp!=0);
if ( nth==0 ) {
return *this;
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;
}
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) {
{
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;
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);
}
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);
}
{
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;
#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;
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();
}
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;
--bp->refcount;
bp=bp2;
}
- ASSERT(bp->refcount == 1);
+ GINAC_ASSERT(bp->refcount == 1);
}
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);
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);
}
//////////
#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
~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;
}
#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
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) {
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;
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;
~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)
{
}
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);
}
{
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());
}
/*
} else {
construct_from_epvector(v);
}
- ASSERT(is_canonical());
+ GINAC_ASSERT(is_canonical());
}
*/
{
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());
}
//////////
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;
}
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;
//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();
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
other.printtree(cout,0);
}
- ASSERT(hashtabsize==o.hashtabsize);
+ GINAC_ASSERT(hashtabsize==o.hashtabsize);
if (hashtabsize==0) {
#endif // def EXPAIRSEQ_USE_HASHTAB
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);
}
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)));
}
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)));
}
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
}
// 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;
}
// 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;
}
{
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;
}
++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);
}
++epplit;
}
- ASSERT(epplit!=eppl.end());
+ GINAC_ASSERT(epplit!=eppl.end());
}
void expairseq::sorted_insert(epplist & eppl, epp elem)
}
}
}
- ASSERT(i==current-seq.begin());
+ GINAC_ASSERT(i==current-seq.begin());
}
bool expairseq::has_coeff_0(void) const
if (hashtabsize==0) {
canonicalize();
combine_same_terms_sorted_seq();
- ASSERT(!has_coeff_0());
+ GINAC_ASSERT(!has_coeff_0());
return;
}
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;
}
// 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
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;
}
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;
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;
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;
ex & exprseq::let_op(int const i)
{
- ASSERT(i>=0);
- ASSERT(i<nops());
+ GINAC_ASSERT(i>=0);
+ GINAC_ASSERT(i<nops());
return seq[i];
}
{
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) {
{
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);
{
debugmsg("function printtree",LOGLEVEL_PRINT);
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
os << string(indent,' ') << "function "
<< registered_functions()[serial].name
{
debugmsg("function print csrc",LOGLEVEL_PRINT);
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
// Print function name in lowercase
string lname;
ex function::eval(int level) const
{
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
exvector eseq=evalchildren(level);
ex function::evalf(int level) const
{
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
exvector eseq=evalfchildren(level);
* @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);
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) {
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;
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"));
{
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) {
{
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);
{
debugmsg("function printtree",LOGLEVEL_PRINT);
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
os << string(indent,' ') << "function "
<< registered_functions()[serial].name
{
debugmsg("function print csrc",LOGLEVEL_PRINT);
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
// Print function name in lowercase
string lname;
ex function::eval(int level) const
{
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
exvector eseq=evalchildren(level);
ex function::evalf(int level) const
{
- ASSERT(serial<registered_functions().size());
+ GINAC_ASSERT(serial<registered_functions().size());
exvector eseq=evalfchildren(level);
* \@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);
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) {
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;
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"));
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)) {
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));
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));
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));
// 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;
// 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;
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);
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]);
{
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)
{
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());
}
//////////
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);
}
}
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
}
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)
}
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);
}
static ex exp_diff(ex const & x, unsigned diff_param)
{
- ASSERT(diff_param==0);
+ GINAC_ASSERT(diff_param==0);
return exp(x);
}
static ex log_diff(ex const & x, unsigned diff_param)
{
- ASSERT(diff_param==0);
+ GINAC_ASSERT(diff_param==0);
return power(x, -1);
}
static ex sin_diff(ex const & x, unsigned diff_param)
{
- ASSERT(diff_param==0);
+ GINAC_ASSERT(diff_param==0);
return cos(x);
}
static ex cos_diff(ex const & x, unsigned diff_param)
{
- ASSERT(diff_param==0);
+ GINAC_ASSERT(diff_param==0);
return numMINUSONE()*sin(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()));
}
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());
}
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());
}
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);
}
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)
static ex sinh_diff(ex const & x, unsigned diff_param)
{
- ASSERT(diff_param==0);
+ GINAC_ASSERT(diff_param==0);
return cosh(x);
}
static ex cosh_diff(ex const & x, unsigned diff_param)
{
- ASSERT(diff_param==0);
+ GINAC_ASSERT(diff_param==0);
return sinh(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());
}
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());
}
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());
}
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());
}
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);
}
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);
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";
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;
}
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++) {
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;
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;
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;
* 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;
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
* 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;
* 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);
* 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);
* 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);
}
*/
-#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) {
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);
}
*/
-#ifdef DOASSERT
+#ifdef DO_GINAC_ASSERT
// test solution with echelon matrix
for (int r=1; r<=m; ++r) {
ex e=0;
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
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;
}
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)
tinfo_key = TINFO_mul;
overall_coeff=exONE();
construct_from_exvector(v);
- ASSERT(is_canonical());
+ GINAC_ASSERT(is_canonical());
}
/*
} else {
construct_from_epvector(v);
}
- ASSERT(is_canonical());
+ GINAC_ASSERT(is_canonical());
}
*/
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)
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)
factors.push_back(rh);
overall_coeff=exONE();
construct_from_exvector(factors);
- ASSERT(is_canonical());
+ GINAC_ASSERT(is_canonical());
}
//////////
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())));
}
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;
}
}
} while (cit!=seq.begin());
}
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
return *this;
}
}
-#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())));
}
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;
}
}
} while (cit!=seq.begin());
}
-#endif // def DOASSERT
+#endif // def DO_GINAC_ASSERT
if (flags & status_flags::evaluated) {
return *this;
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;
}
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
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]));
}
/*
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]]);
}
}
++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)
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;
}
}
-#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) {
}
}
// 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;
}
numeric ex::integer_content(void) const
{
- ASSERT(bp!=0);
+ GINAC_ASSERT(bp!=0);
return bp->integer_content();
}
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));
}
numeric ex::max_coefficient(void) const
{
- ASSERT(bp!=0);
+ GINAC_ASSERT(bp!=0);
return bp->max_coefficient();
}
{
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;
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));
}
ex ex::smod(const numeric &xi) const
{
- ASSERT(bp!=0);
+ GINAC_ASSERT(bp!=0);
return bp->smod(xi);
}
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);
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) {
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);
* 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));
}
* 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));
}
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);
}
//////////
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;
}
|| 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()
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));
}
// ^(*(...,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);
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();
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;
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)) {
}
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)) {
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)) {
}
}
- 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);
}
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)||
}
}
- 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())) {
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);
}
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();
}
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 ";
void ex::printraw(ostream & os) const
{
debugmsg("ex printraw",LOGLEVEL_PRINT);
- ASSERT(bp!=0);
+ GINAC_ASSERT(bp!=0);
os << "ex(";
bp->printraw(os);
os << ")";
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);
}
void ex::dbgprinttree(void) const
{
debugmsg("ex dbgprinttree",LOGLEVEL_PRINT);
- ASSERT(bp!=0);
+ GINAC_ASSERT(bp!=0);
bp->dbgprinttree();
}
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;
}
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;
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();
}
: 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));
}
* @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);
}
{
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) :
{
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) :
{
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) :
{
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());
}
//////////
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) {
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;
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
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
*it=saved_g;
} else {
// a contracted index should occur exactly once
- ASSERT(replacements==1);
+ GINAC_ASSERT(replacements==1);
*it=exONE();
something_changed=true;
}
*it=saved_g;
} else {
// a contracted index should occur exactly once
- ASSERT(replacements==1);
+ GINAC_ASSERT(replacements==1);
*it=exONE();
something_changed=true;
}
(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() &&
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);
}
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
}
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}
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;
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;
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}
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)) {
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;
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;
}
if (n & 0x80000000U) {
n=(n & 0x7FFFFFFFU) | 0x00000001U;
}
- ASSERT(n<0x80000000U);
+ GINAC_ASSERT(n<0x80000000U);
return n;
}