]> www.ginac.de Git - ginac.git/blobdiff - ginac/inifcns_nstdsums.cpp
Make ample use of the contextual keyword 'override'.
[ginac.git] / ginac / inifcns_nstdsums.cpp
index ee667752124b8e2391ec6e4946f4b6d84c487da3..7fbc774a5ef903fb4c79bc51e1336a8995d13ee5 100644 (file)
@@ -25,7 +25,7 @@
  *      0, 1 and -1 --- or in compactified --- a string with zeros in front of 1 or -1 is written as a single
  *      number --- notation.
  *
- *    - All functions can be nummerically evaluated with arguments in the whole complex plane. The parameters
+ *    - All functions can be numerically evaluated with arguments in the whole complex plane. The parameters
  *      for Li, zeta and S must be positive integers. If you want to have an alternating Euler sum, you have
  *      to give the signs of the parameters as a second argument s to zeta(m,s) containing 1 and -1.
  *
@@ -102,7 +102,7 @@ namespace {
 
 // lookup table for factors built from Bernoulli numbers
 // see fill_Xn()
-std::vector<std::vector<cln::cl_N> > Xn;
+std::vector<std::vector<cln::cl_N>> Xn;
 // initial size of Xn that should suffice for 32bit machines (must be even)
 const int xninitsizestep = 26;
 int xninitsize = xninitsizestep;
@@ -1662,9 +1662,8 @@ static ex Li_series(const ex& m, const ex& x, const relational& rel, int order,
 {
        if (is_a<lst>(m) || is_a<lst>(x)) {
                // multiple polylog
-               epvector seq;
-               seq.push_back(expair(Li(m, x), 0));
-               return pseries(rel, seq);
+               epvector seq { expair(Li(m, x), 0) };
+               return pseries(rel, std::move(seq));
        }
        
        // classical polylog
@@ -1680,9 +1679,8 @@ static ex Li_series(const ex& m, const ex& x, const relational& rel, int order,
                        // substitute the argument's series expansion
                        ser = ser.subs(s==x.series(rel, order), subs_options::no_pattern);
                        // maybe that was terminating, so add a proper order term
-                       epvector nseq;
-                       nseq.push_back(expair(Order(_ex1), order));
-                       ser += pseries(rel, nseq);
+                       epvector nseq { expair(Order(_ex1), order) };
+                       ser += pseries(rel, std::move(nseq));
                        // reexpanding it will collapse the series again
                        return ser.series(rel, order);
                }
@@ -1781,7 +1779,7 @@ namespace {
 
 // lookup table for special Euler-Zagier-Sums (used for S_n,p(x))
 // see fill_Yn()
-std::vector<std::vector<cln::cl_N> > Yn;
+std::vector<std::vector<cln::cl_N>> Yn;
 int ynsize = 0; // number of Yn[]
 int ynlength = 100; // initial length of all Yn[i]
 
@@ -2235,9 +2233,8 @@ static ex S_series(const ex& n, const ex& p, const ex& x, const relational& rel,
                        // substitute the argument's series expansion
                        ser = ser.subs(s==x.series(rel, order), subs_options::no_pattern);
                        // maybe that was terminating, so add a proper order term
-                       epvector nseq;
-                       nseq.push_back(expair(Order(_ex1), order));
-                       ser += pseries(rel, nseq);
+                       epvector nseq { expair(Order(_ex1), order) };
+                       ser += pseries(rel, std::move(nseq));
                        // reexpanding it will collapse the series again
                        return ser.series(rel, order);
                }
@@ -2363,7 +2360,7 @@ bool convert_parameter_H_to_Li(const lst& l, lst& m, lst& s, ex& pf)
 // recursivly transforms H to corresponding multiple polylogarithms
 struct map_trafo_H_convert_to_Li : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2402,7 +2399,7 @@ struct map_trafo_H_convert_to_Li : public map_function
 // recursivly transforms H to corresponding zetas
 struct map_trafo_H_convert_to_zeta : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2435,7 +2432,7 @@ struct map_trafo_H_convert_to_zeta : public map_function
 // remove trailing zeros from H-parameters
 struct map_trafo_H_reduce_trailing_zeros : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2581,7 +2578,7 @@ ex trafo_H_mult(const ex& h1, const ex& h2)
 // applies trafo_H_mult recursively on expressions
 struct map_trafo_H_mult : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e)) {
                        return e.map(*this);
@@ -2803,7 +2800,7 @@ ex trafo_H_1mxt1px_prepend_one(const ex& e, const ex& arg)
 // do x -> 1-x transformation
 struct map_trafo_H_1mx : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -2904,7 +2901,7 @@ struct map_trafo_H_1mx : public map_function
 // do x -> 1/x transformation
 struct map_trafo_H_1overx : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -3025,7 +3022,7 @@ struct map_trafo_H_1overx : public map_function
 // do x -> (1-x)/(1+x) transformation
 struct map_trafo_H_1mxt1px : public map_function
 {
-       ex operator()(const ex& e)
+       ex operator()(const ex& e) override
        {
                if (is_a<add>(e) || is_a<mul>(e)) {
                        return e.map(*this);
@@ -3430,9 +3427,8 @@ static ex H_eval(const ex& m_, const ex& x)
 
 static ex H_series(const ex& m, const ex& x, const relational& rel, int order, unsigned options)
 {
-       epvector seq;
-       seq.push_back(expair(H(m, x), 0));
-       return pseries(rel, seq);
+       epvector seq { expair(H(m, x), 0) };
+       return pseries(rel, std::move(seq));
 }
 
 
@@ -3551,7 +3547,7 @@ static void initcX(std::vector<cln::cl_N>& crX,
 
        int Sm = 0;
        int Smp1 = 0;
-       std::vector<std::vector<cln::cl_N> > crG(s.size() - 1, std::vector<cln::cl_N>(L2 + 1));
+       std::vector<std::vector<cln::cl_N>> crG(s.size() - 1, std::vector<cln::cl_N>(L2 + 1));
        for (int m=0; m < (int)s.size() - 1; m++) {
                Sm += s[m];
                Smp1 = Sm + s[m+1];
@@ -3591,12 +3587,12 @@ static cln::cl_N crandall_Y_loop(const cln::cl_N& Sqk,
 
 
 // [Cra] section 4
-static void calc_f(std::vector<std::vector<cln::cl_N> >& f_kj,
+static void calc_f(std::vector<std::vector<cln::cl_N>>& f_kj,
                   const int maxr, const int L1)
 {
        cln::cl_N t0, t1, t2, t3, t4;
        int i, j, k;
-       std::vector<std::vector<cln::cl_N> >::iterator it = f_kj.begin();
+       std::vector<std::vector<cln::cl_N>>::iterator it = f_kj.begin();
        cln::cl_F one = cln::cl_float(1, cln::float_format(Digits));
        
        t0 = cln::exp(-lambda);
@@ -3620,7 +3616,7 @@ static void calc_f(std::vector<std::vector<cln::cl_N> >& f_kj,
 
 // [Cra] (3.1)
 static cln::cl_N crandall_Z(const std::vector<int>& s,
-                           const std::vector<std::vector<cln::cl_N> >& f_kj)
+                           const std::vector<std::vector<cln::cl_N>>& f_kj)
 {
        const int j = s.size();
 
@@ -3697,7 +3693,7 @@ cln::cl_N zeta_do_sum_Crandall(const std::vector<int>& s)
                }
        }
 
-       std::vector<std::vector<cln::cl_N> > f_kj(L1);
+       std::vector<std::vector<cln::cl_N>> f_kj(L1);
        calc_f(f_kj, maxr, L1);
 
        const cln::cl_N r0factorial = cln::factorial(r[0]-1);