]> www.ginac.de Git - ginac.git/blobdiff - ginac/factor.cpp
Improve method of setting status_flags::dynallocated.
[ginac.git] / ginac / factor.cpp
index 8f8c87e858340e625df38a3bffe1fb3cfc0356fa..e96dccfa81eded8468a390f455d0b2f9f54462da 100644 (file)
@@ -70,6 +70,7 @@
 #include <limits>
 #include <list>
 #include <vector>
+#include <stack>
 #ifdef DEBUGFACTOR
 #include <ostream>
 #endif
@@ -1830,7 +1831,7 @@ static upvec univar_diophant(const upvec& a, const ex& x, unsigned int m, unsign
 struct make_modular_map : public map_function {
        cl_modint_ring R;
        make_modular_map(const cl_modint_ring& R_) : R(R_) { }
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if ( is_a<add>(e) || is_a<mul>(e) ) {
                        return e.map(*this);
@@ -2092,7 +2093,7 @@ static ex hensel_multivar(const ex& a, const ex& x, const vector<EvalPoint>& I,
        }
        else {
                lst res;
-               return lst();
+               return lst{};
        }
 }
 
@@ -2266,7 +2267,7 @@ static ex factor_multivariate(const ex& poly, const exset& syms)
        ex vn = pp.collect(x).lcoeff(x);
        ex vnlst;
        if ( is_a<numeric>(vn) ) {
-               vnlst = lst(vn);
+               vnlst = lst{vn};
        }
        else {
                ex vnfactors = factor(vn);
@@ -2440,7 +2441,7 @@ static ex factor_multivariate(const ex& poly, const exset& syms)
 
                // try Hensel lifting
                ex res = hensel_multivar(pp, x, epv, prime, l, modfactors, C);
-               if ( res != lst() ) {
+               if ( res != lst{} ) {
                        ex result = cont * unit;
                        for ( size_t i=0; i<res.nops(); ++i ) {
                                result *= res.op(i).content(x) * res.op(i).unit(x);
@@ -2455,7 +2456,7 @@ static ex factor_multivariate(const ex& poly, const exset& syms)
  */
 struct find_symbols_map : public map_function {
        exset syms;
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if ( is_a<symbol>(e) ) {
                        syms.insert(e);
@@ -2503,7 +2504,7 @@ static ex factor_sqrfree(const ex& poly)
 struct apply_factor_map : public map_function {
        unsigned options;
        apply_factor_map(unsigned options_) : options(options_) { }
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if ( e.info(info_flags::polynomial) ) {
                        return factor(e, options);