]> www.ginac.de Git - ginac.git/blobdiff - ginac/ex.cpp
- ex::numer() and ex::denom() now make use of the new normal()
[ginac.git] / ginac / ex.cpp
index ec6e96494fb40b6ca6828ed21cf1d0c8f252f202..6c51fe6e02b596686fd01d788cf8cbe89539239a 100644 (file)
@@ -277,78 +277,6 @@ ex ex::coeff(const symbol & s, int n) const
     return bp->coeff(s,n);
 }
 
-ex ex::numer(bool normalize) const
-{
-    ex n;
-    if (normalize)
-        n = normal();
-    else
-        n = *this;
-
-       // number
-       if (is_ex_exactly_of_type(n, numeric))
-               return ex_to_numeric(n).numer();
-
-    // polynomial
-    if (n.info(info_flags::cinteger_polynomial))
-        return n;
-
-    // something^(-int)
-    if (is_ex_exactly_of_type(n, power) && n.op(1).info(info_flags::negint))
-        return _ex1();
-
-    // something^(int) * something^(int) * ...
-    if (!is_ex_exactly_of_type(n, mul))
-        return n;
-    ex res = _ex1();
-    for (unsigned i=0; i<n.nops(); i++) {
-               if (is_ex_exactly_of_type(n.op(i), power) && n.op(i).op(1).info(info_flags::negint)) {
-                       // something^(-int) belongs to the denominator
-               } else if (is_ex_exactly_of_type(n.op(i), numeric)) {
-                       res *= ex_to_numeric(n.op(i)).numer();
-               } else {
-            res *= n.op(i);
-               }
-    }
-    return res;
-}
-
-ex ex::denom(bool normalize) const
-{
-    ex n;
-    if (normalize)
-        n = normal();
-    else
-        n = *this;
-
-       // number
-       if (is_ex_exactly_of_type(n, numeric))
-               return ex_to_numeric(n).denom();
-
-    // polynomial
-    if (n.info(info_flags::cinteger_polynomial))
-        return _ex1();
-
-    // something^(-int)
-    if (is_ex_exactly_of_type(n, power) && n.op(1).info(info_flags::negint))
-        return power(n.op(0), -(n.op(1)));
-
-    // something^(int) * something^(int) * ...
-    if (!is_ex_exactly_of_type(n, mul))
-        return _ex1();
-    ex res = _ex1();
-    for (unsigned i=0; i<n.nops(); i++) {
-        if (is_ex_exactly_of_type(n.op(i), power) && n.op(i).op(1).info(info_flags::negint)) {
-            res *= power(n.op(i), -1);
-               } else if (is_ex_exactly_of_type(n.op(i), numeric)) {
-                       res *= ex_to_numeric(n.op(i)).denom();
-               } else {
-                       // everything else belongs to the numerator
-               }
-    }
-    return res;
-}
-
 ex ex::collect(const symbol & s) const
 {
     GINAC_ASSERT(bp!=0);