]> www.ginac.de Git - ginac.git/commitdiff
cleaned up some is_a<> vs. is_exactly_a<> stuff
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 3 Dec 2002 21:52:15 +0000 (21:52 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 3 Dec 2002 21:52:15 +0000 (21:52 +0000)
ginac/idx.cpp
ginac/indexed.cpp
ginac/inifcns.cpp
ginac/inifcns_gamma.cpp
ginac/inifcns_trans.cpp
ginac/matrix.cpp
ginac/mul.cpp
ginac/normal.cpp
ginac/power.cpp
ginac/pseries.cpp

index 63d29971bff122f3e34e40ba9a6eb866acbd7717..26d63910cbfdf0ed395fefee25dadb81a0726196 100644 (file)
@@ -161,7 +161,7 @@ void idx::print(const print_context & c, unsigned level) const
                        c.s << "{";
                else
                        c.s << ".";
                        c.s << "{";
                else
                        c.s << ".";
-               bool need_parens = !(is_ex_exactly_of_type(value, numeric) || is_ex_of_type(value, symbol));
+               bool need_parens = !(is_exactly_a<numeric>(value) || is_a<symbol>(value));
                if (need_parens)
                        c.s << "(";
                value.print(c);
                if (need_parens)
                        c.s << "(";
                value.print(c);
@@ -193,7 +193,7 @@ void varidx::print(const print_context & c, unsigned level) const
                        else
                                c.s << "~";
                }
                        else
                                c.s << "~";
                }
-               bool need_parens = !(is_ex_exactly_of_type(value, numeric) || is_ex_of_type(value, symbol));
+               bool need_parens = !(is_exactly_a<numeric>(value) || is_a<symbol>(value));
                if (need_parens)
                        c.s << "(";
                value.print(c);
                if (need_parens)
                        c.s << "(";
                value.print(c);
@@ -237,7 +237,7 @@ void spinidx::print(const print_context & c, unsigned level) const
                        else
                                c.s << "*";
                }
                        else
                                c.s << "*";
                }
-               bool need_parens = !(is_ex_exactly_of_type(value, numeric) || is_ex_of_type(value, symbol));
+               bool need_parens = !(is_exactly_a<numeric>(value) || is_a<symbol>(value));
                if (need_parens)
                        c.s << "(";
                value.print(c);
                if (need_parens)
                        c.s << "(";
                value.print(c);
@@ -357,7 +357,7 @@ ex idx::subs(const lst & ls, const lst & lr, bool no_pattern) const
                if (is_equal(ex_to<basic>(ls.op(i)))) {
 
                        // Substitution index->index
                if (is_equal(ex_to<basic>(ls.op(i)))) {
 
                        // Substitution index->index
-                       if (is_ex_of_type(lr.op(i), idx))
+                       if (is_a<idx>(lr.op(i)))
                                return lr.op(i);
 
                        // Otherwise substitute value
                                return lr.op(i);
 
                        // Otherwise substitute value
@@ -397,7 +397,7 @@ bool idx::is_dummy_pair_same_type(const basic & other) const
 
        // Only pure symbols form dummy pairs, numeric indices and expressions
        // like "2n+1" don't
 
        // Only pure symbols form dummy pairs, numeric indices and expressions
        // like "2n+1" don't
-       if (!is_ex_of_type(value, symbol))
+       if (!is_a<symbol>(value))
                return false;
 
        // Value must be equal, of course
                return false;
 
        // Value must be equal, of course
@@ -409,7 +409,7 @@ bool idx::is_dummy_pair_same_type(const basic & other) const
        if (dim.is_equal(o.dim))
                return true;
 
        if (dim.is_equal(o.dim))
                return true;
 
-       return (dim < o.dim || dim > o.dim || (is_a<numeric>(dim) && is_a<symbol>(o.dim)) || (is_a<symbol>(dim) && is_a<numeric>(o.dim)));
+       return (dim < o.dim || dim > o.dim || (is_exactly_a<numeric>(dim) && is_a<symbol>(o.dim)) || (is_a<symbol>(dim) && is_exactly_a<numeric>(o.dim)));
 }
 
 bool varidx::is_dummy_pair_same_type(const basic & other) const
 }
 
 bool varidx::is_dummy_pair_same_type(const basic & other) const
@@ -449,9 +449,9 @@ ex idx::replace_dim(const ex & new_dim) const
 
 ex idx::minimal_dim(const idx & other) const
 {
 
 ex idx::minimal_dim(const idx & other) const
 {
-       if (dim.is_equal(other.dim) || dim < other.dim || (is_a<numeric>(dim) && is_a<symbol>(other.dim)))
+       if (dim.is_equal(other.dim) || dim < other.dim || (is_exactly_a<numeric>(dim) && is_a<symbol>(other.dim)))
                return dim;
                return dim;
-       else if (dim > other.dim || (is_a<symbol>(dim) && is_a<numeric>(other.dim)))
+       else if (dim > other.dim || (is_a<symbol>(dim) && is_exactly_a<numeric>(other.dim)))
                return other.dim;
        else
                throw (std::runtime_error("idx::minimal_dim: index dimensions cannot be ordered"));
                return other.dim;
        else
                throw (std::runtime_error("idx::minimal_dim: index dimensions cannot be ordered"));
@@ -499,7 +499,7 @@ bool is_dummy_pair(const idx & i1, const idx & i2)
 bool is_dummy_pair(const ex & e1, const ex & e2)
 {
        // The expressions must be indices
 bool is_dummy_pair(const ex & e1, const ex & e2)
 {
        // The expressions must be indices
-       if (!is_ex_of_type(e1, idx) || !is_ex_of_type(e2, idx))
+       if (!is_a<idx>(e1) || !is_a<idx>(e2))
                return false;
 
        return is_dummy_pair(ex_to<idx>(e1), ex_to<idx>(e2));
                return false;
 
        return is_dummy_pair(ex_to<idx>(e1), ex_to<idx>(e2));
index e32f4c7a103f047cc09a5332665b7ef0e6c91ef8..d639e3022c387d357a903c2fcd8be7351422824b 100644 (file)
@@ -820,13 +820,13 @@ public:
 
        symminfo(const ex & symmterm_, const ex & orig_)
        {
 
        symminfo(const ex & symmterm_, const ex & orig_)
        {
-               if (is_a<mul>(orig_) && is_a<numeric>(orig_.op(orig_.nops()-1))) {
+               if (is_exactly_a<mul>(orig_) && is_exactly_a<numeric>(orig_.op(orig_.nops()-1))) {
                        ex tmp = orig_.op(orig_.nops()-1);
                        orig = orig_ / tmp;
                } else 
                        orig = orig_;
 
                        ex tmp = orig_.op(orig_.nops()-1);
                        orig = orig_ / tmp;
                } else 
                        orig = orig_;
 
-               if (is_a<mul>(symmterm_) && is_a<numeric>(symmterm_.op(symmterm_.nops()-1))) {
+               if (is_exactly_a<mul>(symmterm_) && is_exactly_a<numeric>(symmterm_.op(symmterm_.nops()-1))) {
                        coeff = symmterm_.op(symmterm_.nops()-1);
                        symmterm = symmterm_ / coeff;
                } else {
                        coeff = symmterm_.op(symmterm_.nops()-1);
                        symmterm = symmterm_ / coeff;
                } else {
@@ -937,7 +937,7 @@ ex simplify_indexed(const ex & e, exvector & free_indices, exvector & dummy_indi
                }
 
                // Symmetrizing over the dummy indices may cancel terms
                }
 
                // Symmetrizing over the dummy indices may cancel terms
-               int num_terms_orig = (is_a<add>(sum) ? sum.nops() : 1);
+               int num_terms_orig = (is_exactly_a<add>(sum) ? sum.nops() : 1);
                if (num_terms_orig > 1 && dummy_indices.size() >= 2) {
 
                        // Construct list of all dummy index symbols
                if (num_terms_orig > 1 && dummy_indices.size() >= 2) {
 
                        // Construct list of all dummy index symbols
@@ -950,7 +950,7 @@ ex simplify_indexed(const ex & e, exvector & free_indices, exvector & dummy_indi
                        std::vector<symminfo> v;
                        for (int i=0; i<sum.nops(); i++) {
                                ex sum_symm = sum.op(i).symmetrize(dummy_syms);
                        std::vector<symminfo> v;
                        for (int i=0; i<sum.nops(); i++) {
                                ex sum_symm = sum.op(i).symmetrize(dummy_syms);
-                               if (is_a<add>(sum_symm))
+                               if (is_exactly_a<add>(sum_symm))
                                        for (int j=0; j<sum_symm.nops(); j++)
                                                v.push_back(symminfo(sum_symm.op(j), sum.op(i)));
                                else
                                        for (int j=0; j<sum_symm.nops(); j++)
                                                v.push_back(symminfo(sum_symm.op(j), sum.op(i)));
                                else
index c6b14c6b63e768032efe0efc720a542094a65c0b..745223062a70a0f0ba9332942bdeece970f7a05f 100644 (file)
@@ -79,7 +79,7 @@ static ex csgn_eval(const ex & arg)
        if (is_ex_exactly_of_type(arg, numeric))
                return csgn(ex_to<numeric>(arg));
        
        if (is_ex_exactly_of_type(arg, numeric))
                return csgn(ex_to<numeric>(arg));
        
-       else if (is_ex_of_type(arg, mul) &&
+       else if (is_ex_exactly_of_type(arg, mul) &&
                 is_ex_of_type(arg.op(arg.nops()-1),numeric)) {
                numeric oc = ex_to<numeric>(arg.op(arg.nops()-1));
                if (oc.is_real()) {
                 is_ex_of_type(arg.op(arg.nops()-1),numeric)) {
                numeric oc = ex_to<numeric>(arg.op(arg.nops()-1));
                if (oc.is_real()) {
@@ -419,7 +419,7 @@ static ex Order_series(const ex & x, const relational & r, int order, unsigned o
 {
        // Just wrap the function into a pseries object
        epvector new_seq;
 {
        // Just wrap the function into a pseries object
        epvector new_seq;
-       GINAC_ASSERT(is_exactly_a<symbol>(r.lhs()));
+       GINAC_ASSERT(is_a<symbol>(r.lhs()));
        const symbol &s = ex_to<symbol>(r.lhs());
        new_seq.push_back(expair(Order(_ex1), numeric(std::min(x.ldegree(s), order))));
        return pseries(r, new_seq);
        const symbol &s = ex_to<symbol>(r.lhs());
        new_seq.push_back(expair(Order(_ex1), numeric(std::min(x.ldegree(s), order))));
        return pseries(r, new_seq);
index 15b1a9a5e851ea19dc68992a576de7eee5c0febe..1beab9eaffb2d33faab5efda09fa0e4d14014ab3 100644 (file)
@@ -291,7 +291,7 @@ static ex beta_series(const ex & arg1,
        // tgamma series directly.
        const ex arg1_pt = arg1.subs(rel);
        const ex arg2_pt = arg2.subs(rel);
        // tgamma series directly.
        const ex arg1_pt = arg1.subs(rel);
        const ex arg2_pt = arg2.subs(rel);
-       GINAC_ASSERT(is_exactly_a<symbol>(rel.lhs()));
+       GINAC_ASSERT(is_a<symbol>(rel.lhs()));
        const symbol &s = ex_to<symbol>(rel.lhs());
        ex arg1_ser, arg2_ser, arg1arg2_ser;
        if ((!arg1_pt.info(info_flags::integer) || arg1_pt.info(info_flags::positive)) &&
        const symbol &s = ex_to<symbol>(rel.lhs());
        ex arg1_ser, arg2_ser, arg1arg2_ser;
        if ((!arg1_pt.info(info_flags::integer) || arg1_pt.info(info_flags::positive)) &&
index 9db0cbd11c9c527c74c1646343c2945ee79e2d5e..ec2fb91187f0d22bb4731c3a06f83e5aff54c423 100644 (file)
@@ -154,7 +154,7 @@ static ex log_series(const ex &arg,
                      int order,
                      unsigned options)
 {
                      int order,
                      unsigned options)
 {
-       GINAC_ASSERT(is_exactly_a<symbol>(rel.lhs()));
+       GINAC_ASSERT(is_a<symbol>(rel.lhs()));
        ex arg_pt;
        bool must_expand_arg = false;
        // maybe substitution of rel into arg fails because of a pole
        ex arg_pt;
        bool must_expand_arg = false;
        // maybe substitution of rel into arg fails because of a pole
@@ -468,7 +468,7 @@ static ex tan_series(const ex &x,
                      int order,
                      unsigned options)
 {
                      int order,
                      unsigned options)
 {
-       GINAC_ASSERT(is_exactly_a<symbol>(rel.lhs()));
+       GINAC_ASSERT(is_a<symbol>(rel.lhs()));
        // method:
        // Taylor series where there is no pole falls back to tan_deriv.
        // On a pole simply expand sin(x)/cos(x).
        // method:
        // Taylor series where there is no pole falls back to tan_deriv.
        // On a pole simply expand sin(x)/cos(x).
@@ -634,7 +634,7 @@ static ex atan_series(const ex &arg,
                       int order,
                       unsigned options)
 {
                       int order,
                       unsigned options)
 {
-       GINAC_ASSERT(is_exactly_a<symbol>(rel.lhs()));
+       GINAC_ASSERT(is_a<symbol>(rel.lhs()));
        // method:
        // Taylor series where there is no pole or cut falls back to atan_deriv.
        // There are two branch cuts, one runnig from I up the imaginary axis and
        // method:
        // Taylor series where there is no pole or cut falls back to atan_deriv.
        // There are two branch cuts, one runnig from I up the imaginary axis and
@@ -878,7 +878,7 @@ static ex tanh_series(const ex &x,
                       int order,
                       unsigned options)
 {
                       int order,
                       unsigned options)
 {
-       GINAC_ASSERT(is_exactly_a<symbol>(rel.lhs()));
+       GINAC_ASSERT(is_a<symbol>(rel.lhs()));
        // method:
        // Taylor series where there is no pole falls back to tanh_deriv.
        // On a pole simply expand sinh(x)/cosh(x).
        // method:
        // Taylor series where there is no pole falls back to tanh_deriv.
        // On a pole simply expand sinh(x)/cosh(x).
@@ -1019,7 +1019,7 @@ static ex atanh_series(const ex &arg,
                        int order,
                        unsigned options)
 {
                        int order,
                        unsigned options)
 {
-       GINAC_ASSERT(is_exactly_a<symbol>(rel.lhs()));
+       GINAC_ASSERT(is_a<symbol>(rel.lhs()));
        // method:
        // Taylor series where there is no pole or cut falls back to atanh_deriv.
        // There are two branch cuts, one runnig from 1 up the real axis and one
        // method:
        // Taylor series where there is no pole or cut falls back to atanh_deriv.
        // There are two branch cuts, one runnig from 1 up the real axis and one
index eaf4468a33742248ea252add319d5a522e6bc5d3..46d7a64cd9faa2330cca7a035e9782c2cb334da6 100644 (file)
@@ -1418,11 +1418,11 @@ int matrix::pivot(unsigned ro, unsigned co, bool symbolic)
                        ++k;
        } else {
                // search largest element in column co beginning at row ro
                        ++k;
        } else {
                // search largest element in column co beginning at row ro
-               GINAC_ASSERT(is_a<numeric>(this->m[k*col+co]));
+               GINAC_ASSERT(is_exactly_a<numeric>(this->m[k*col+co]));
                unsigned kmax = k+1;
                numeric mmax = abs(ex_to<numeric>(m[kmax*col+co]));
                while (kmax<row) {
                unsigned kmax = k+1;
                numeric mmax = abs(ex_to<numeric>(m[kmax*col+co]));
                while (kmax<row) {
-                       GINAC_ASSERT(is_a<numeric>(this->m[kmax*col+co]));
+                       GINAC_ASSERT(is_exactly_a<numeric>(this->m[kmax*col+co]));
                        numeric tmp = ex_to<numeric>(this->m[kmax*col+co]);
                        if (abs(tmp) > mmax) {
                                mmax = tmp;
                        numeric tmp = ex_to<numeric>(this->m[kmax*col+co]);
                        if (abs(tmp) > mmax) {
                                mmax = tmp;
index f60937069bea7dc00abd5e0bbe8dd3947af19a6a..63f6381d27c4e960500b0d3b7ab2770576d36aec 100644 (file)
@@ -224,7 +224,7 @@ void mul::print(const print_context & c, unsigned level) const
                        // and all others
                        exvector neg_powers, others;
                        while (it != itend) {
                        // and all others
                        exvector neg_powers, others;
                        while (it != itend) {
-                               GINAC_ASSERT(is_a<numeric>(it->coeff));
+                               GINAC_ASSERT(is_exactly_a<numeric>(it->coeff));
                                if (ex_to<numeric>(it->coeff).is_negative())
                                        neg_powers.push_back(recombine_pair_to_ex(expair(it->rest, -(it->coeff))));
                                else
                                if (ex_to<numeric>(it->coeff).is_negative())
                                        neg_powers.push_back(recombine_pair_to_ex(expair(it->rest, -(it->coeff))));
                                else
index e1d7349fa509b600cf8321c54a5ca1ed0a93180d..936957fe55e929df7bb58b647d184c097146c655 100644 (file)
@@ -92,14 +92,14 @@ static struct _stat_print {
  *  @return "false" if no symbol was found, "true" otherwise */
 static bool get_first_symbol(const ex &e, const symbol *&x)
 {
  *  @return "false" if no symbol was found, "true" otherwise */
 static bool get_first_symbol(const ex &e, const symbol *&x)
 {
-       if (is_ex_exactly_of_type(e, symbol)) {
+       if (is_a<symbol>(e)) {
                x = &ex_to<symbol>(e);
                return true;
                x = &ex_to<symbol>(e);
                return true;
-       } else if (is_ex_exactly_of_type(e, add) || is_ex_exactly_of_type(e, mul)) {
+       } else if (is_exactly_a<add>(e) || is_exactly_a<mul>(e)) {
                for (unsigned i=0; i<e.nops(); i++)
                        if (get_first_symbol(e.op(i), x))
                                return true;
                for (unsigned i=0; i<e.nops(); i++)
                        if (get_first_symbol(e.op(i), x))
                                return true;
-       } else if (is_ex_exactly_of_type(e, power)) {
+       } else if (is_exactly_a<power>(e)) {
                if (get_first_symbol(e.op(0), x))
                        return true;
        }
                if (get_first_symbol(e.op(0), x))
                        return true;
        }
@@ -169,12 +169,12 @@ static void add_symbol(const symbol *s, sym_desc_vec &v)
 // Collect all symbols of an expression (used internally by get_symbol_stats())
 static void collect_symbols(const ex &e, sym_desc_vec &v)
 {
 // Collect all symbols of an expression (used internally by get_symbol_stats())
 static void collect_symbols(const ex &e, sym_desc_vec &v)
 {
-       if (is_ex_exactly_of_type(e, symbol)) {
+       if (is_a<symbol>(e)) {
                add_symbol(&ex_to<symbol>(e), v);
                add_symbol(&ex_to<symbol>(e), v);
-       } else if (is_ex_exactly_of_type(e, add) || is_ex_exactly_of_type(e, mul)) {
+       } else if (is_exactly_a<add>(e) || is_exactly_a<mul>(e)) {
                for (unsigned i=0; i<e.nops(); i++)
                        collect_symbols(e.op(i), v);
                for (unsigned i=0; i<e.nops(); i++)
                        collect_symbols(e.op(i), v);
-       } else if (is_ex_exactly_of_type(e, power)) {
+       } else if (is_exactly_a<power>(e)) {
                collect_symbols(e.op(0), v);
        }
 }
                collect_symbols(e.op(0), v);
        }
 }
@@ -230,18 +230,18 @@ static numeric lcmcoeff(const ex &e, const numeric &l)
 {
        if (e.info(info_flags::rational))
                return lcm(ex_to<numeric>(e).denom(), l);
 {
        if (e.info(info_flags::rational))
                return lcm(ex_to<numeric>(e).denom(), l);
-       else if (is_ex_exactly_of_type(e, add)) {
+       else if (is_exactly_a<add>(e)) {
                numeric c = _num1;
                for (unsigned i=0; i<e.nops(); i++)
                        c = lcmcoeff(e.op(i), c);
                return lcm(c, l);
                numeric c = _num1;
                for (unsigned i=0; i<e.nops(); i++)
                        c = lcmcoeff(e.op(i), c);
                return lcm(c, l);
-       } else if (is_ex_exactly_of_type(e, mul)) {
+       } else if (is_exactly_a<mul>(e)) {
                numeric c = _num1;
                for (unsigned i=0; i<e.nops(); i++)
                        c *= lcmcoeff(e.op(i), _num1);
                return lcm(c, l);
                numeric c = _num1;
                for (unsigned i=0; i<e.nops(); i++)
                        c *= lcmcoeff(e.op(i), _num1);
                return lcm(c, l);
-       } else if (is_ex_exactly_of_type(e, power)) {
-               if (is_ex_exactly_of_type(e.op(0), symbol))
+       } else if (is_exactly_a<power>(e)) {
+               if (is_a<symbol>(e.op(0)))
                        return l;
                else
                        return pow(lcmcoeff(e.op(0), l), ex_to<numeric>(e.op(1)));
                        return l;
                else
                        return pow(lcmcoeff(e.op(0), l), ex_to<numeric>(e.op(1)));
@@ -268,7 +268,7 @@ static numeric lcm_of_coefficients_denominators(const ex &e)
  *  @param lcm  LCM to multiply in */
 static ex multiply_lcm(const ex &e, const numeric &lcm)
 {
  *  @param lcm  LCM to multiply in */
 static ex multiply_lcm(const ex &e, const numeric &lcm)
 {
-       if (is_ex_exactly_of_type(e, mul)) {
+       if (is_exactly_a<mul>(e)) {
                unsigned num = e.nops();
                exvector v; v.reserve(num + 1);
                numeric lcm_accum = _num1;
                unsigned num = e.nops();
                exvector v; v.reserve(num + 1);
                numeric lcm_accum = _num1;
@@ -279,14 +279,14 @@ static ex multiply_lcm(const ex &e, const numeric &lcm)
                }
                v.push_back(lcm / lcm_accum);
                return (new mul(v))->setflag(status_flags::dynallocated);
                }
                v.push_back(lcm / lcm_accum);
                return (new mul(v))->setflag(status_flags::dynallocated);
-       } else if (is_ex_exactly_of_type(e, add)) {
+       } else if (is_exactly_a<add>(e)) {
                unsigned num = e.nops();
                exvector v; v.reserve(num);
                for (unsigned i=0; i<num; i++)
                        v.push_back(multiply_lcm(e.op(i), lcm));
                return (new add(v))->setflag(status_flags::dynallocated);
                unsigned num = e.nops();
                exvector v; v.reserve(num);
                for (unsigned i=0; i<num; i++)
                        v.push_back(multiply_lcm(e.op(i), lcm));
                return (new add(v))->setflag(status_flags::dynallocated);
-       } else if (is_ex_exactly_of_type(e, power)) {
-               if (is_ex_exactly_of_type(e.op(0), symbol))
+       } else if (is_exactly_a<power>(e)) {
+               if (is_a<symbol>(e.op(0)))
                        return e * lcm;
                else
                        return pow(multiply_lcm(e.op(0), lcm.power(ex_to<numeric>(e.op(1)).inverse())), e.op(1));
                        return e * lcm;
                else
                        return pow(multiply_lcm(e.op(0), lcm.power(ex_to<numeric>(e.op(1)).inverse())), e.op(1));
@@ -364,7 +364,7 @@ ex quo(const ex &a, const ex &b, const symbol &x, bool check_args)
 {
        if (b.is_zero())
                throw(std::overflow_error("quo: division by zero"));
 {
        if (b.is_zero())
                throw(std::overflow_error("quo: division by zero"));
-       if (is_ex_exactly_of_type(a, numeric) && is_ex_exactly_of_type(b, numeric))
+       if (is_exactly_a<numeric>(a) && is_exactly_a<numeric>(b))
                return a / b;
 #if FAST_COMPARE
        if (a.is_equal(b))
                return a / b;
 #if FAST_COMPARE
        if (a.is_equal(b))
@@ -380,7 +380,7 @@ ex quo(const ex &a, const ex &b, const symbol &x, bool check_args)
        int bdeg = b.degree(x);
        int rdeg = r.degree(x);
        ex blcoeff = b.expand().coeff(x, bdeg);
        int bdeg = b.degree(x);
        int rdeg = r.degree(x);
        ex blcoeff = b.expand().coeff(x, bdeg);
-       bool blcoeff_is_numeric = is_ex_exactly_of_type(blcoeff, numeric);
+       bool blcoeff_is_numeric = is_exactly_a<numeric>(blcoeff);
        exvector v; v.reserve(std::max(rdeg - bdeg + 1, 0));
        while (rdeg >= bdeg) {
                ex term, rcoeff = r.coeff(x, rdeg);
        exvector v; v.reserve(std::max(rdeg - bdeg + 1, 0));
        while (rdeg >= bdeg) {
                ex term, rcoeff = r.coeff(x, rdeg);
@@ -414,8 +414,8 @@ ex rem(const ex &a, const ex &b, const symbol &x, bool check_args)
 {
        if (b.is_zero())
                throw(std::overflow_error("rem: division by zero"));
 {
        if (b.is_zero())
                throw(std::overflow_error("rem: division by zero"));
-       if (is_ex_exactly_of_type(a, numeric)) {
-               if  (is_ex_exactly_of_type(b, numeric))
+       if (is_exactly_a<numeric>(a)) {
+               if  (is_exactly_a<numeric>(b))
                        return _ex0;
                else
                        return a;
                        return _ex0;
                else
                        return a;
@@ -434,7 +434,7 @@ ex rem(const ex &a, const ex &b, const symbol &x, bool check_args)
        int bdeg = b.degree(x);
        int rdeg = r.degree(x);
        ex blcoeff = b.expand().coeff(x, bdeg);
        int bdeg = b.degree(x);
        int rdeg = r.degree(x);
        ex blcoeff = b.expand().coeff(x, bdeg);
-       bool blcoeff_is_numeric = is_ex_exactly_of_type(blcoeff, numeric);
+       bool blcoeff_is_numeric = is_exactly_a<numeric>(blcoeff);
        while (rdeg >= bdeg) {
                ex term, rcoeff = r.coeff(x, rdeg);
                if (blcoeff_is_numeric)
        while (rdeg >= bdeg) {
                ex term, rcoeff = r.coeff(x, rdeg);
                if (blcoeff_is_numeric)
@@ -464,7 +464,7 @@ ex decomp_rational(const ex &a, const symbol &x)
        ex nd = numer_denom(a);
        ex numer = nd.op(0), denom = nd.op(1);
        ex q = quo(numer, denom, x);
        ex nd = numer_denom(a);
        ex numer = nd.op(0), denom = nd.op(1);
        ex q = quo(numer, denom, x);
-       if (is_ex_exactly_of_type(q, fail))
+       if (is_exactly_a<fail>(q))
                return a;
        else
                return q + rem(numer, denom, x) / denom;
                return a;
        else
                return q + rem(numer, denom, x) / denom;
@@ -483,8 +483,8 @@ ex prem(const ex &a, const ex &b, const symbol &x, bool check_args)
 {
        if (b.is_zero())
                throw(std::overflow_error("prem: division by zero"));
 {
        if (b.is_zero())
                throw(std::overflow_error("prem: division by zero"));
-       if (is_ex_exactly_of_type(a, numeric)) {
-               if (is_ex_exactly_of_type(b, numeric))
+       if (is_exactly_a<numeric>(a)) {
+               if (is_exactly_a<numeric>(b))
                        return _ex0;
                else
                        return b;
                        return _ex0;
                else
                        return b;
@@ -535,8 +535,8 @@ ex sprem(const ex &a, const ex &b, const symbol &x, bool check_args)
 {
        if (b.is_zero())
                throw(std::overflow_error("prem: division by zero"));
 {
        if (b.is_zero())
                throw(std::overflow_error("prem: division by zero"));
-       if (is_ex_exactly_of_type(a, numeric)) {
-               if (is_ex_exactly_of_type(b, numeric))
+       if (is_exactly_a<numeric>(a)) {
+               if (is_exactly_a<numeric>(b))
                        return _ex0;
                else
                        return b;
                        return _ex0;
                else
                        return b;
@@ -590,10 +590,10 @@ bool divide(const ex &a, const ex &b, ex &q, bool check_args)
                q = _ex0;
                return true;
        }
                q = _ex0;
                return true;
        }
-       if (is_ex_exactly_of_type(b, numeric)) {
+       if (is_exactly_a<numeric>(b)) {
                q = a / b;
                return true;
                q = a / b;
                return true;
-       } else if (is_ex_exactly_of_type(a, numeric))
+       } else if (is_exactly_a<numeric>(a))
                return false;
 #if FAST_COMPARE
        if (a.is_equal(b)) {
                return false;
 #if FAST_COMPARE
        if (a.is_equal(b)) {
@@ -619,7 +619,7 @@ bool divide(const ex &a, const ex &b, ex &q, bool check_args)
        int bdeg = b.degree(*x);
        int rdeg = r.degree(*x);
        ex blcoeff = b.expand().coeff(*x, bdeg);
        int bdeg = b.degree(*x);
        int rdeg = r.degree(*x);
        ex blcoeff = b.expand().coeff(*x, bdeg);
-       bool blcoeff_is_numeric = is_ex_exactly_of_type(blcoeff, numeric);
+       bool blcoeff_is_numeric = is_exactly_a<numeric>(blcoeff);
        exvector v; v.reserve(std::max(rdeg - bdeg + 1, 0));
        while (rdeg >= bdeg) {
                ex term, rcoeff = r.coeff(*x, rdeg);
        exvector v; v.reserve(std::max(rdeg - bdeg + 1, 0));
        while (rdeg >= bdeg) {
                ex term, rcoeff = r.coeff(*x, rdeg);
@@ -686,8 +686,8 @@ static bool divide_in_z(const ex &a, const ex &b, ex &q, sym_desc_vec::const_ite
                q = a;
                return true;
        }
                q = a;
                return true;
        }
-       if (is_ex_exactly_of_type(a, numeric)) {
-               if (is_ex_exactly_of_type(b, numeric)) {
+       if (is_exactly_a<numeric>(a)) {
+               if (is_exactly_a<numeric>(b)) {
                        q = a / b;
                        return q.info(info_flags::integer);
                } else
                        q = a / b;
                        return q.info(info_flags::integer);
                } else
@@ -821,7 +821,7 @@ static bool divide_in_z(const ex &a, const ex &b, ex &q, sym_desc_vec::const_ite
 ex ex::unit(const symbol &x) const
 {
        ex c = expand().lcoeff(x);
 ex ex::unit(const symbol &x) const
 {
        ex c = expand().lcoeff(x);
-       if (is_ex_exactly_of_type(c, numeric))
+       if (is_exactly_a<numeric>(c))
                return c < _ex0 ? _ex_1 : _ex1;
        else {
                const symbol *y;
                return c < _ex0 ? _ex_1 : _ex1;
        else {
                const symbol *y;
@@ -844,7 +844,7 @@ ex ex::content(const symbol &x) const
 {
        if (is_zero())
                return _ex0;
 {
        if (is_zero())
                return _ex0;
-       if (is_ex_exactly_of_type(*this, numeric))
+       if (is_exactly_a<numeric>(*this))
                return info(info_flags::negative) ? -*this : *this;
        ex e = expand();
        if (e.is_zero())
                return info(info_flags::negative) ? -*this : *this;
        ex e = expand();
        if (e.is_zero())
@@ -880,14 +880,14 @@ ex ex::primpart(const symbol &x) const
 {
        if (is_zero())
                return _ex0;
 {
        if (is_zero())
                return _ex0;
-       if (is_ex_exactly_of_type(*this, numeric))
+       if (is_exactly_a<numeric>(*this))
                return _ex1;
 
        ex c = content(x);
        if (c.is_zero())
                return _ex0;
        ex u = unit(x);
                return _ex1;
 
        ex c = content(x);
        if (c.is_zero())
                return _ex0;
        ex u = unit(x);
-       if (is_ex_exactly_of_type(c, numeric))
+       if (is_exactly_a<numeric>(c))
                return *this / (c * u);
        else
                return quo(*this, c * u, x, false);
                return *this / (c * u);
        else
                return quo(*this, c * u, x, false);
@@ -907,11 +907,11 @@ ex ex::primpart(const symbol &x, const ex &c) const
                return _ex0;
        if (c.is_zero())
                return _ex0;
                return _ex0;
        if (c.is_zero())
                return _ex0;
-       if (is_ex_exactly_of_type(*this, numeric))
+       if (is_exactly_a<numeric>(*this))
                return _ex1;
 
        ex u = unit(x);
                return _ex1;
 
        ex u = unit(x);
-       if (is_ex_exactly_of_type(c, numeric))
+       if (is_exactly_a<numeric>(c))
                return *this / (c * u);
        else
                return quo(*this, c * u, x, false);
                return *this / (c * u);
        else
                return quo(*this, c * u, x, false);
@@ -1110,7 +1110,7 @@ static ex red_gcd(const ex &a, const ex &b, const symbol *x)
                        throw(std::runtime_error("invalid expression in red_gcd(), division failed"));
                ddeg = d.degree(*x);
                if (ddeg == 0) {
                        throw(std::runtime_error("invalid expression in red_gcd(), division failed"));
                ddeg = d.degree(*x);
                if (ddeg == 0) {
-                       if (is_ex_exactly_of_type(r, numeric))
+                       if (is_exactly_a<numeric>(r))
                                return gamma;
                        else
                                return gamma * r.primpart(*x);
                                return gamma;
                        else
                                return gamma * r.primpart(*x);
@@ -1185,7 +1185,7 @@ static ex sr_gcd(const ex &a, const ex &b, sym_desc_vec::const_iterator var)
                        throw(std::runtime_error("invalid expression in sr_gcd(), division failed"));
                ddeg = d.degree(x);
                if (ddeg == 0) {
                        throw(std::runtime_error("invalid expression in sr_gcd(), division failed"));
                ddeg = d.degree(x);
                if (ddeg == 0) {
-                       if (is_ex_exactly_of_type(r, numeric))
+                       if (is_exactly_a<numeric>(r))
                                return gamma;
                        else
                                return gamma * r.primpart(x);
                                return gamma;
                        else
                                return gamma * r.primpart(x);
@@ -1356,7 +1356,7 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const
                return (new fail())->setflag(status_flags::dynallocated);
 
        // GCD of two numeric values -> CLN
                return (new fail())->setflag(status_flags::dynallocated);
 
        // GCD of two numeric values -> CLN
-       if (is_ex_exactly_of_type(a, numeric) && is_ex_exactly_of_type(b, numeric)) {
+       if (is_exactly_a<numeric>(a) && is_exactly_a<numeric>(b)) {
                numeric g = gcd(ex_to<numeric>(a), ex_to<numeric>(b));
                if (ca)
                        *ca = ex_to<numeric>(a) / g;
                numeric g = gcd(ex_to<numeric>(a), ex_to<numeric>(b));
                if (ca)
                        *ca = ex_to<numeric>(a) / g;
@@ -1394,7 +1394,7 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const
                // Apply evaluation homomorphism and calculate GCD
                ex cp, cq;
                ex gamma = heur_gcd(p.subs(x == xi), q.subs(x == xi), &cp, &cq, var+1).expand();
                // Apply evaluation homomorphism and calculate GCD
                ex cp, cq;
                ex gamma = heur_gcd(p.subs(x == xi), q.subs(x == xi), &cp, &cq, var+1).expand();
-               if (!is_ex_exactly_of_type(gamma, fail)) {
+               if (!is_exactly_a<fail>(gamma)) {
 
                        // Reconstruct polynomial from GCD of mapped polynomials
                        ex g = interpolate(gamma, xi, x, maxdeg);
 
                        // Reconstruct polynomial from GCD of mapped polynomials
                        ex g = interpolate(gamma, xi, x, maxdeg);
@@ -1407,7 +1407,7 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const
                        if (divide_in_z(p, g, ca ? *ca : dummy, var) && divide_in_z(q, g, cb ? *cb : dummy, var)) {
                                g *= gc;
                                ex lc = g.lcoeff(x);
                        if (divide_in_z(p, g, ca ? *ca : dummy, var) && divide_in_z(q, g, cb ? *cb : dummy, var)) {
                                g *= gc;
                                ex lc = g.lcoeff(x);
-                               if (is_ex_exactly_of_type(lc, numeric) && ex_to<numeric>(lc).is_negative())
+                               if (is_exactly_a<numeric>(lc) && ex_to<numeric>(lc).is_negative())
                                        return -g;
                                else
                                        return g;
                                        return -g;
                                else
                                        return g;
@@ -1420,7 +1420,7 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const
                                        if (ca)
                                                *ca = cp;
                                        ex lc = g.lcoeff(x);
                                        if (ca)
                                                *ca = cp;
                                        ex lc = g.lcoeff(x);
-                                       if (is_ex_exactly_of_type(lc, numeric) && ex_to<numeric>(lc).is_negative())
+                                       if (is_exactly_a<numeric>(lc) && ex_to<numeric>(lc).is_negative())
                                                return -g;
                                        else
                                                return g;
                                                return -g;
                                        else
                                                return g;
@@ -1433,7 +1433,7 @@ static ex heur_gcd(const ex &a, const ex &b, ex *ca, ex *cb, sym_desc_vec::const
                                        if (cb)
                                                *cb = cq;
                                        ex lc = g.lcoeff(x);
                                        if (cb)
                                                *cb = cq;
                                        ex lc = g.lcoeff(x);
-                                       if (is_ex_exactly_of_type(lc, numeric) && ex_to<numeric>(lc).is_negative())
+                                       if (is_exactly_a<numeric>(lc) && ex_to<numeric>(lc).is_negative())
                                                return -g;
                                        else
                                                return g;
                                                return -g;
                                        else
                                                return g;
@@ -1465,7 +1465,7 @@ ex gcd(const ex &a, const ex &b, ex *ca, ex *cb, bool check_args)
 #endif
 
        // GCD of numerics -> CLN
 #endif
 
        // GCD of numerics -> CLN
-       if (is_ex_exactly_of_type(a, numeric) && is_ex_exactly_of_type(b, numeric)) {
+       if (is_exactly_a<numeric>(a) && is_exactly_a<numeric>(b)) {
                numeric g = gcd(ex_to<numeric>(a), ex_to<numeric>(b));
                if (ca || cb) {
                        if (g.is_zero()) {
                numeric g = gcd(ex_to<numeric>(a), ex_to<numeric>(b));
                if (ca || cb) {
                        if (g.is_zero()) {
@@ -1489,8 +1489,8 @@ ex gcd(const ex &a, const ex &b, ex *ca, ex *cb, bool check_args)
        }
 
        // Partially factored cases (to avoid expanding large expressions)
        }
 
        // Partially factored cases (to avoid expanding large expressions)
-       if (is_ex_exactly_of_type(a, mul)) {
-               if (is_ex_exactly_of_type(b, mul) && b.nops() > a.nops())
+       if (is_exactly_a<mul>(a)) {
+               if (is_exactly_a<mul>(b) && b.nops() > a.nops())
                        goto factored_b;
 factored_a:
                unsigned num = a.nops();
                        goto factored_b;
 factored_a:
                unsigned num = a.nops();
@@ -1508,8 +1508,8 @@ factored_a:
                if (cb)
                        *cb = part_b;
                return (new mul(g))->setflag(status_flags::dynallocated);
                if (cb)
                        *cb = part_b;
                return (new mul(g))->setflag(status_flags::dynallocated);
-       } else if (is_ex_exactly_of_type(b, mul)) {
-               if (is_ex_exactly_of_type(a, mul) && a.nops() > b.nops())
+       } else if (is_exactly_a<mul>(b)) {
+               if (is_exactly_a<mul>(a) && a.nops() > b.nops())
                        goto factored_a;
 factored_b:
                unsigned num = b.nops();
                        goto factored_a;
 factored_b:
                unsigned num = b.nops();
@@ -1531,9 +1531,9 @@ factored_b:
 
 #if FAST_COMPARE
        // Input polynomials of the form poly^n are sometimes also trivial
 
 #if FAST_COMPARE
        // Input polynomials of the form poly^n are sometimes also trivial
-       if (is_ex_exactly_of_type(a, power)) {
+       if (is_exactly_a<power>(a)) {
                ex p = a.op(0);
                ex p = a.op(0);
-               if (is_ex_exactly_of_type(b, power)) {
+               if (is_exactly_a<power>(b)) {
                        if (p.is_equal(b.op(0))) {
                                // a = p^n, b = p^m, gcd = p^min(n, m)
                                ex exp_a = a.op(1), exp_b = b.op(1);
                        if (p.is_equal(b.op(0))) {
                                // a = p^n, b = p^m, gcd = p^min(n, m)
                                ex exp_a = a.op(1), exp_b = b.op(1);
@@ -1561,7 +1561,7 @@ factored_b:
                                return p;
                        }
                }
                                return p;
                        }
                }
-       } else if (is_ex_exactly_of_type(b, power)) {
+       } else if (is_exactly_a<power>(b)) {
                ex p = b.op(0);
                if (p.is_equal(a)) {
                        // a = p, b = p^n, gcd = p
                ex p = b.op(0);
                if (p.is_equal(a)) {
                        // a = p, b = p^n, gcd = p
@@ -1650,7 +1650,7 @@ factored_b:
        } catch (gcdheu_failed) {
                g = fail();
        }
        } catch (gcdheu_failed) {
                g = fail();
        }
-       if (is_ex_exactly_of_type(g, fail)) {
+       if (is_exactly_a<fail>(g)) {
 //std::clog << "heuristics failed" << std::endl;
 #if STATISTICS
                heur_gcd_failed++;
 //std::clog << "heuristics failed" << std::endl;
 #if STATISTICS
                heur_gcd_failed++;
@@ -1698,7 +1698,7 @@ factored_b:
  *  @return the LCM as a new expression */
 ex lcm(const ex &a, const ex &b, bool check_args)
 {
  *  @return the LCM as a new expression */
 ex lcm(const ex &a, const ex &b, bool check_args)
 {
-       if (is_ex_exactly_of_type(a, numeric) && is_ex_exactly_of_type(b, numeric))
+       if (is_exactly_a<numeric>(a) && is_exactly_a<numeric>(b))
                return lcm(ex_to<numeric>(a), ex_to<numeric>(b));
        if (check_args && (!a.info(info_flags::rational_polynomial) || !b.info(info_flags::rational_polynomial)))
                throw(std::invalid_argument("lcm: arguments must be polynomials over the rationals"));
                return lcm(ex_to<numeric>(a), ex_to<numeric>(b));
        if (check_args && (!a.info(info_flags::rational_polynomial) || !b.info(info_flags::rational_polynomial)))
                throw(std::invalid_argument("lcm: arguments must be polynomials over the rationals"));
@@ -1779,7 +1779,7 @@ static exvector sqrfree_yun(const ex &a, const symbol &x)
  */
 ex sqrfree(const ex &a, const lst &l)
 {
  */
 ex sqrfree(const ex &a, const lst &l)
 {
-       if (is_a<numeric>(a) ||     // algorithm does not trap a==0
+       if (is_exactly_a<numeric>(a) ||     // algorithm does not trap a==0
            is_a<symbol>(a))        // shortcut
                return a;
 
            is_a<symbol>(a))        // shortcut
                return a;
 
@@ -2420,7 +2420,7 @@ ex expairseq::to_rational(lst &repl_lst) const
  *  to 1, unless you're accumulating factors). */
 static ex find_common_factor(const ex & e, ex & factor, lst & repl)
 {
  *  to 1, unless you're accumulating factors). */
 static ex find_common_factor(const ex & e, ex & factor, lst & repl)
 {
-       if (is_a<add>(e)) {
+       if (is_exactly_a<add>(e)) {
 
                unsigned num = e.nops();
                exvector terms; terms.reserve(num);
 
                unsigned num = e.nops();
                exvector terms; terms.reserve(num);
@@ -2430,7 +2430,7 @@ static ex find_common_factor(const ex & e, ex & factor, lst & repl)
                for (unsigned i=0; i<num; i++) {
                        ex x = e.op(i).to_rational(repl);
 
                for (unsigned i=0; i<num; i++) {
                        ex x = e.op(i).to_rational(repl);
 
-                       if (is_a<add>(x) || is_a<mul>(x)) {
+                       if (is_exactly_a<add>(x) || is_exactly_a<mul>(x)) {
                                ex f = 1;
                                x = find_common_factor(x, f, repl);
                                x *= f;
                                ex f = 1;
                                x = find_common_factor(x, f, repl);
                                x *= f;
@@ -2456,7 +2456,7 @@ static ex find_common_factor(const ex & e, ex & factor, lst & repl)
 
                        // Try to avoid divide() because it expands the polynomial
                        ex &t = terms[i];
 
                        // Try to avoid divide() because it expands the polynomial
                        ex &t = terms[i];
-                       if (is_a<mul>(t)) {
+                       if (is_exactly_a<mul>(t)) {
                                for (unsigned j=0; j<t.nops(); j++) {
                                        if (t.op(j).is_equal(gc)) {
                                                exvector v; v.reserve(t.nops());
                                for (unsigned j=0; j<t.nops(); j++) {
                                        if (t.op(j).is_equal(gc)) {
                                                exvector v; v.reserve(t.nops());
@@ -2478,7 +2478,7 @@ term_done:        ;
                }
                return (new add(terms))->setflag(status_flags::dynallocated);
 
                }
                return (new add(terms))->setflag(status_flags::dynallocated);
 
-       } else if (is_a<mul>(e)) {
+       } else if (is_exactly_a<mul>(e)) {
 
                unsigned num = e.nops();
                exvector v; v.reserve(num);
 
                unsigned num = e.nops();
                exvector v; v.reserve(num);
@@ -2488,10 +2488,10 @@ term_done:      ;
 
                return (new mul(v))->setflag(status_flags::dynallocated);
 
 
                return (new mul(v))->setflag(status_flags::dynallocated);
 
-       } else if (is_a<power>(e)) {
+       } else if (is_exactly_a<power>(e)) {
 
                ex x = e.to_rational(repl);
 
                ex x = e.to_rational(repl);
-               if (is_a<power>(x) && x.op(1).info(info_flags::negative))
+               if (is_exactly_a<power>(x) && x.op(1).info(info_flags::negative))
                        return replace_with_symbol(x, repl);
                else
                        return x;
                        return replace_with_symbol(x, repl);
                else
                        return x;
@@ -2505,7 +2505,7 @@ term_done:        ;
  *  'a*(b*x+b*y)' to 'a*b*(x+y)'. */
 ex collect_common_factors(const ex & e)
 {
  *  'a*(b*x+b*y)' to 'a*b*(x+y)'. */
 ex collect_common_factors(const ex & e)
 {
-       if (is_a<add>(e) || is_a<mul>(e)) {
+       if (is_exactly_a<add>(e) || is_exactly_a<mul>(e)) {
 
                lst repl;
                ex factor = 1;
 
                lst repl;
                ex factor = 1;
index 32473bd4c964677f599364300f9c335e776130a9..7d84c82eb8026b4a40733fbd2b953e223970f8d0 100644 (file)
@@ -125,7 +125,7 @@ void power::print(const print_context & c, unsigned level) const
 
                // Integer powers of symbols are printed in a special, optimized way
                if (exponent.info(info_flags::integer)
 
                // Integer powers of symbols are printed in a special, optimized way
                if (exponent.info(info_flags::integer)
-                && (is_exactly_a<symbol>(basis) || is_exactly_a<constant>(basis))) {
+                && (is_a<symbol>(basis) || is_a<constant>(basis))) {
                        int exp = ex_to<numeric>(exponent).to_int();
                        if (exp > 0)
                                c.s << '(';
                        int exp = ex_to<numeric>(exponent).to_int();
                        if (exp > 0)
                                c.s << '(';
@@ -172,7 +172,7 @@ void power::print(const print_context & c, unsigned level) const
 
                bool is_tex = is_a<print_latex>(c);
 
 
                bool is_tex = is_a<print_latex>(c);
 
-               if (is_tex && is_a<numeric>(exponent) && ex_to<numeric>(exponent).is_negative()) {
+               if (is_tex && is_exactly_a<numeric>(exponent) && ex_to<numeric>(exponent).is_negative()) {
 
                        // Powers with negative numeric exponents are printed as fractions in TeX
                        c.s << "\\frac{1}{";
 
                        // Powers with negative numeric exponents are printed as fractions in TeX
                        c.s << "\\frac{1}{";
index 7f77cc664bec67025f62df51070adcbda2db25c2..e08921e8ccd8cf6cbfd57a1e982ecff49340506e 100644 (file)
@@ -73,8 +73,8 @@ DEFAULT_DESTROY(pseries)
  *  @return newly constructed pseries */
 pseries::pseries(const ex &rel_, const epvector &ops_) : basic(TINFO_pseries), seq(ops_)
 {
  *  @return newly constructed pseries */
 pseries::pseries(const ex &rel_, const epvector &ops_) : basic(TINFO_pseries), seq(ops_)
 {
-       GINAC_ASSERT(is_exactly_a<relational>(rel_));
-       GINAC_ASSERT(is_exactly_a<symbol>(rel_.lhs()));
+       GINAC_ASSERT(is_a<relational>(rel_));
+       GINAC_ASSERT(is_a<symbol>(rel_.lhs()));
        point = rel_.rhs();
        var = rel_.lhs();
 }
        point = rel_.rhs();
        var = rel_.lhs();
 }
@@ -551,7 +551,7 @@ ex symbol::series(const relational & r, int order, unsigned options) const
 {
        epvector seq;
        const ex point = r.rhs();
 {
        epvector seq;
        const ex point = r.rhs();
-       GINAC_ASSERT(is_exactly_a<symbol>(r.lhs()));
+       GINAC_ASSERT(is_a<symbol>(r.lhs()));
 
        if (this->is_equal_same_type(ex_to<symbol>(r.lhs()))) {
                if (order > 0 && !point.is_zero())
 
        if (this->is_equal_same_type(ex_to<symbol>(r.lhs()))) {
                if (order > 0 && !point.is_zero())
@@ -655,7 +655,7 @@ ex add::series(const relational & r, int order, unsigned options) const
        epvector::const_iterator itend = seq.end();
        for (; it!=itend; ++it) {
                ex op;
        epvector::const_iterator itend = seq.end();
        for (; it!=itend; ++it) {
                ex op;
-               if (is_ex_exactly_of_type(it->rest, pseries))
+               if (is_exactly_a<pseries>(it->rest))
                        op = it->rest;
                else
                        op = it->rest.series(r, order, options);
                        op = it->rest;
                else
                        op = it->rest.series(r, order, options);
@@ -868,7 +868,7 @@ pseries pseries::shift_exponents(int deg) const
 ex power::series(const relational & r, int order, unsigned options) const
 {
        // If basis is already a series, just power it
 ex power::series(const relational & r, int order, unsigned options) const
 {
        // If basis is already a series, just power it
-       if (is_ex_exactly_of_type(basis, pseries))
+       if (is_exactly_a<pseries>(basis))
                return ex_to<pseries>(basis).power_const(ex_to<numeric>(exponent), order);
 
        // Basis is not a series, may there be a singularity?
                return ex_to<pseries>(basis).power_const(ex_to<numeric>(exponent), order);
 
        // Basis is not a series, may there be a singularity?
@@ -907,7 +907,7 @@ ex power::series(const relational & r, int order, unsigned options) const
 ex pseries::series(const relational & r, int order, unsigned options) const
 {
        const ex p = r.rhs();
 ex pseries::series(const relational & r, int order, unsigned options) const
 {
        const ex p = r.rhs();
-       GINAC_ASSERT(is_exactly_a<symbol>(r.lhs()));
+       GINAC_ASSERT(is_a<symbol>(r.lhs()));
        const symbol &s = ex_to<symbol>(r.lhs());
        
        if (var.is_equal(s) && point.is_equal(p)) {
        const symbol &s = ex_to<symbol>(r.lhs());
        
        if (var.is_equal(s) && point.is_equal(p)) {
@@ -947,9 +947,9 @@ ex ex::series(const ex & r, int order, unsigned options) const
        ex e;
        relational rel_;
        
        ex e;
        relational rel_;
        
-       if (is_ex_exactly_of_type(r,relational))
+       if (is_exactly_a<relational>(r))
                rel_ = ex_to<relational>(r);
                rel_ = ex_to<relational>(r);
-       else if (is_ex_exactly_of_type(r,symbol))
+       else if (is_a<symbol>(r))
                rel_ = relational(r,_ex0);
        else
                throw (std::logic_error("ex::series(): expansion point has unknown type"));
                rel_ = relational(r,_ex0);
        else
                throw (std::logic_error("ex::series(): expansion point has unknown type"));