]> www.ginac.de Git - ginac.git/commitdiff
Use initializer lists to construct container<>, lst.
authorRichard Kreckel <kreckel@ginac.de>
Thu, 26 Nov 2015 20:36:46 +0000 (21:36 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 26 Nov 2015 20:36:46 +0000 (21:36 +0100)
Add constructor of initializer_list<ex> to container<C<ex>>. In
particular, this means that we can finally declare lst objects as
lst{a,2*b,2}. Convert GiNaC to this syntax throughout. Deprecate
the old constructors taking 1..16 ex parameters and the ones from
comma seaparated lists (without braces).

30 files changed:
check/exam_archive.cpp
check/exam_clifford.cpp
check/exam_color.cpp
check/exam_differentiation.cpp
check/exam_factor.cpp
check/exam_indexed.cpp
check/exam_inifcns_nstdsums.cpp
check/exam_matrices.cpp
check/exam_misc.cpp
check/exam_numeric.cpp
check/exam_powerlaws.cpp
check/time_lw_M1.cpp
check/time_lw_N.cpp
check/time_toeplitz.cpp
doc/examples/compile2.cpp
doc/tutorial/ginac.texi
ginac/clifford.cpp
ginac/compiler.h
ginac/container.h
ginac/ex.cpp
ginac/excompiler.cpp
ginac/expairseq.cpp
ginac/factor.cpp
ginac/function.cppy
ginac/indexed.cpp
ginac/inifcns.cpp
ginac/inifcns_nstdsums.cpp
ginac/ncmul.cpp
ginac/normal.cpp
ginsh/ginsh_parser.ypp

index cc5891cd7a8402abaa0df3b2dbf7a090bc74ce01..8a9bf5f91cdf7ae7ec12f31a8df7edcd01aa824c 100644 (file)
@@ -41,9 +41,9 @@ unsigned exam_archive()
        e = -42 * x * pow(y, sin(y*Catalan)) * dirac_ONE()
            * epsilon_tensor(idx(fail(), 3), idx(0, 3), idx(y/2, 3))
          + lorentz_g(
        e = -42 * x * pow(y, sin(y*Catalan)) * dirac_ONE()
            * epsilon_tensor(idx(fail(), 3), idx(0, 3), idx(y/2, 3))
          + lorentz_g(
-             varidx(lst(x, -11*y, acos(2*x).series(x==3-5*I, 3)) * color_ONE()
+             varidx(lst{x, -11*y, acos(2*x).series(x==3-5*I, 3)} * color_ONE()
                * metric_tensor(varidx(log(cos(128.0/(x*y))), 5), varidx(2, 5)), zeta(3)),
                * metric_tensor(varidx(log(cos(128.0/(x*y))), 5), varidx(2, 5)), zeta(3)),
-             varidx(diag_matrix(lst(-1, Euler, atan(x/y==-15*I/17)))
+             varidx(diag_matrix(lst{-1, Euler, atan(x/y==-15*I/17)})
                * delta_tensor(idx(x, 2), idx(wild(7), 3)), zeta(3), true),
              true
            )
                * delta_tensor(idx(x, 2), idx(wild(7), 3)), zeta(3), true),
              true
            )
@@ -64,7 +64,7 @@ unsigned exam_archive()
                std::ifstream fin("exam.gar", std::ios_base::binary);
                fin >> ar;
        }
                std::ifstream fin("exam.gar", std::ios_base::binary);
                fin >> ar;
        }
-       f = ar.unarchive_ex(lst(x, y, mu, dim), "expr 1");
+       f = ar.unarchive_ex(lst{x, y, mu, dim}, "expr 1");
 
        ex difference = (f - e).expand();
        if (!difference.is_zero()) {
 
        ex difference = (f - e).expand();
        if (!difference.is_zero()) {
index 24655e4877bf8a540a7a52c063547e7f2d52e612..0430e2daccd4df8bedb1ec1a55297cf3d1b7408d 100644 (file)
@@ -70,11 +70,11 @@ static unsigned check_equal_simplify_term(const ex & e1, const ex & e2, idx & mu
        for (int j=0; j<4; j++) {
                ex esub = e.subs(
                                is_a<varidx>(mu)
        for (int j=0; j<4; j++) {
                ex esub = e.subs(
                                is_a<varidx>(mu)
-                                       ? lst (
+                                       ? lst {
                                                        mu == idx(j, mu.get_dim()),
                                                        ex_to<varidx>(mu).toggle_variance() == idx(j, mu.get_dim())
                                                        mu == idx(j, mu.get_dim()),
                                                        ex_to<varidx>(mu).toggle_variance() == idx(j, mu.get_dim())
-                                               )
-                                       : lst(mu == idx(j, mu.get_dim()))
+                                               }
+                                       : lst{mu == idx(j, mu.get_dim())}
                        );
                if (!(canonicalize_clifford(esub).is_zero())) {
                        clog << "simplify_indexed(" << e1 << ") - (" << e2 << ") erroneously returned "
                        );
                if (!(canonicalize_clifford(esub).is_zero())) {
                        clog << "simplify_indexed(" << e1 << ") - (" << e2 << ") erroneously returned "
@@ -242,7 +242,7 @@ static unsigned clifford_check3()
        result += check_equal(dirac_trace(e, 0), dirac_ONE(1) / 4);
        result += check_equal(dirac_trace(e, 1), dirac_ONE(0) / 4);
        result += check_equal(dirac_trace(e, 2), e);
        result += check_equal(dirac_trace(e, 0), dirac_ONE(1) / 4);
        result += check_equal(dirac_trace(e, 1), dirac_ONE(0) / 4);
        result += check_equal(dirac_trace(e, 2), e);
-       result += check_equal(dirac_trace(e, lst(0, 1)), 1);
+       result += check_equal(dirac_trace(e, lst{0, 1}), 1);
 
        e = dirac_gamma(mu, 0) * dirac_gamma(mu.toggle_variance(), 1) * dirac_gamma(nu, 0) * dirac_gamma(nu.toggle_variance(), 1);
        result += check_equal_simplify(dirac_trace(e, 0), 4 * dim * dirac_ONE(1));
 
        e = dirac_gamma(mu, 0) * dirac_gamma(mu.toggle_variance(), 1) * dirac_gamma(nu, 0) * dirac_gamma(nu.toggle_variance(), 1);
        result += check_equal_simplify(dirac_trace(e, 0), 4 * dim * dirac_ONE(1));
@@ -250,7 +250,7 @@ static unsigned clifford_check3()
        // Fails with new tinfo mechanism because the order of gamma matrices with different rl depends on luck.
        // TODO: better check.
        //result += check_equal_simplify(dirac_trace(e, 2), canonicalize_clifford(e)); // e will be canonicalized by the calculation of the trace
        // Fails with new tinfo mechanism because the order of gamma matrices with different rl depends on luck.
        // TODO: better check.
        //result += check_equal_simplify(dirac_trace(e, 2), canonicalize_clifford(e)); // e will be canonicalized by the calculation of the trace
-       result += check_equal_simplify(dirac_trace(e, lst(0, 1)), 16 * dim);
+       result += check_equal_simplify(dirac_trace(e, lst{0, 1}), 16 * dim);
 
        return result;
 }
 
        return result;
 }
@@ -417,17 +417,17 @@ template <typename IDX> unsigned clifford_check6(const matrix &A)
        realsymbol s("s"), t("t"), x("x"), y("y"), z("z");
 
        ex c = clifford_unit(nu, A, 1);
        realsymbol s("s"), t("t"), x("x"), y("y"), z("z");
 
        ex c = clifford_unit(nu, A, 1);
-       e = lst_to_clifford(lst(t, x, y, z), mu, A, 1) * lst_to_clifford(lst(1, 2, 3, 4), c);
+       e = lst_to_clifford(lst{t, x, y, z}, mu, A, 1) * lst_to_clifford(lst{1, 2, 3, 4}, c);
        e1 = clifford_inverse(e);
        result += check_equal_simplify_term2((e*e1).simplify_indexed(), dirac_ONE(1));
 
 /* lst_to_clifford() and clifford_to_lst()  check for vectors*/
        e1 = clifford_inverse(e);
        result += check_equal_simplify_term2((e*e1).simplify_indexed(), dirac_ONE(1));
 
 /* lst_to_clifford() and clifford_to_lst()  check for vectors*/
-       e = lst(t, x, y, z);
+       e = lst{t, x, y, z};
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, false), e);
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, true), e);
 
 /* lst_to_clifford() and clifford_to_lst()  check for pseudovectors*/
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, false), e);
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, true), e);
 
 /* lst_to_clifford() and clifford_to_lst()  check for pseudovectors*/
-       e = lst(s, t, x, y, z);
+       e = lst{s, t, x, y, z};
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, false), e);
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, true), e);
 
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, false), e);
        result += check_equal_lst(clifford_to_lst(lst_to_clifford(e, c), c, true), e);
 
@@ -436,32 +436,32 @@ template <typename IDX> unsigned clifford_check6(const matrix &A)
        c = clifford_unit(nu, A);
 
        e = clifford_moebius_map(0, dirac_ONE(), 
        c = clifford_unit(nu, A);
 
        e = clifford_moebius_map(0, dirac_ONE(), 
-                                                        dirac_ONE(), 0, lst(t, x, y, z), A); 
+                                                        dirac_ONE(), 0, lst{t, x, y, z}, A);
 /* this is just the inversion*/
        M1 = 0, dirac_ONE(),
                dirac_ONE(), 0;
 /* this is just the inversion*/
        M1 = 0, dirac_ONE(),
                dirac_ONE(), 0;
-       e1 = clifford_moebius_map(M1, lst(t, x, y, z), A); 
+       e1 = clifford_moebius_map(M1, lst{t, x, y, z}, A);
 /* the inversion again*/
        result += check_equal_lst(e, e1);
 
 /* the inversion again*/
        result += check_equal_lst(e, e1);
 
-       e1 = clifford_to_lst(clifford_inverse(lst_to_clifford(lst(t, x, y, z), mu, A)), c);
+       e1 = clifford_to_lst(clifford_inverse(lst_to_clifford(lst{t, x, y, z}, mu, A)), c);
        result += check_equal_lst(e, e1);
 
        result += check_equal_lst(e, e1);
 
-       e = clifford_moebius_map(dirac_ONE(), lst_to_clifford(lst(1, 2, 3, 4), nu, A), 
-                                                        0, dirac_ONE(), lst(t, x, y, z), A); 
+       e = clifford_moebius_map(dirac_ONE(), lst_to_clifford(lst{1, 2, 3, 4}, nu, A),
+                                                        0, dirac_ONE(), lst{t, x, y, z}, A);
 /*this is just a shift*/
 /*this is just a shift*/
-       M2 = dirac_ONE(), lst_to_clifford(lst(1, 2, 3, 4), c),
+       M2 = dirac_ONE(), lst_to_clifford(lst{1, 2, 3, 4}, c),
                0, dirac_ONE();
                0, dirac_ONE();
-       e1 = clifford_moebius_map(M2, lst(t, x, y, z), c); 
+       e1 = clifford_moebius_map(M2, lst{t, x, y, z}, c);
 /* the same shift*/
        result += check_equal_lst(e, e1);
 
 /* the same shift*/
        result += check_equal_lst(e, e1);
 
-       result += check_equal(e, lst(t+1, x+2, y+3, z+4));
+       result += check_equal(e, lst{t+1, x+2, y+3, z+4});
 
 /* Check the group law for Moebius maps */
        e = clifford_moebius_map(M1, ex_to<lst>(e1), c);
 /*composition of M1 and M2*/
 
 /* Check the group law for Moebius maps */
        e = clifford_moebius_map(M1, ex_to<lst>(e1), c);
 /*composition of M1 and M2*/
-       e1 = clifford_moebius_map(M1.mul(M2), lst(t, x, y, z), c);
+       e1 = clifford_moebius_map(M1.mul(M2), lst{t, x, y, z}, c);
 /* the product M1*M2*/
        result += check_equal_lst(e, e1);
        return result;
 /* the product M1*M2*/
        result += check_equal_lst(e, e1);
        return result;
@@ -546,7 +546,7 @@ static unsigned clifford_check8()
        realsymbol a("a");
        varidx mu(symbol("mu", "\\mu"), 1);
 
        realsymbol a("a");
        varidx mu(symbol("mu", "\\mu"), 1);
 
-       ex e = clifford_unit(mu, diag_matrix(lst(-1))), e0 = e.subs(mu==0);
+       ex e = clifford_unit(mu, diag_matrix(lst{-1})), e0 = e.subs(mu==0);
        result += ( exp(a*e0)*e0*e0 == -exp(e0*a) ) ? 0 : 1;
 
        return result;
        result += ( exp(a*e0)*e0*e0 == -exp(e0*a) ) ? 0 : 1;
 
        return result;
@@ -565,15 +565,15 @@ unsigned exam_clifford()
        result += clifford_check5(); cout << '.' << flush;
 
        // anticommuting, symmetric examples
        result += clifford_check5(); cout << '.' << flush;
 
        // anticommuting, symmetric examples
-       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst(-1, 1, 1, 1))));
-       result += clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-1, 1, 1, 1))));; cout << '.' << flush;
-       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst(-1, -1, -1, -1))))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-1, -1, -1, -1))));; cout << '.' << flush;
-       result += clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-1, 1, 1, -1))))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-1, 1, 1, -1))));; cout << '.' << flush;
-       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst(-1, 0, 1, -1))))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-1, 0, 1, -1))));; cout << '.' << flush;
-       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst(-3, 0, 2, -1))))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-3, 0, 2, -1))));; cout << '.' << flush;
+       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst{-1, 1, 1, 1})));
+       result += clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-1, 1, 1, 1})));; cout << '.' << flush;
+       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst{-1, -1, -1, -1})))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-1, -1, -1, -1})));; cout << '.' << flush;
+       result += clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-1, 1, 1, -1})))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-1, 1, 1, -1})));; cout << '.' << flush;
+       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst{-1, 0, 1, -1})))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-1, 0, 1, -1})));; cout << '.' << flush;
+       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst{-3, 0, 2, -1})))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-3, 0, 2, -1})));; cout << '.' << flush;
 
        realsymbol s("s"), t("t"); // symbolic entries in matric
 
        realsymbol s("s"), t("t"); // symbolic entries in matric
-       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst(-1, 1, s, t))))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst(-1, 1, s, t))));; cout << '.' << flush;
+       result += clifford_check6<varidx>(ex_to<matrix>(diag_matrix(lst{-1, 1, s, t})))+clifford_check6<idx>(ex_to<matrix>(diag_matrix(lst{-1, 1, s, t})));; cout << '.' << flush;
 
        matrix A(4, 4);
        A = 1,  0,  0,  0, // anticommuting, not symmetric, Tr=0
 
        matrix A(4, 4);
        A = 1,  0,  0,  0, // anticommuting, not symmetric, Tr=0
index 4e5894c05caf00592a4faa244dd969b24d5a3f12..3e44718ad8d8f76e35ce51519090c3f97032464e 100644 (file)
@@ -72,7 +72,7 @@ static unsigned color_check1()
        for (int i=1; i<9; i++)
            for (int j=1; j<9; j++)
                for (int k=1; k<9; k++)
        for (int i=1; i<9; i++)
            for (int j=1; j<9; j++)
                for (int k=1; k<9; k++)
-                sum += e.subs(lst(a == i, b == j, c == k));
+                       sum += e.subs(lst{a == i, b == j, c == k});
        if (!sum.is_equal(numeric(-32,3))) {
                clog << "numeric contraction of " << e << " erroneously returned "
                     << sum << " instead of -32/3" << endl;
        if (!sum.is_equal(numeric(-32,3))) {
                clog << "numeric contraction of " << e << " erroneously returned "
                     << sum << " instead of -32/3" << endl;
@@ -133,13 +133,13 @@ static unsigned color_check3()
        result += check_equal(color_trace(e, 0), color_ONE(1) / 3);
        result += check_equal(color_trace(e, 1), color_ONE(0) / 3);
        result += check_equal(color_trace(e, 2), e);
        result += check_equal(color_trace(e, 0), color_ONE(1) / 3);
        result += check_equal(color_trace(e, 1), color_ONE(0) / 3);
        result += check_equal(color_trace(e, 2), e);
-       result += check_equal(color_trace(e, lst(0, 1)), 1);
+       result += check_equal(color_trace(e, lst{0, 1}), 1);
 
        e = color_T(a, 0) * color_T(a, 1) * color_T(b, 0) * color_T(b, 1);
        result += check_equal_simplify(color_trace(e, 0), 2 * color_ONE(1) / 3);
        result += check_equal_simplify(color_trace(e, 1), 2 * color_ONE(0) / 3);
        result += check_equal_simplify(color_trace(e, 2), e);
 
        e = color_T(a, 0) * color_T(a, 1) * color_T(b, 0) * color_T(b, 1);
        result += check_equal_simplify(color_trace(e, 0), 2 * color_ONE(1) / 3);
        result += check_equal_simplify(color_trace(e, 1), 2 * color_ONE(0) / 3);
        result += check_equal_simplify(color_trace(e, 2), e);
-       result += check_equal_simplify(color_trace(e, lst(0, 1)), 2);
+       result += check_equal_simplify(color_trace(e, lst{0, 1}), 2);
 
        return result;
 }
 
        return result;
 }
index fd1a7ccb8cc7b601ad1fedc7e7b10c010fb0ab25..540c276d21fa4cc79b2abd509baa0a148132cd73 100644 (file)
@@ -69,19 +69,19 @@ static unsigned exam_differentiation1()
        e = (e1 * e2).expand();
        
        // d e / dx:
        e = (e1 * e2).expand();
        
        // d e / dx:
-       d = ex("121-55/x^2-66/x^3-30/x^3/y^2-42/x^3/y-78/x^3*y-102/x^3*y^2-25/x^2/y^2-35/x^2/y-65/x^2*y-85/x^2*y^2+77/y+143*y+187*y^2+130*x/y^2+182/y*x+338*x*y+442*x*y^2+55/y^2+286*x",lst(x,y));
+       d = ex("121-55/x^2-66/x^3-30/x^3/y^2-42/x^3/y-78/x^3*y-102/x^3*y^2-25/x^2/y^2-35/x^2/y-65/x^2*y-85/x^2*y^2+77/y+143*y+187*y^2+130*x/y^2+182/y*x+338*x*y+442*x*y^2+55/y^2+286*x",lst{x,y});
        result += check_diff(e, x, d);
        
        // d e / dy:
        result += check_diff(e, x, d);
        
        // d e / dy:
-       d = ex("91-30/x^2/y^3-21/x^2/y^2+39/x^2+102/x^2*y-50/x/y^3-35/x/y^2+65/x+170/x*y-77*x/y^2+143*x+374*x*y-130/y^3*x^2-91/y^2*x^2+169*x^2+442*x^2*y-110/y^3*x-70/y^3+238*y-49/y^2",lst(x,y));
+       d = ex("91-30/x^2/y^3-21/x^2/y^2+39/x^2+102/x^2*y-50/x/y^3-35/x/y^2+65/x+170/x*y-77*x/y^2+143*x+374*x*y-130/y^3*x^2-91/y^2*x^2+169*x^2+442*x^2*y-110/y^3*x-70/y^3+238*y-49/y^2",lst{x,y});
        result += check_diff(e, y, d);
        
        // d^2 e / dx^2:
        result += check_diff(e, y, d);
        
        // d^2 e / dx^2:
-       d = ex("286+90/x^4/y^2+126/x^4/y+234/x^4*y+306/x^4*y^2+50/x^3/y^2+70/x^3/y+130/x^3*y+170/x^3*y^2+130/y^2+182/y+338*y+442*y^2+198/x^4+110/x^3",lst(x,y));
+       d = ex("286+90/x^4/y^2+126/x^4/y+234/x^4*y+306/x^4*y^2+50/x^3/y^2+70/x^3/y+130/x^3*y+170/x^3*y^2+130/y^2+182/y+338*y+442*y^2+198/x^4+110/x^3",lst{x,y});
        result += check_diff(e, x, d, 2);
        
        // d^2 e / dy^2:
        result += check_diff(e, x, d, 2);
        
        // d^2 e / dy^2:
-       d = ex("238+90/x^2/y^4+42/x^2/y^3+102/x^2+150/x/y^4+70/x/y^3+170/x+330*x/y^4+154*x/y^3+374*x+390*x^2/y^4+182*x^2/y^3+442*x^2+210/y^4+98/y^3",lst(x,y));
+       d = ex("238+90/x^2/y^4+42/x^2/y^3+102/x^2+150/x/y^4+70/x/y^3+170/x+330*x/y^4+154*x/y^3+374*x+390*x^2/y^4+182*x^2/y^3+442*x^2+210/y^4+98/y^3",lst{x,y});
        result += check_diff(e, y, d, 2);
        
        return result;
        result += check_diff(e, y, d, 2);
        
        return result;
index 98dc90faa9800a50f9271c296cd79ec69312afed..bed95aa17057632dccc1b75a0c374e72538a0f22 100644 (file)
@@ -113,8 +113,7 @@ static unsigned exam_factor2()
        unsigned result = 0;
        ex e;
        symbol x("x"), y("y"), z("z");
        unsigned result = 0;
        ex e;
        symbol x("x"), y("y"), z("z");
-       lst syms;
-       syms = x, y, z;
+       lst syms = {x, y, z};
        
        e = ex("x+y", syms);
        result += check_factor(e);
        
        e = ex("x+y", syms);
        result += check_factor(e);
@@ -172,8 +171,7 @@ static unsigned exam_factor3()
        unsigned result = 0;
        ex e;
        symbol k("k"), n("n");
        unsigned result = 0;
        ex e;
        symbol k("k"), n("n");
-       lst syms;
-       syms = k, n;
+       lst syms = {k, n};
        
        e = ex("1/2*(-3+3*k-n)*(-2+3*k-n)*(-1+3*k-n)", syms);
        result += check_factor(e);
        
        e = ex("1/2*(-3+3*k-n)*(-2+3*k-n)*(-1+3*k-n)", syms);
        result += check_factor(e);
index 7351e969ed86e9da5893cf1159de143dea5675fa..cf58ac7fbe7ded16cb5f78ca97d92bad3f010ce1 100644 (file)
@@ -267,12 +267,12 @@ static unsigned edyn_check()
              * indexed(F, rho, sigma)).simplify_indexed();
 
        // Extract transformed electric and magnetic fields
              * indexed(F, rho, sigma)).simplify_indexed();
 
        // Extract transformed electric and magnetic fields
-       ex Ex_p = e.subs(lst(mu == 1, nu == 0)).normal();
-       ex Ey_p = e.subs(lst(mu == 2, nu == 0)).normal();
-       ex Ez_p = e.subs(lst(mu == 3, nu == 0)).normal();
-       ex Bx_p = e.subs(lst(mu == 3, nu == 2)).normal();
-       ex By_p = e.subs(lst(mu == 1, nu == 3)).normal();
-       ex Bz_p = e.subs(lst(mu == 2, nu == 1)).normal();
+       ex Ex_p = e.subs(lst{mu == 1, nu == 0}).normal();
+       ex Ey_p = e.subs(lst{mu == 2, nu == 0}).normal();
+       ex Ez_p = e.subs(lst{mu == 3, nu == 0}).normal();
+       ex Bx_p = e.subs(lst{mu == 3, nu == 2}).normal();
+       ex By_p = e.subs(lst{mu == 1, nu == 3}).normal();
+       ex Bz_p = e.subs(lst{mu == 2, nu == 1}).normal();
 
        // Check results
        result += check_equal(Ex_p, Ex);
 
        // Check results
        result += check_equal(Ex_p, Ex);
@@ -285,7 +285,7 @@ static unsigned edyn_check()
        // Test 2: check energy density and Poynting vector of electromagnetic field
 
        // Minkowski metric
        // Test 2: check energy density and Poynting vector of electromagnetic field
 
        // Minkowski metric
-       ex eta = diag_matrix(lst(1, -1, -1, -1));
+       ex eta = diag_matrix(lst{1, -1, -1, -1});
 
        // Covariant field tensor
        ex F_mu_nu = (indexed(eta, mu.toggle_variance(), rho.toggle_variance())
 
        // Covariant field tensor
        ex F_mu_nu = (indexed(eta, mu.toggle_variance(), rho.toggle_variance())
@@ -294,16 +294,16 @@ static unsigned edyn_check()
 
        // Energy-momentum tensor
        ex T = (-indexed(eta, rho, sigma) * F_mu_nu.subs(s_nu == s_rho) 
 
        // Energy-momentum tensor
        ex T = (-indexed(eta, rho, sigma) * F_mu_nu.subs(s_nu == s_rho) 
-               * F_mu_nu.subs(lst(s_mu == s_nu, s_nu == s_sigma))
+               * F_mu_nu.subs(lst{s_mu == s_nu, s_nu == s_sigma})
              + indexed(eta, mu.toggle_variance(), nu.toggle_variance())
              + indexed(eta, mu.toggle_variance(), nu.toggle_variance())
-               * F_mu_nu.subs(lst(s_mu == s_rho, s_nu == s_sigma))
+               * F_mu_nu.subs(lst{s_mu == s_rho, s_nu == s_sigma})
                * indexed(F, rho, sigma) / 4).simplify_indexed() / (4 * Pi);
 
        // Extract energy density and Poynting vector
                * indexed(F, rho, sigma) / 4).simplify_indexed() / (4 * Pi);
 
        // Extract energy density and Poynting vector
-       ex E = T.subs(lst(s_mu == 0, s_nu == 0)).normal();
-       ex Px = T.subs(lst(s_mu == 0, s_nu == 1));
-       ex Py = T.subs(lst(s_mu == 0, s_nu == 2)); 
-       ex Pz = T.subs(lst(s_mu == 0, s_nu == 3));
+       ex E = T.subs(lst{s_mu == 0, s_nu == 0}).normal();
+       ex Px = T.subs(lst{s_mu == 0, s_nu == 1});
+       ex Py = T.subs(lst{s_mu == 0, s_nu == 2});
+       ex Pz = T.subs(lst{s_mu == 0, s_nu == 3});
 
        // Check results
        result += check_equal(E, (Ex*Ex+Ey*Ey+Ez*Ez+Bx*Bx+By*By+Bz*Bz) / (8 * Pi));
 
        // Check results
        result += check_equal(E, (Ex*Ex+Ey*Ey+Ez*Ez+Bx*Bx+By*By+Bz*Bz) / (8 * Pi));
@@ -382,7 +382,7 @@ static unsigned dummy_check()
        // GiNaC 1.2.1 had a bug here because p.i*p.i -> (p.i)^2
        e = indexed(p, i) * indexed(p, i) * indexed(p, j) + indexed(p, j);
        ex fi = exprseq(e.get_free_indices());
        // GiNaC 1.2.1 had a bug here because p.i*p.i -> (p.i)^2
        e = indexed(p, i) * indexed(p, i) * indexed(p, j) + indexed(p, j);
        ex fi = exprseq(e.get_free_indices());
-       if (!fi.is_equal(exprseq(j))) {
+       if (!fi.is_equal(exprseq{j})) {
                clog << "get_free_indices(" << e << ") erroneously returned "
                     << fi << " instead of (.j)" << endl;
                ++result;
                clog << "get_free_indices(" << e << ") erroneously returned "
                     << fi << " instead of (.j)" << endl;
                ++result;
index 9415b9b39169e9a9170293e85be81f76382d4fd4..0fbfaec6bbf7ba397753bb5088107a6541af18b2 100644 (file)
@@ -134,19 +134,19 @@ static unsigned inifcns_test_HLi()
 
        lst res;
        
 
        lst res;
        
-       res.append(H(lst(2,1),numeric(1)/2).hold() - (zeta(3)/8 - pow(log(2),3)/6));
-       res.append(H(lst(2,1,3),numeric(1)/3).hold() - Li(lst(2,1,3),lst(numeric(1)/3,1,1)).hold());
-       res.append(H(lst(2,1,3),numeric(98)/100).hold() - Li(lst(2,1,3),lst(numeric(98)/100,1,1)).hold());
-       res.append(H(lst(2,1,3),numeric(245)/100).hold() - Li(lst(2,1,3),lst(numeric(245)/100,1,1)).hold());
-       res.append(H(lst(4,1,1,1),numeric(1)/3).hold() - S(3,4,numeric(1)/3).hold());
-       res.append(H(lst(4,1,1,1),numeric(98)/100).hold() - S(3,4,numeric(98)/100).hold());
-       res.append(H(lst(4,1,1,1),numeric(245)/100).hold() - S(3,4,numeric(245)/100).hold());
-       res.append(H(lst(2,2,3),almostone).hold() - zeta(lst(2,2,3)));
-       res.append(H(lst(-3,-1,2,1),almostone).hold() - zeta(lst(3,1,2,1),lst(-1,1,-1,1)));
-       res.append(H(lst(-2,1,3),numeric(1)/3).hold() - -Li(lst(2,1,3),lst(-numeric(1)/3,-1,1)).hold());
-       res.append(H(lst(-2,1,3),numeric(98)/100).hold() - -Li(lst(2,1,3),lst(-numeric(98)/100,-1,1)).hold());
-       res.append(H(lst(-2,1,3),numeric(245)/100).hold() - -Li(lst(2,1,3),lst(-numeric(245)/100,-1,1)).hold());
-       res.append(H(lst(-3,1,-2,0,0),numeric(3)/10).hold() - convert_H_to_Li(lst(-3,1,-2,0,0),numeric(3)/10).eval());
+       res.append(H(lst{2,1},numeric(1)/2).hold() - (zeta(3)/8 - pow(log(2),3)/6));
+       res.append(H(lst{2,1,3},numeric(1)/3).hold() - Li(lst{2,1,3},lst{numeric(1)/3,1,1}).hold());
+       res.append(H(lst{2,1,3},numeric(98)/100).hold() - Li(lst{2,1,3},lst{numeric(98)/100,1,1}).hold());
+       res.append(H(lst{2,1,3},numeric(245)/100).hold() - Li(lst{2,1,3},lst{numeric(245)/100,1,1}).hold());
+       res.append(H(lst{4,1,1,1},numeric(1)/3).hold() - S(3,4,numeric(1)/3).hold());
+       res.append(H(lst{4,1,1,1},numeric(98)/100).hold() - S(3,4,numeric(98)/100).hold());
+       res.append(H(lst{4,1,1,1},numeric(245)/100).hold() - S(3,4,numeric(245)/100).hold());
+       res.append(H(lst{2,2,3},almostone).hold() - zeta(lst{2,2,3}));
+       res.append(H(lst{-3,-1,2,1},almostone).hold() - zeta(lst{3,1,2,1},lst{-1,1,-1,1}));
+       res.append(H(lst{-2,1,3},numeric(1)/3).hold() - -Li(lst{2,1,3},lst{-numeric(1)/3,-1,1}).hold());
+       res.append(H(lst{-2,1,3},numeric(98)/100).hold() - -Li(lst{2,1,3},lst{-numeric(98)/100,-1,1}).hold());
+       res.append(H(lst{-2,1,3},numeric(245)/100).hold() - -Li(lst{2,1,3},lst{-numeric(245)/100,-1,1}).hold());
+       res.append(H(lst{-3,1,-2,0,0},numeric(3)/10).hold() - convert_H_to_Li(lst{-3,1,-2,0,0},numeric(3)/10).eval());
        
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                ex diff = abs((*it).evalf());
        
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                ex diff = abs((*it).evalf());
@@ -160,8 +160,8 @@ static unsigned inifcns_test_HLi()
        Digits = digitsbuf;
 
        // conjugate test
        Digits = digitsbuf;
 
        // conjugate test
-       numeric cdif = ex_to<numeric>(H(lst(2,2,1),5.0-5.0*I) - H(lst(2,2,1),5.0+5.0*I));
-       numeric cadd = ex_to<numeric>(H(lst(2,2,1),5.0-5.0*I) + H(lst(2,2,1),5.0+5.0*I));
+       numeric cdif = ex_to<numeric>(H(lst{2,2,1},5.0-5.0*I) - H(lst{2,2,1},5.0+5.0*I));
+       numeric cadd = ex_to<numeric>(H(lst{2,2,1},5.0-5.0*I) + H(lst{2,2,1},5.0+5.0*I));
        if ((cdif.real() > prec) || (cadd.imag() > prec)) {
                clog << "complex conjugation test of H({2,2,1},5.0-5.0*I) seems to be wrong: " << cdif << " " << cadd << endl;
                result++;
        if ((cdif.real() > prec) || (cadd.imag() > prec)) {
                clog << "complex conjugation test of H({2,2,1},5.0-5.0*I) seems to be wrong: " << cdif << " " << cadd << endl;
                result++;
@@ -186,16 +186,16 @@ static unsigned inifcns_test_zeta()
 
        lst res;
        
 
        lst res;
        
-       res.append(zeta(lst(2,1)) - zeta(3));
-       res.append(zeta(lst(2,1,1,1,1)) - zeta(6));
-       res.append(zeta(lst(6,3)) - (zeta(9)*83/2 - zeta(2)*zeta(7)*21 - zeta(2)*zeta(2)*zeta(5)*12/5));
-       res.append(zeta(lst(4,2,3)) - (-zeta(9)*59 + zeta(2)*zeta(7)*28 + pow(zeta(2),2)*zeta(5)*4 -
+       res.append(zeta(lst{2,1}) - zeta(3));
+       res.append(zeta(lst{2,1,1,1,1}) - zeta(6));
+       res.append(zeta(lst{6,3}) - (zeta(9)*83/2 - zeta(2)*zeta(7)*21 - zeta(2)*zeta(2)*zeta(5)*12/5));
+       res.append(zeta(lst{4,2,3}) - (-zeta(9)*59 + zeta(2)*zeta(7)*28 + pow(zeta(2),2)*zeta(5)*4 -
                                       pow(zeta(3),3)/3 + pow(zeta(2),3)*zeta(3)*8/21));
                                       pow(zeta(3),3)/3 + pow(zeta(2),3)*zeta(3)*8/21));
-       res.append(zeta(lst(3,1,3,1,3,1,3,1)) - (2*pow(Pi,16)/factorial(18)));
-       res.append(zeta(lst(2),lst(-1)) - -zeta(2)/2);
-       res.append(zeta(lst(1,2),lst(-1,1)) - (-zeta(3)/4 - zeta(lst(1),lst(-1))*zeta(2)/2));
-       res.append(zeta(lst(2,1,1),lst(-1,-1,1)) - (-pow(zeta(2),2)*23/40 - pow(zeta(lst(1),lst(-1)),2)*zeta(2)*3/4
-                                                   - zeta(lst(3,1),lst(-1,1))*3/2 - zeta(lst(1),lst(-1))*zeta(3)*21/8));
+       res.append(zeta(lst{3,1,3,1,3,1,3,1}) - (2*pow(Pi,16)/factorial(18)));
+       res.append(zeta(lst{2},lst{-1}) - -zeta(2)/2);
+       res.append(zeta(lst{1,2},lst{-1,1}) - (-zeta(3)/4 - zeta(lst{1},lst{-1})*zeta(2)/2));
+       res.append(zeta(lst{2,1,1},lst{-1,-1,1}) - (-pow(zeta(2),2)*23/40 - pow(zeta(lst{1},lst{-1}),2)*zeta(2)*3/4
+                                                   - zeta(lst{3,1},lst{-1,1})*3/2 - zeta(lst{1},lst{-1})*zeta(3)*21/8));
        
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                Digits = 17;
        
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                Digits = 17;
@@ -241,42 +241,42 @@ static unsigned inifcns_test_LiG()
 
        lst res;
        
 
        lst res;
        
-       res.append(Li(lst(4), lst(6)).hold() - Li(4, 6.0));
-       res.append(G(lst(0,0,5.0,0,2.0,0,0,0,3.0),0.5).hold()
-                  + Li(lst(3,2,4), lst(numeric(1,10), numeric(5,2), numeric(2,3))));
-       res.append(Li(lst(2,1,1), lst(almostone, almostone, almostone)) - zeta(lst(2,1,1)));
+       res.append(Li(lst{4}, lst{6}).hold() - Li(4, 6.0));
+       res.append(G(lst{0,0,5.0,0,2.0,0,0,0,3.0},0.5).hold()
+                  + Li(lst{3,2,4}, lst{numeric(1,10), numeric(5,2), numeric(2,3)}));
+       res.append(Li(lst{2,1,1}, lst{almostone, almostone, almostone}) - zeta(lst{2,1,1}));
 
        // check Li_{1,1} against known expression
        symbol x("x"), y("y");
        ex eps = 1e-30*I;
 
        // check Li_{1,1} against known expression
        symbol x("x"), y("y");
        ex eps = 1e-30*I;
-       ex s1 = Li(lst(1,1),lst(x,y));
+       ex s1 = Li(lst{1,1},lst{x,y});
        ex s2 = log(1-1/x/y-eps)*log((1-1/x-eps)/(1/x/y-1/x)) + Li(2,(1-1/x/y-eps)/(1/x-1/x/y))
                        - log(-1/x/y-eps)*log((-1/x-eps)/(1/x/y-1/x)) - Li(2,(-1/x/y-eps)/(1/x-1/x/y))
                        - log(-1/x/y-eps)*log(1-1/x-eps) + log(-1/x/y-eps)*log(-1/x-eps);
        ex s2 = log(1-1/x/y-eps)*log((1-1/x-eps)/(1/x/y-1/x)) + Li(2,(1-1/x/y-eps)/(1/x-1/x/y))
                        - log(-1/x/y-eps)*log((-1/x-eps)/(1/x/y-1/x)) - Li(2,(-1/x/y-eps)/(1/x-1/x/y))
                        - log(-1/x/y-eps)*log(1-1/x-eps) + log(-1/x/y-eps)*log(-1/x-eps);
-       res.append(s1.subs(lst(x==numeric(1)/2, y==3)) - s2.subs(lst(x==numeric(1)/2, y==3)));
-       res.append(s1.subs(lst(x==numeric(3)/2, y==numeric(1)/2)) - s2.subs(lst(x==numeric(3)/2, y==numeric(1)/2)));
-       res.append(s1.subs(lst(x==2, y==numeric(4)/5)) - s2.subs(lst(x==2, y==numeric(4)/5)));
+       res.append(s1.subs(lst{x==numeric(1)/2, y==3}) - s2.subs(lst{x==numeric(1)/2, y==3}));
+       res.append(s1.subs(lst{x==numeric(3)/2, y==numeric(1)/2}) - s2.subs(lst{x==numeric(3)/2, y==numeric(1)/2}));
+       res.append(s1.subs(lst{x==2, y==numeric(4)/5}) - s2.subs(lst{x==2, y==numeric(4)/5}));
 
        // shuffle and quasi-shuffle identities
 
        // shuffle and quasi-shuffle identities
-       res.append(G(lst(0,0.2),1).hold() * G(lst(0.5),1).hold() - G(lst(0.5,0,0.2),1).hold()
-                       - G(lst(0,0.5,0.2),1).hold() - G(lst(0,0.2,0.5),1).hold());
-       res.append(G(lst(0,0.5),1).hold() * G(lst(0.6),1).hold() - G(lst(0,0.5,0.5*0.6),1).hold()
-                       - G(lst(0.6,0,0.5*0.6),1).hold() + G(lst(0,0,0.5*0.6),1).hold());
-       res.append(Li(lst(2),lst(numeric(1,5))).hold() * Li(lst(3),lst(7)).hold() - Li(lst(2,3),lst(numeric(1,5),7)).hold()
-                       - Li(lst(3,2),lst(7,numeric(1,5))).hold() - Li(lst(5),lst(numeric(7,5))).hold());
+       res.append(G(lst{0,0.2},1).hold() * G(lst{0.5},1).hold() - G(lst{0.5,0,0.2},1).hold()
+                - G(lst{0,0.5,0.2},1).hold() - G(lst{0,0.2,0.5},1).hold());
+       res.append(G(lst{0,0.5},1).hold() * G(lst{0.6},1).hold() - G(lst{0,0.5,0.5*0.6},1).hold()
+                - G(lst{0.6,0,0.5*0.6},1).hold() + G(lst{0,0,0.5*0.6},1).hold());
+       res.append(Li(lst{2},lst{numeric(1,5)}).hold() * Li(lst{3},lst{7}).hold() - Li(lst{2,3},lst{numeric(1,5),7}).hold()
+                - Li(lst{3,2},lst{7,numeric(1,5)}).hold() - Li(lst{5},lst{numeric(7,5)}).hold());
        symbol a1, a2, a3, a4;
        symbol a1, a2, a3, a4;
-       res.append((G(lst(a1,a2),1) * G(lst(a3,a4),1) - G(lst(a1,a2,a3,a4),1)
-                       - G(lst(a1,a3,a2,a4),1) - G(lst(a3,a1,a2,a4),1)
-                       - G(lst(a1,a3,a4,a2),1) - G(lst(a3,a1,a4,a2),1) - G(lst(a3,a4,a1,a2),1))
-                               .subs(lst(a1==numeric(1)/10, a2==numeric(3)/10, a3==numeric(7)/10, a4==5)));
-       res.append(G(lst(-0.009),1).hold() * G(lst(-8,1.4999),1).hold() - G(lst(-0.009,-8,1.4999),1).hold()
-                       - G(lst(-8,-0.009,1.4999),1).hold() - G(lst(-8,1.4999,-0.009),1).hold());
-       res.append(G(lst(sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2)),1).hold() * G(lst(1.51,-0.999),1).hold()
-                       - G(lst(sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2),1.51,-0.999),1).hold()
-                       - G(lst(1.51,sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2),-0.999),1).hold()
-                       - G(lst(1.51,-0.999,sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2)),1).hold());
+       res.append((G(lst{a1,a2},1) * G(lst{a3,a4},1) - G(lst{a1,a2,a3,a4},1)
+                 - G(lst{a1,a3,a2,a4},1) - G(lst{a3,a1,a2,a4},1)
+                 - G(lst{a1,a3,a4,a2},1) - G(lst{a3,a1,a4,a2},1) - G(lst{a3,a4,a1,a2},1))
+                  .subs(lst{a1==numeric(1)/10, a2==numeric(3)/10, a3==numeric(7)/10, a4==5}));
+       res.append(G(lst{-0.009},1).hold() * G(lst{-8,1.4999},1).hold() - G(lst{-0.009,-8,1.4999},1).hold()
+                - G(lst{-8,-0.009,1.4999},1).hold() - G(lst{-8,1.4999,-0.009},1).hold());
+       res.append(G(lst{sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2)},1).hold() * G(lst{1.51,-0.999},1).hold()
+                - G(lst{sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2),1.51,-0.999},1).hold()
+                - G(lst{1.51,sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2),-0.999},1).hold()
+                - G(lst{1.51,-0.999,sqrt(numeric(1)/2)+I*sqrt(numeric(1)/2)},1).hold());
        // checks for hoelder convolution which is used if one argument has a distance to one smaller than 0.01 
        // checks for hoelder convolution which is used if one argument has a distance to one smaller than 0.01 
-       res.append(G(lst(0, 1.2, 1, 1.01), 1).hold() - G(lst(0, 1.2, 1, numeric("1.009999999999999999")), 1).hold());
+       res.append(G(lst{0, 1.2, 1, 1.01}, 1).hold() - G(lst{0, 1.2, 1, numeric("1.009999999999999999")}, 1).hold());
 
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                ex diff = abs((*it).evalf());
 
        for (lst::const_iterator it = res.begin(); it != res.end(); it++) {
                ex diff = abs((*it).evalf());
@@ -308,7 +308,7 @@ static unsigned inifcns_test_legacy()
 
        unsigned result = 0;
 
 
        unsigned result = 0;
 
-       ex r1 = zeta(lst(1,1,1,1,1,1),lst(-1,-1,-1,1,1,1));
+       ex r1 = zeta(lst{1,1,1,1,1,1}, lst{-1,-1,-1,1,1,1});
        if ((r1.evalf() - numeric("-0.0012588769028204890704")) > prec) {
                clog << "zeta({1,1,1,1,1,1},{-1,-1,-1,1,1,1}) seems to be wrong." << endl;
                result++;
        if ((r1.evalf() - numeric("-0.0012588769028204890704")) > prec) {
                clog << "zeta({1,1,1,1,1,1},{-1,-1,-1,1,1,1}) seems to be wrong." << endl;
                result++;
@@ -316,15 +316,15 @@ static unsigned inifcns_test_legacy()
 
        ex x1 = exp(2*Pi*I/13).evalf();
        ex x2 = exp(24*Pi*I/13).evalf();
 
        ex x1 = exp(2*Pi*I/13).evalf();
        ex x2 = exp(24*Pi*I/13).evalf();
-       ex r2 = Li(lst(2),lst(x1)).hold().evalf();
-       ex r3 = Li(lst(2),lst(x2)).hold().evalf();
+       ex r2 = Li(lst{2},lst{x1}).hold().evalf();
+       ex r3 = Li(lst{2},lst{x2}).hold().evalf();
        if ( abs(r2-conjugate(r3)) > prec ) {
                clog << "Legacy test 2 seems to be wrong." << endl;
                result++;
        }
 
        ex x3 = exp(5*Pi*I/3).evalf();
        if ( abs(r2-conjugate(r3)) > prec ) {
                clog << "Legacy test 2 seems to be wrong." << endl;
                result++;
        }
 
        ex x3 = exp(5*Pi*I/3).evalf();
-       ex r4 = Li(lst(3),lst(x3)).hold().evalf();
+       ex r4 = Li(lst{3},lst{x3}).hold().evalf();
        if ( abs(r4 - numeric("0.40068563438653142847-0.95698384815740185713*I")) > prec ) {
                clog << "Legacy test 3 seems to be wrong." << endl;
                result++;
        if ( abs(r4 - numeric("0.40068563438653142847-0.95698384815740185713*I")) > prec ) {
                clog << "Legacy test 3 seems to be wrong." << endl;
                result++;
@@ -339,27 +339,27 @@ static unsigned inifcns_test_legacy()
        ex x4 = exp(4*Pi*I/3).evalf();
        ex x5 = exp(5*Pi*I/3).evalf();
 
        ex x4 = exp(4*Pi*I/3).evalf();
        ex x5 = exp(5*Pi*I/3).evalf();
 
-       ex r5 = Li(lst(1,1,1,1),lst(x2,x4,x3,x0)).hold().evalf();
-       ex r6 = Li(lst(1,1,1,1),lst(x4,x2,x3,x0)).hold().evalf();
+       ex r5 = Li(lst{1,1,1,1},lst{x2,x4,x3,x0}).hold().evalf();
+       ex r6 = Li(lst{1,1,1,1},lst{x4,x2,x3,x0}).hold().evalf();
        if ( abs(r5-conjugate(r6)) > prec ) {
                clog << "Legacy test 4 seems to be wrong." << endl;
                result++;
        }
 
        if ( abs(r5-conjugate(r6)) > prec ) {
                clog << "Legacy test 4 seems to be wrong." << endl;
                result++;
        }
 
-       ex r7 = Li(lst(1,2,1),lst(x3,x2,x4)).hold().evalf()
-               +Li(lst(1,1,2),lst(x3,x2,x4)).hold().evalf()
-               +Li(lst(1,1,1,1),lst(x3,x0,x2,x4)).hold().evalf()
-               +Li(lst(1,1,1,1),lst(x3,x2,x0,x4)).hold().evalf()
-               +Li(lst(1,1,1,1),lst(x3,x2,x4,x0)).hold().evalf()
-               +Li(lst(1,2,1),lst(x2,x1,x0)).hold().evalf()
-               +Li(lst(1,1,2),lst(x2,x3,x4)).hold().evalf()
-               +Li(lst(1,1,1,1),lst(x2,x4,x3,x0)).hold().evalf()
-               +Li(lst(1,1,1,1),lst(x2,x3,x4,x0)).hold().evalf()
-               +Li(lst(1,1,1,1),lst(x2,x3,x0,x4)).hold().evalf()
-               +Li(lst(2,2),lst(x5,x4)).hold().evalf()
-               +Li(lst(2,1,1),lst(x5,x0,x4)).hold().evalf()
-               +Li(lst(2,1,1),lst(x5,x4,x0)).hold().evalf()
-               -Li(lst(1,1),lst(x3,x0)).hold().evalf()*Li(lst(1,1),lst(x2,x4)).hold().evalf();
+       ex r7 = Li(lst{1,2,1},lst{x3,x2,x4}).hold().evalf()
+               +Li(lst{1,1,2},lst{x3,x2,x4}).hold().evalf()
+               +Li(lst{1,1,1,1},lst{x3,x0,x2,x4}).hold().evalf()
+               +Li(lst{1,1,1,1},lst{x3,x2,x0,x4}).hold().evalf()
+               +Li(lst{1,1,1,1},lst{x3,x2,x4,x0}).hold().evalf()
+               +Li(lst{1,2,1},lst{x2,x1,x0}).hold().evalf()
+               +Li(lst{1,1,2},lst{x2,x3,x4}).hold().evalf()
+               +Li(lst{1,1,1,1},lst{x2,x4,x3,x0}).hold().evalf()
+               +Li(lst{1,1,1,1},lst{x2,x3,x4,x0}).hold().evalf()
+               +Li(lst{1,1,1,1},lst{x2,x3,x0,x4}).hold().evalf()
+               +Li(lst{2,2},lst{x5,x4}).hold().evalf()
+               +Li(lst{2,1,1},lst{x5,x0,x4}).hold().evalf()
+               +Li(lst{2,1,1},lst{x5,x4,x0}).hold().evalf()
+               -Li(lst{1,1},lst{x3,x0}).hold().evalf()*Li(lst{1,1},lst{x2,x4}).hold().evalf();
        if ( abs(r7) > prec ) {
                clog << "Legacy test 5 seems to be wrong." << endl;
                result++;
        if ( abs(r7) > prec ) {
                clog << "Legacy test 5 seems to be wrong." << endl;
                result++;
@@ -373,15 +373,15 @@ static unsigned inifcns_test_legacy()
 static unsigned check_G_y_one_bug()
 {
        exvector exprs;
 static unsigned check_G_y_one_bug()
 {
        exvector exprs;
-       exprs.push_back(G(lst(-1,-1, 1,-1, 0), 1));
-       exprs.push_back(G(lst(-1, 0, 1,-1, 0), 1));
-       exprs.push_back(G(lst(-1, 1,-1,-1, 0), 1));
-       exprs.push_back(G(lst(-1, 1,-1, 0, 0), 1));
-       exprs.push_back(G(lst(-1, 1,-1, 1, 0), 1));
-       exprs.push_back(G(lst(-1, 1, 0,-1, 0), 1));
-       exprs.push_back(G(lst(-1, 1, 1,-1, 0), 1));
-       exprs.push_back(G(lst( 0,-1, 1,-1, 0), 1));
-       exprs.push_back(G(lst( 0, 1, 1,-1, 0), 1));
+       exprs.push_back(G(lst{-1,-1, 1,-1, 0}, 1));
+       exprs.push_back(G(lst{-1, 0, 1,-1, 0}, 1));
+       exprs.push_back(G(lst{-1, 1,-1,-1, 0}, 1));
+       exprs.push_back(G(lst{-1, 1,-1, 0, 0}, 1));
+       exprs.push_back(G(lst{-1, 1,-1, 1, 0}, 1));
+       exprs.push_back(G(lst{-1, 1, 0,-1, 0}, 1));
+       exprs.push_back(G(lst{-1, 1, 1,-1, 0}, 1));
+       exprs.push_back(G(lst{ 0,-1, 1,-1, 0}, 1));
+       exprs.push_back(G(lst{ 0, 1, 1,-1, 0}, 1));
        unsigned err = 0;
        for (exvector::const_iterator ep = exprs.begin(); ep != exprs.end(); ++ep) {
                try {
        unsigned err = 0;
        for (exvector::const_iterator ep = exprs.begin(); ep != exprs.end(); ++ep) {
                try {
index 3e1c25e5de5ae6af233f23272763860432758c2b..b5b27ffc37a068719c598b696c2fa93eb34e9d99 100644 (file)
@@ -224,16 +224,16 @@ static unsigned matrix_evalm()
 {
        unsigned result = 0;
 
 {
        unsigned result = 0;
 
-       matrix S(2, 2, lst(
+       matrix S(2, 2, lst{
                1, 2,
                3, 4
                1, 2,
                3, 4
-       )), T(2, 2, lst(
+       }), T(2, 2, lst{
                1, 1,
                2, -1
                1, 1,
                2, -1
-       )), R(2, 2, lst(
+       }), R(2, 2, lst{
                27, 14,
                36, 26
                27, 14,
                36, 26
-       ));
+       });
 
        ex e = ((S + T) * (S + 2*T));
        ex f = e.evalm();
 
        ex e = ((S + T) * (S + 2*T));
        ex f = e.evalm();
index cdbb7637b30c2ed92b4c4bd43ef510e7dc592b25..50837cef3001b28d1bdfd5e8d68cf0f6dd990dc2 100644 (file)
@@ -96,7 +96,7 @@ static unsigned exam_sqrfree()
        ex e1, e2;
        
        e1 = (1+x)*pow((2+x),2)*pow((3+x),3)*pow((4+x),4);
        ex e1, e2;
        
        e1 = (1+x)*pow((2+x),2)*pow((3+x),3)*pow((4+x),4);
-       e2 = sqrfree(expand(e1),lst(x));
+       e2 = sqrfree(expand(e1),lst{x});
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << ")) erroneously returned "
                     << e2 << endl;
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << ")) erroneously returned "
                     << e2 << endl;
@@ -110,19 +110,19 @@ static unsigned exam_sqrfree()
                     << e2 << endl;
                ++result;
        }
                     << e2 << endl;
                ++result;
        }
-       e2 = sqrfree(expand(e1),lst(x));
+       e2 = sqrfree(expand(e1),lst{x});
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << "),[x]) erroneously returned "
                     << e2 << endl;
                ++result;
        }
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << "),[x]) erroneously returned "
                     << e2 << endl;
                ++result;
        }
-       e2 = sqrfree(expand(e1),lst(y));
+       e2 = sqrfree(expand(e1),lst{y});
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << "),[y]) erroneously returned "
                     << e2 << endl;
                ++result;
        }
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << "),[y]) erroneously returned "
                     << e2 << endl;
                ++result;
        }
-       e2 = sqrfree(expand(e1),lst(x,y));
+       e2 = sqrfree(expand(e1),lst{x,y});
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << "),[x,y]) erroneously returned "
                     << e2 << endl;
        if (e1 != e2) {
                clog << "sqrfree(expand(" << e1 << "),[x,y]) erroneously returned "
                     << e2 << endl;
index 8170e36477a414a8468b4f949ce02bd4a1306764..73700a1345fcc9c29eb776cfa2d09893efd7235a 100644 (file)
@@ -366,7 +366,7 @@ static unsigned exam_numeric6()
 
                                        // Read back expression from string
                                        string x_as_string = s.str();
 
                                        // Read back expression from string
                                        string x_as_string = s.str();
-                                       ex x_again(x_as_string, lst(sym));
+                                       ex x_again(x_as_string, lst{sym});
 
                                        // They should be equal
                                        if (!x_again.is_equal(x)) {
 
                                        // They should be equal
                                        if (!x_again.is_equal(x)) {
index b81760357852be8c8a0abe288228d5df85fcb3a7..3bfac6e8b0eef01813740850c490b07ab3456835 100644 (file)
@@ -69,7 +69,7 @@ static unsigned exam_powerlaws1()
                return 1;
        }
        
                return 1;
        }
        
-       ex e4 = e1.subs(lst(a==-1, b==-2.5));
+       ex e4 = e1.subs(lst{a==-1, b==-2.5});
        if (!(is_exactly_a<power>(e4) &&
              is_exactly_a<power>(e4.op(0)) &&
              is_exactly_a<symbol>(e4.op(0).op(0)) &&
        if (!(is_exactly_a<power>(e4) &&
              is_exactly_a<power>(e4.op(0)) &&
              is_exactly_a<symbol>(e4.op(0).op(0)) &&
@@ -81,7 +81,7 @@ static unsigned exam_powerlaws1()
                return 1;
        }
        
                return 1;
        }
        
-       ex e5 = e1.subs(lst(a==-0.9, b==2.5));
+       ex e5 = e1.subs(lst{a==-0.9, b==2.5});
        if (!(is_exactly_a<power>(e5) &&
              is_exactly_a<symbol>(e5.op(0)) &&
              is_exactly_a<numeric>(e5.op(1)) &&
        if (!(is_exactly_a<power>(e5) &&
              is_exactly_a<symbol>(e5.op(0)) &&
              is_exactly_a<numeric>(e5.op(1)) &&
@@ -91,7 +91,7 @@ static unsigned exam_powerlaws1()
                return 1;
        }
        
                return 1;
        }
        
-       ex e6 = e1.subs(lst(a==numeric(3)+numeric(5.3)*I, b==-5));
+       ex e6 = e1.subs(lst{a==numeric(3)+numeric(5.3)*I, b==-5});
        if (!(is_exactly_a<power>(e6) &&
              is_exactly_a<symbol>(e6.op(0)) &&
              is_exactly_a<numeric>(e6.op(1)) &&
        if (!(is_exactly_a<power>(e6) &&
              is_exactly_a<symbol>(e6.op(0)) &&
              is_exactly_a<numeric>(e6.op(1)) &&
@@ -162,7 +162,7 @@ static unsigned exam_powerlaws2()
                return 1;
        }
        
                return 1;
        }
        
-       ex e5 = e1.subs(lst(a==3.2, b==3+numeric(5)*I));
+       ex e5 = e1.subs(lst{a==3.2, b==3+numeric(5)*I});
        if (!(is_exactly_a<mul>(e5) &&
              (e5.nops()==2) &&
              is_exactly_a<power>(e5.op(0)) &&
        if (!(is_exactly_a<mul>(e5) &&
              (e5.nops()==2) &&
              is_exactly_a<power>(e5.op(0)) &&
@@ -174,7 +174,7 @@ static unsigned exam_powerlaws2()
                return 1;
        }
        
                return 1;
        }
        
-       ex e6 = e1.subs(lst(a==-3.2, b==3+numeric(5)*I));
+       ex e6 = e1.subs(lst{a==-3.2, b==3+numeric(5)*I});
        if (!(is_exactly_a<mul>(e6) &&
              (e6.nops()==2) &&
              is_exactly_a<power>(e6.op(0)) &&
        if (!(is_exactly_a<mul>(e6) &&
              (e6.nops()==2) &&
              is_exactly_a<power>(e6.op(0)) &&
@@ -186,7 +186,7 @@ static unsigned exam_powerlaws2()
                return 1;
        }
        
                return 1;
        }
        
-       ex e7 = e1.subs(lst(a==3+numeric(5)*I, b==3.2));
+       ex e7 = e1.subs(lst{a==3+numeric(5)*I, b==3.2});
        if (!(is_exactly_a<power>(e7) &&
              is_exactly_a<mul>(e7.op(0)) &&
              (e7.op(0).nops()==2) &&
        if (!(is_exactly_a<power>(e7) &&
              is_exactly_a<mul>(e7.op(0)) &&
              (e7.op(0).nops()==2) &&
index 2b3864af478022887c5069a7a6dda278fa152d4d..455c2f1d7ab9df45bb2f88d42a11be144f8716f7 100644 (file)
@@ -70,7 +70,7 @@ static unsigned test()
        }
        ex det = m.determinant();
        // The result should have been:
        }
        ex det = m.determinant();
        // The result should have been:
-       ex cmp("-12*x2^2*x5^2*x4-12*x1*x5^2*x3^2-x5^3*x4^2-12*x1*x5^2*x4^2-12*x2*x5^2*x4^2-12*x3*x5^2*x4^2-x4^3*x5^2-36*x3*x1*x5^2*x4-36*x3*x1*x4^2*x5-36*x3*x2*x5^2*x4-36*x3*x2*x4^2*x5-2*x5^3*x4*x2-12*x3^2*x5^2*x4-12*x3^2*x4^2*x5-2*x5^3*x4*x3-2*x4^3*x5*x3-12*x1*x5^2*x2^2-36*x1*x5*x3^2*x4-36*x2*x5*x3^2*x4-x3^3*x5^2-x3^3*x4^2-2*x3^3*x5*x4-12*x2^2*x4^2*x5-12*x2*x5^2*x3^2-12*x2*x4^2*x3^2-12*x1*x4^2*x3^2-x3^2*x5^3-x3^2*x4^3-2*x4^3*x5*x2-2*x3*x5^3*x2-2*x3*x4^3*x2-2*x3^3*x5*x2-2*x3^3*x4*x2-2*x2^3*x5*x4-2*x2^3*x5*x3-2*x2^3*x4*x3-36*x2^2*x5*x4*x3-36*x2*x1*x5^2*x4-36*x2*x1*x4^2*x5-120*x2*x1*x5*x4*x3-36*x2*x1*x5^2*x3-36*x2*x1*x4^2*x3-36*x2*x1*x3^2*x5-36*x2*x1*x3^2*x4-12*x2^2*x5^2*x3-12*x2^2*x4^2*x3-12*x2^2*x3^2*x5-12*x2^2*x3^2*x4-2*x1^3*x4*x3-2*x1^3*x4*x2-2*x1^3*x3*x2-2*x1^3*x5*x2-36*x1^2*x5*x4*x3-36*x2*x1^2*x5*x4-36*x2*x3*x1^2*x5-36*x2*x3*x1^2*x4-x1^3*x5^2-x1^3*x4^2-x1^3*x3^2-x1^3*x2^2-x2^2*x5^3-x2^2*x4^3-x2^2*x3^3-12*x1*x4^2*x2^2-12*x1*x3^2*x2^2-12*x1^2*x5^2*x4-12*x1^2*x4^2*x5-12*x1^2*x5^2*x3-12*x1^2*x4^2*x3-12*x1^2*x3^2*x5-12*x1^2*x3^2*x4-12*x1^2*x5^2*x2-12*x1^2*x4^2*x2-12*x1^2*x3^2*x2-12*x1^2*x2^2*x5-12*x1^2*x2^2*x4-12*x1^2*x2^2*x3-2*x5^3*x4*x1-2*x4^3*x5*x1-2*x3*x5^3*x1-2*x3*x4^3*x1-2*x3^3*x5*x1-2*x3^3*x4*x1-2*x2*x5^3*x1-2*x2*x4^3*x1-2*x2*x3^3*x1-2*x2^3*x5*x1-2*x2^3*x4*x1-2*x2^3*x3*x1-2*x1^3*x5*x4-2*x1^3*x5*x3-36*x1*x5*x2^2*x4-36*x1*x5*x2^2*x3-36*x1*x4*x2^2*x3-x1^2*x5^3-x1^2*x4^3-x1^2*x3^3-x2^3*x5^2-x2^3*x4^2-x2^3*x3^2-x1^2*x2^3",lst(x1,x2,x3,x4,x5));
+       ex cmp("-12*x2^2*x5^2*x4-12*x1*x5^2*x3^2-x5^3*x4^2-12*x1*x5^2*x4^2-12*x2*x5^2*x4^2-12*x3*x5^2*x4^2-x4^3*x5^2-36*x3*x1*x5^2*x4-36*x3*x1*x4^2*x5-36*x3*x2*x5^2*x4-36*x3*x2*x4^2*x5-2*x5^3*x4*x2-12*x3^2*x5^2*x4-12*x3^2*x4^2*x5-2*x5^3*x4*x3-2*x4^3*x5*x3-12*x1*x5^2*x2^2-36*x1*x5*x3^2*x4-36*x2*x5*x3^2*x4-x3^3*x5^2-x3^3*x4^2-2*x3^3*x5*x4-12*x2^2*x4^2*x5-12*x2*x5^2*x3^2-12*x2*x4^2*x3^2-12*x1*x4^2*x3^2-x3^2*x5^3-x3^2*x4^3-2*x4^3*x5*x2-2*x3*x5^3*x2-2*x3*x4^3*x2-2*x3^3*x5*x2-2*x3^3*x4*x2-2*x2^3*x5*x4-2*x2^3*x5*x3-2*x2^3*x4*x3-36*x2^2*x5*x4*x3-36*x2*x1*x5^2*x4-36*x2*x1*x4^2*x5-120*x2*x1*x5*x4*x3-36*x2*x1*x5^2*x3-36*x2*x1*x4^2*x3-36*x2*x1*x3^2*x5-36*x2*x1*x3^2*x4-12*x2^2*x5^2*x3-12*x2^2*x4^2*x3-12*x2^2*x3^2*x5-12*x2^2*x3^2*x4-2*x1^3*x4*x3-2*x1^3*x4*x2-2*x1^3*x3*x2-2*x1^3*x5*x2-36*x1^2*x5*x4*x3-36*x2*x1^2*x5*x4-36*x2*x3*x1^2*x5-36*x2*x3*x1^2*x4-x1^3*x5^2-x1^3*x4^2-x1^3*x3^2-x1^3*x2^2-x2^2*x5^3-x2^2*x4^3-x2^2*x3^3-12*x1*x4^2*x2^2-12*x1*x3^2*x2^2-12*x1^2*x5^2*x4-12*x1^2*x4^2*x5-12*x1^2*x5^2*x3-12*x1^2*x4^2*x3-12*x1^2*x3^2*x5-12*x1^2*x3^2*x4-12*x1^2*x5^2*x2-12*x1^2*x4^2*x2-12*x1^2*x3^2*x2-12*x1^2*x2^2*x5-12*x1^2*x2^2*x4-12*x1^2*x2^2*x3-2*x5^3*x4*x1-2*x4^3*x5*x1-2*x3*x5^3*x1-2*x3*x4^3*x1-2*x3^3*x5*x1-2*x3^3*x4*x1-2*x2*x5^3*x1-2*x2*x4^3*x1-2*x2*x3^3*x1-2*x2^3*x5*x1-2*x2^3*x4*x1-2*x2^3*x3*x1-2*x1^3*x5*x4-2*x1^3*x5*x3-36*x1*x5*x2^2*x4-36*x1*x5*x2^2*x3-36*x1*x4*x2^2*x3-x1^2*x5^3-x1^2*x4^3-x1^2*x3^3-x2^3*x5^2-x2^3*x4^2-x2^3*x3^2-x1^2*x2^3",lst{x1,x2,x3,x4,x5});
        if (det!=cmp) {
                clog << "The determinant was miscalculated" << endl;
                return 1;
        if (det!=cmp) {
                clog << "The determinant was miscalculated" << endl;
                return 1;
index c4ad95f98cc1ccc7af28bf794308052fdf106333..c3ce01b00700497b9441d894325e186243f2878b 100644 (file)
@@ -40,16 +40,16 @@ static unsigned test()
        symbol g("g");
        symbol q1("q1"), q2("q2"), q3("q3"), q4("q4");
        
        symbol g("g");
        symbol q1("q1"), q2("q2"), q3("q3"), q4("q4");
        
-       ex ss1 = ex("(4*g*a22^3-g*a12*a21*a22^2-4*n22*a21*a22^2+4*n11*a21*a22^2+7*g*a12*a22^2+4*g^2*a22^2-4*n11*n22*a22^2+4*n11*a22^2+n22*a12*a21^2*a22-n11*a12*a21^2*a22-4*g*a21^2*a22-g*a12^2*a21*a22-5*g^2*a12*a21*a22+5*n11*n22*a12*a21*a22-7*n22*a12*a21*a22+2*n11*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22+3*g^2*a12*a22-3*n11*n22*a12*a22+3*n11*a12*a22+g*a12*a21^3+g^2*a12^2*a21^2-n11*n22*a12^2*a21^2+n22*a12^2*a21^2-2*g*a12*a21^2-3*g^2*a12^2*a21+3*n11*n22*a12^2*a21-3*n22*a12^2*a21-3*g*a12*a21)/(3*g*a12*a21*a22^2-3*n22*a21*a22^2+g*a12*a22^2-n22*a22^2+3*n11*a12*a21^2*a22-3*g*a21^2*a22+5*g*a12^2*a21*a22-5*n22*a12*a21*a22+4*n11*a12*a21*a22-4*g*a21*a22+g*a12^2*a22-n22*a12*a22+n11*a12*a22-g*a22+2*n11*a12^2*a21^2-2*g*a12*a21^2+2*g*a12^3*a21-2*n22*a12^2*a21+2*n11*a12^2*a21-2*g*a12*a21)",lst(g,a12,a21,a22,n11,n22));
+       ex ss1 = ex("(4*g*a22^3-g*a12*a21*a22^2-4*n22*a21*a22^2+4*n11*a21*a22^2+7*g*a12*a22^2+4*g^2*a22^2-4*n11*n22*a22^2+4*n11*a22^2+n22*a12*a21^2*a22-n11*a12*a21^2*a22-4*g*a21^2*a22-g*a12^2*a21*a22-5*g^2*a12*a21*a22+5*n11*n22*a12*a21*a22-7*n22*a12*a21*a22+2*n11*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22+3*g^2*a12*a22-3*n11*n22*a12*a22+3*n11*a12*a22+g*a12*a21^3+g^2*a12^2*a21^2-n11*n22*a12^2*a21^2+n22*a12^2*a21^2-2*g*a12*a21^2-3*g^2*a12^2*a21+3*n11*n22*a12^2*a21-3*n22*a12^2*a21-3*g*a12*a21)/(3*g*a12*a21*a22^2-3*n22*a21*a22^2+g*a12*a22^2-n22*a22^2+3*n11*a12*a21^2*a22-3*g*a21^2*a22+5*g*a12^2*a21*a22-5*n22*a12*a21*a22+4*n11*a12*a21*a22-4*g*a21*a22+g*a12^2*a22-n22*a12*a22+n11*a12*a22-g*a22+2*n11*a12^2*a21^2-2*g*a12*a21^2+2*g*a12^3*a21-2*n22*a12^2*a21+2*n11*a12^2*a21-2*g*a12*a21)",lst{g,a12,a21,a22,n11,n22});
        
        
-       ex ss2 = ex("(4*g*a12*a22^2-4*n22*a22^2+4*a22^2-g*a12^2*a21*a22+n22*a12*a21*a22+4*n11*a12*a21*a22-5*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22-3*n22*a12*a22+3*a12*a22-n11*a12^2*a21^2+a12^2*a21^2+g*a12*a21^2+3*n11*a12^2*a21-3*a12^2*a21-3*g*a12*a21)/(2*g*a12*a22^2-2*n22*a22^2+g*a12^2*a21*a22-n22*a12*a21*a22+2*n11*a12*a21*a22-2*g*a21*a22+2*g*a12^2*a22-2*n22*a12*a22+2*n11*a12*a22-2*g*a22+n11*a12^2*a21^2-g*a12*a21^2+g*a12^3*a21-n22*a12^2*a21+n11*a12^2*a21-g*a12*a21)",lst(g,a12,a21,a22,n11,n22));
+       ex ss2 = ex("(4*g*a12*a22^2-4*n22*a22^2+4*a22^2-g*a12^2*a21*a22+n22*a12*a21*a22+4*n11*a12*a21*a22-5*a12*a21*a22-4*g*a21*a22+3*g*a12^2*a22-3*n22*a12*a22+3*a12*a22-n11*a12^2*a21^2+a12^2*a21^2+g*a12*a21^2+3*n11*a12^2*a21-3*a12^2*a21-3*g*a12*a21)/(2*g*a12*a22^2-2*n22*a22^2+g*a12^2*a21*a22-n22*a12*a21*a22+2*n11*a12*a21*a22-2*g*a21*a22+2*g*a12^2*a22-2*n22*a12*a22+2*n11*a12*a22-2*g*a22+n11*a12^2*a21^2-g*a12*a21^2+g*a12^3*a21-n22*a12^2*a21+n11*a12^2*a21-g*a12*a21)",lst{g,a12,a21,a22,n11,n22});
        
        
-       ex ss3 = ex("(4*p21*a22^3-p21*a12*a21*a22^2-4*p22*a21*a22^2+4*p11*a21*a22^2+7*p21*a12*a22^2-4*p11*p22*a22^2+4*p12*p21*a22^2+4*p11*a22^2+p22*a12*a21^2*a22-p11*a12*a21^2*a22-4*p12*a21^2*a22-p21*a12^2*a21*a22+5*p11*p22*a12*a21*a22-7*p22*a12*a21*a22-5*p12*p21*a12*a21*a22+2*p11*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p11*p22*a12*a22+3*p12*p21*a12*a22+3*p11*a12*a22+p12*a12*a21^3-p11*p22*a12^2*a21^2+p22*a12^2*a21^2+p12*p21*a12^2*a21^2-2*p12*a12*a21^2+3*p11*p22*a12^2*a21-3*p22*a12^2*a21-3*p12*p21*a12^2*a21-3*p12*a12*a21)/(3*p21*a12*a21*a22^2-3*p22*a21*a22^2+p21*a12*a22^2-p22*a22^2+3*p11*a12*a21^2*a22-3*p12*a21^2*a22+5*p21*a12^2*a21*a22-5*p22*a12*a21*a22+4*p11*a12*a21*a22-4*p12*a21*a22+p21*a12^2*a22-p22*a12*a22+p11*a12*a22-p12*a22+2*p11*a12^2*a21^2-2*p12*a12*a21^2+2*p21*a12^3*a21-2*p22*a12^2*a21+2*p11*a12^2*a21-2*p12*a12*a21)",lst(a12,a21,a22,p11,p12,p21,p22));
+       ex ss3 = ex("(4*p21*a22^3-p21*a12*a21*a22^2-4*p22*a21*a22^2+4*p11*a21*a22^2+7*p21*a12*a22^2-4*p11*p22*a22^2+4*p12*p21*a22^2+4*p11*a22^2+p22*a12*a21^2*a22-p11*a12*a21^2*a22-4*p12*a21^2*a22-p21*a12^2*a21*a22+5*p11*p22*a12*a21*a22-7*p22*a12*a21*a22-5*p12*p21*a12*a21*a22+2*p11*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p11*p22*a12*a22+3*p12*p21*a12*a22+3*p11*a12*a22+p12*a12*a21^3-p11*p22*a12^2*a21^2+p22*a12^2*a21^2+p12*p21*a12^2*a21^2-2*p12*a12*a21^2+3*p11*p22*a12^2*a21-3*p22*a12^2*a21-3*p12*p21*a12^2*a21-3*p12*a12*a21)/(3*p21*a12*a21*a22^2-3*p22*a21*a22^2+p21*a12*a22^2-p22*a22^2+3*p11*a12*a21^2*a22-3*p12*a21^2*a22+5*p21*a12^2*a21*a22-5*p22*a12*a21*a22+4*p11*a12*a21*a22-4*p12*a21*a22+p21*a12^2*a22-p22*a12*a22+p11*a12*a22-p12*a22+2*p11*a12^2*a21^2-2*p12*a12*a21^2+2*p21*a12^3*a21-2*p22*a12^2*a21+2*p11*a12^2*a21-2*p12*a12*a21)",lst{a12,a21,a22,p11,p12,p21,p22});
        
        
-       ex ss4 = ex("(4*p21*a12*a22^2-4*p22*a22^2+4*a22^2-p21*a12^2*a21*a22+p22*a12*a21*a22+4*p11*a12*a21*a22-5*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p22*a12*a22+3*a12*a22-p11*a12^2*a21^2+a12^2*a21^2+p12*a12*a21^2+3*p11*a12^2*a21-3*a12^2*a21-3*p12*a12*a21)/(2*p21*a12*a22^2-2*p22*a22^2+p21*a12^2*a21*a22-p22*a12*a21*a22+2*p11*a12*a21*a22-2*p12*a21*a22+2*p21*a12^2*a22-2*p22*a12*a22+2*p11*a12*a22-2*p12*a22+p11*a12^2*a21^2-p12*a12*a21^2+p21*a12^3*a21-p22*a12^2*a21+p11*a12^2*a21-p12*a12*a21)",lst(p11,p12,p21,p22,a12,a21,a22));
+       ex ss4 = ex("(4*p21*a12*a22^2-4*p22*a22^2+4*a22^2-p21*a12^2*a21*a22+p22*a12*a21*a22+4*p11*a12*a21*a22-5*a12*a21*a22-4*p12*a21*a22+3*p21*a12^2*a22-3*p22*a12*a22+3*a12*a22-p11*a12^2*a21^2+a12^2*a21^2+p12*a12*a21^2+3*p11*a12^2*a21-3*a12^2*a21-3*p12*a12*a21)/(2*p21*a12*a22^2-2*p22*a22^2+p21*a12^2*a21*a22-p22*a12*a21*a22+2*p11*a12*a21*a22-2*p12*a21*a22+2*p21*a12^2*a22-2*p22*a12*a22+2*p11*a12*a22-2*p12*a22+p11*a12^2*a21^2-p12*a12*a21^2+p21*a12^3*a21-p22*a12^2*a21+p11*a12^2*a21-p12*a12*a21)",lst{p11,p12,p21,p22,a12,a21,a22});
        
        
-       ex res1 = ex("p11*p22*q1^2*q4^2-p12*p21*q1^2*q4^2-n22*p11*p22*q1*q4^2+2*n11*p11*p22*q1*q4^2-p11*p22*q1*q4^2+n22*p12*p21*q1*q4^2-2*n11*p12*p21*q1*q4^2+p12*p21*q1*q4^2+2*g^2*p11*p22*q4^2-2*n11*n22*p11*p22*q4^2+2*n22*p11*p22*q4^2+2*n11*p11*p22*q4^2-2*p11*p22*q4^2-2*g^2*p12*p21*q4^2+2*n11*n22*p12*p21*q4^2-2*n22*p12*p21*q4^2-2*n11*p12*p21*q4^2+2*p12*p21*q4^2-n11*p22*q1*q2*q3*q4+g*p21*q1*q2*q3*q4+g*p12*q1*q2*q3*q4-n22*p11*q1*q2*q3*q4-g^2*p22*q2*q3*q4+n11*n22*p22*q2*q3*q4-n11*p22*q2*q3*q4-2*g*p21*q2*q3*q4+g*p12*q2*q3*q4+2*g^2*p11*q2*q3*q4-2*n11*n22*p11*q2*q3*q4+2*n22*p11*q2*q3*q4-n11*p22*q1*q3*q4+p22*q1*q3*q4+g*p21*q1*q3*q4-2*g*p12*q1*q3*q4+2*n22*p11*q1*q3*q4-2*p11*q1*q3*q4-g^2*p22*q3*q4+n11*n22*p22*q3*q4-n22*p22*q3*q4-n11*p22*q3*q4+p22*q3*q4-4*g^2*p11*q3*q4+4*n11*n22*p11*q3*q4-4*n22*p11*q3*q4-4*n11*p11*q3*q4+4*p11*q3*q4+n22*p11*p22*q1*q2*q4-2*n11*p11*p22*q1*q2*q4+2*n11*p22*q1*q2*q4-n22*p12*p21*q1*q2*q4+2*n11*p12*p21*q1*q2*q4+g*p21*q1*q2*q4-2*g*p12*q1*q2*q4-n22*p11*q1*q2*q4-4*g^2*p11*p22*q2*q4+4*n11*n22*p11*p22*q2*q4-2*n22*p11*p22*q2*q4-2*n11*p11*p22*q2*q4+2*g^2*p22*q2*q4-2*n11*n22*p22*q2*q4+2*n11*p22*q2*q4+4*g^2*p12*p21*q2*q4-4*n11*n22*p12*p21*q2*q4+2*n22*p12*p21*q2*q4+2*n11*p12*p21*q2*q4-2*g*p21*q2*q4-2*g*p12*q2*q4+2*g^2*p11*q2*q4-2*n11*n22*p11*q2*q4+2*n22*p11*q2*q4-p11*p22*q1^2*q4-p22*q1^2*q4+p12*p21*q1^2*q4+2*p11*q1^2*q4-n22*p11*p22*q1*q4-4*n11*p11*p22*q1*q4+5*p11*p22*q1*q4+n22*p22*q1*q4-p22*q1*q4+n22*p12*p21*q1*q4+4*n11*p12*p21*q1*q4-5*p12*p21*q1*q4+g*p21*q1*q4+4*g*p12*q1*q4+4*n11*p11*q1*q4-4*p11*q1*q4-g^2*q2^2*q3^2+n11*n22*q2^2*q3^2+g^2*q2*q3^2-n11*n22*q2*q3^2-n22*q2*q3^2+2*n11*q2*q3^2+2*g^2*q3^2-2*n11*n22*q3^2+2*n22*q3^2+2*n11*q3^2-2*q3^2+g^2*p22*q2^2*q3-n11*n22*p22*q2^2*q3-2*g^2*p11*q2^2*q3+2*n11*n22*p11*q2^2*q3+g^2*q2^2*q3-n11*n22*q2^2*q3+2*n11*p22*q1*q2*q3-2*g*p21*q1*q2*q3+g*p12*q1*q2*q3-n22*p11*q1*q2*q3+n22*q1*q2*q3-2*n11*q1*q2*q3+g^2*p22*q2*q3-n11*n22*p22*q2*q3+n22*p22*q2*q3+4*g*p21*q2*q3+g*p12*q2*q3+4*g^2*p11*q2*q3-4*n11*n22*p11*q2*q3+4*n11*p11*q2*q3-5*g^2*q2*q3+5*n11*n22*q2*q3-n22*q2*q3-4*n11*q2*q3+2*n11*p22*q1*q3-2*p22*q1*q3-2*g*p21*q1*q3-2*g*p12*q1*q3+2*n22*p11*q1*q3-2*p11*q1*q3-2*n22*q1*q3-2*n11*q1*q3+4*q1*q3+2*g^2*p11*p22*q2^2-2*n11*n22*p11*p22*q2^2-2*g^2*p22*q2^2+2*n11*n22*p22*q2^2-2*g^2*p12*p21*q2^2+2*n11*n22*p12*p21*q2^2-2*g^2*p11*q2^2+2*n11*n22*p11*q2^2+2*g^2*q2^2-2*n11*n22*q2^2+n22*p11*p22*q1*q2+4*n11*p11*p22*q1*q2-n22*p22*q1*q2-4*n11*p22*q1*q2-n22*p12*p21*q1*q2-4*n11*p12*p21*q1*q2-n22*p11*q1*q2-4*n11*p11*q1*q2+n22*q1*q2+4*n11*q1*q2-2*p11*p22*q1^2+2*p22*q1^2+2*p12*p21*q1^2+2*p11*q1^2-2*q1^2",lst(p11,p12,p21,p22,n11,n22,g,q1,q2,q3,q4));
-       ex result = res1.subs(lst(q1==ss1, q2==ss2, q3==ss3, q4==ss4));
+       ex res1 = ex("p11*p22*q1^2*q4^2-p12*p21*q1^2*q4^2-n22*p11*p22*q1*q4^2+2*n11*p11*p22*q1*q4^2-p11*p22*q1*q4^2+n22*p12*p21*q1*q4^2-2*n11*p12*p21*q1*q4^2+p12*p21*q1*q4^2+2*g^2*p11*p22*q4^2-2*n11*n22*p11*p22*q4^2+2*n22*p11*p22*q4^2+2*n11*p11*p22*q4^2-2*p11*p22*q4^2-2*g^2*p12*p21*q4^2+2*n11*n22*p12*p21*q4^2-2*n22*p12*p21*q4^2-2*n11*p12*p21*q4^2+2*p12*p21*q4^2-n11*p22*q1*q2*q3*q4+g*p21*q1*q2*q3*q4+g*p12*q1*q2*q3*q4-n22*p11*q1*q2*q3*q4-g^2*p22*q2*q3*q4+n11*n22*p22*q2*q3*q4-n11*p22*q2*q3*q4-2*g*p21*q2*q3*q4+g*p12*q2*q3*q4+2*g^2*p11*q2*q3*q4-2*n11*n22*p11*q2*q3*q4+2*n22*p11*q2*q3*q4-n11*p22*q1*q3*q4+p22*q1*q3*q4+g*p21*q1*q3*q4-2*g*p12*q1*q3*q4+2*n22*p11*q1*q3*q4-2*p11*q1*q3*q4-g^2*p22*q3*q4+n11*n22*p22*q3*q4-n22*p22*q3*q4-n11*p22*q3*q4+p22*q3*q4-4*g^2*p11*q3*q4+4*n11*n22*p11*q3*q4-4*n22*p11*q3*q4-4*n11*p11*q3*q4+4*p11*q3*q4+n22*p11*p22*q1*q2*q4-2*n11*p11*p22*q1*q2*q4+2*n11*p22*q1*q2*q4-n22*p12*p21*q1*q2*q4+2*n11*p12*p21*q1*q2*q4+g*p21*q1*q2*q4-2*g*p12*q1*q2*q4-n22*p11*q1*q2*q4-4*g^2*p11*p22*q2*q4+4*n11*n22*p11*p22*q2*q4-2*n22*p11*p22*q2*q4-2*n11*p11*p22*q2*q4+2*g^2*p22*q2*q4-2*n11*n22*p22*q2*q4+2*n11*p22*q2*q4+4*g^2*p12*p21*q2*q4-4*n11*n22*p12*p21*q2*q4+2*n22*p12*p21*q2*q4+2*n11*p12*p21*q2*q4-2*g*p21*q2*q4-2*g*p12*q2*q4+2*g^2*p11*q2*q4-2*n11*n22*p11*q2*q4+2*n22*p11*q2*q4-p11*p22*q1^2*q4-p22*q1^2*q4+p12*p21*q1^2*q4+2*p11*q1^2*q4-n22*p11*p22*q1*q4-4*n11*p11*p22*q1*q4+5*p11*p22*q1*q4+n22*p22*q1*q4-p22*q1*q4+n22*p12*p21*q1*q4+4*n11*p12*p21*q1*q4-5*p12*p21*q1*q4+g*p21*q1*q4+4*g*p12*q1*q4+4*n11*p11*q1*q4-4*p11*q1*q4-g^2*q2^2*q3^2+n11*n22*q2^2*q3^2+g^2*q2*q3^2-n11*n22*q2*q3^2-n22*q2*q3^2+2*n11*q2*q3^2+2*g^2*q3^2-2*n11*n22*q3^2+2*n22*q3^2+2*n11*q3^2-2*q3^2+g^2*p22*q2^2*q3-n11*n22*p22*q2^2*q3-2*g^2*p11*q2^2*q3+2*n11*n22*p11*q2^2*q3+g^2*q2^2*q3-n11*n22*q2^2*q3+2*n11*p22*q1*q2*q3-2*g*p21*q1*q2*q3+g*p12*q1*q2*q3-n22*p11*q1*q2*q3+n22*q1*q2*q3-2*n11*q1*q2*q3+g^2*p22*q2*q3-n11*n22*p22*q2*q3+n22*p22*q2*q3+4*g*p21*q2*q3+g*p12*q2*q3+4*g^2*p11*q2*q3-4*n11*n22*p11*q2*q3+4*n11*p11*q2*q3-5*g^2*q2*q3+5*n11*n22*q2*q3-n22*q2*q3-4*n11*q2*q3+2*n11*p22*q1*q3-2*p22*q1*q3-2*g*p21*q1*q3-2*g*p12*q1*q3+2*n22*p11*q1*q3-2*p11*q1*q3-2*n22*q1*q3-2*n11*q1*q3+4*q1*q3+2*g^2*p11*p22*q2^2-2*n11*n22*p11*p22*q2^2-2*g^2*p22*q2^2+2*n11*n22*p22*q2^2-2*g^2*p12*p21*q2^2+2*n11*n22*p12*p21*q2^2-2*g^2*p11*q2^2+2*n11*n22*p11*q2^2+2*g^2*q2^2-2*n11*n22*q2^2+n22*p11*p22*q1*q2+4*n11*p11*p22*q1*q2-n22*p22*q1*q2-4*n11*p22*q1*q2-n22*p12*p21*q1*q2-4*n11*p12*p21*q1*q2-n22*p11*q1*q2-4*n11*p11*q1*q2+n22*q1*q2+4*n11*q1*q2-2*p11*p22*q1^2+2*p22*q1^2+2*p12*p21*q1^2+2*p11*q1^2-2*q1^2",lst{p11,p12,p21,p22,n11,n22,g,q1,q2,q3,q4});
+       ex result = res1.subs(lst{q1==ss1, q2==ss2, q3==ss3, q4==ss4});
        ex normalresult = normal(result);
        if (!normalresult.is_zero()) {
                clog << "Normalization should have returned 0." << endl;
        ex normalresult = normal(result);
        if (!normalresult.is_zero()) {
                clog << "Normalization should have returned 0." << endl;
index 39509f5bd64216f0c489997229e5719eb28fb024..bb8a1c15fc769804771797b3ab1d43298a25c1ed 100644 (file)
@@ -35,16 +35,16 @@ static unsigned toeplitz_det(unsigned size)
 {
        unsigned result = 0;
        const symbol a("a"), b("b");
 {
        unsigned result = 0;
        const symbol a("a"), b("b");
-       ex p[10] = {ex("a",lst(a,b)),
-                  ex("b",lst(a,b)),
-                  ex("a+b",lst(a,b)),
-                  ex("a^2+a*b+b^2",lst(a,b)),
-                  ex("a^3+a^2*b-a*b^2+b^3",lst(a,b)),
-                  ex("a^4+a^3*b+a^2*b^2+a*b^3+b^4",lst(a,b)),
-                  ex("a^5+a^4*b+a^3*b^2-a^2*b^3+a*b^4+b^5",lst(a,b)),
-                  ex("a^6+a^5*b+a^4*b^2+a^3*b^3+a^2*b^4+a*b^5+b^6",lst(a,b)),
-                  ex("a^7+a^6*b+a^5*b^2+a^4*b^3-a^3*b^4+a^2*b^5+a*b^6+b^7",lst(a,b)),
-                  ex("a^8+a^7*b+a^6*b^2+a^5*b^3+a^4*b^4+a^3*b^5+a^2*b^6+a*b^7+b^8",lst(a,b))
+       ex p[10] = {ex("a",lst{a,b}),
+                  ex("b",lst{a,b}),
+                  ex("a+b",lst{a,b}),
+                  ex("a^2+a*b+b^2",lst{a,b}),
+                  ex("a^3+a^2*b-a*b^2+b^3",lst{a,b}),
+                  ex("a^4+a^3*b+a^2*b^2+a*b^3+b^4",lst{a,b}),
+                  ex("a^5+a^4*b+a^3*b^2-a^2*b^3+a*b^4+b^5",lst{a,b}),
+                  ex("a^6+a^5*b+a^4*b^2+a^3*b^3+a^2*b^4+a*b^5+b^6",lst{a,b}),
+                  ex("a^7+a^6*b+a^5*b^2+a^4*b^3-a^3*b^4+a^2*b^5+a*b^6+b^7",lst{a,b}),
+                  ex("a^8+a^7*b+a^6*b^2+a^5*b^3+a^4*b^4+a^3*b^5+a^2*b^6+a*b^7+b^8",lst{a,b})
        };
 
        // construct Toeplitz matrix (diagonal structure: [[x,y,z],[y,x,y],[z,y,x]]):
        };
 
        // construct Toeplitz matrix (diagonal structure: [[x,y,z],[y,x,y],[z,y,x]]):
index fb0813cb6f0f33e4fbecfd88044c5363abecddd6..faff99cc9033b6c4379b1aef178d662fe459f921 100644 (file)
@@ -22,7 +22,7 @@ int main()
        cout << "Enter an expression containing 'x' and/or 'y': ";
        cin >> s;
        // Expression now in expr
        cout << "Enter an expression containing 'x' and/or 'y': ";
        cin >> s;
        // Expression now in expr
-       ex expr(s, lst(x,y));
+       ex expr(s, lst{x,y});
  
        cout << "start integration of " << expr << " ..." << endl;
 
  
        cout << "start integration of " << expr << " ..." << endl;
 
@@ -46,7 +46,7 @@ int main()
 
        // Optionally, compile with custom compiler flags:
        // setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1);
 
        // Optionally, compile with custom compiler flags:
        // setenv("CXXFLAGS", "-O3 -fomit-frame-pointer -ffast-math", 1);
-       compile_ex(lst(expr), lst(x,y), fp);
+       compile_ex(lst{expr}, lst{x,y}, fp);
 
        // Starting VEGAS
        // By invocation of compile() the expression in expr is converted into the
 
        // Starting VEGAS
        // By invocation of compile() the expression in expr is converted into the
index 1b8a1a6a37e925bd7fc9ce9dba0de044b2c9015d..7f6c9535f918704d96f76fee51285d6a9955111c 100644 (file)
@@ -1647,30 +1647,18 @@ packages, but are sometimes used to supply a variable number of arguments of
 the same type to GiNaC methods such as @code{subs()} and some @code{matrix}
 constructors, so you should have a basic understanding of them.
 
 the same type to GiNaC methods such as @code{subs()} and some @code{matrix}
 constructors, so you should have a basic understanding of them.
 
-Lists can be constructed by assigning a comma-separated sequence of
-expressions:
+Lists can be constructed from an initializer list of expressions:
 
 @example
 @{
     symbol x("x"), y("y");
     lst l;
 
 @example
 @{
     symbol x("x"), y("y");
     lst l;
-    l = x, 2, y, x+y;
+    l = @{x, 2, y, x+y@};
     // now, l is a list holding the expressions 'x', '2', 'y', and 'x+y',
     // in that order
     ...
 @end example
 
     // now, l is a list holding the expressions 'x', '2', 'y', and 'x+y',
     // in that order
     ...
 @end example
 
-There are also constructors that allow direct creation of lists of up to
-16 expressions, which is often more convenient but slightly less efficient:
-
-@example
-    ...
-    // This produces the same list 'l' as above:
-    // lst l(x, 2, y, x+y);
-    // lst l = lst(x, 2, y, x+y);
-    ...
-@end example
-
 Use the @code{nops()} method to determine the size (number of expressions) of
 a list and the @code{op()} method or the @code{[]} operator to access
 individual elements:
 Use the @code{nops()} method to determine the size (number of expressions) of
 a list and the @code{op()} method or the @code{[]} operator to access
 individual elements:
@@ -2052,13 +2040,13 @@ Here are a couple of examples for constructing matrices:
     cout << M2 << endl;
      // -> [[a,0],[0,b]]
 
     cout << M2 << endl;
      // -> [[a,0],[0,b]]
 
-    cout << matrix(2, 2, lst(a, 0, 0, b)) << endl;
+    cout << matrix(2, 2, lst@{a, 0, 0, b@}) << endl;
      // -> [[a,0],[0,b]]
 
      // -> [[a,0],[0,b]]
 
-    cout << lst_to_matrix(lst(lst(a, 0), lst(0, b))) << endl;
+    cout << lst_to_matrix(lst@{lst@{a, 0@}, lst@{0, b@}@}) << endl;
      // -> [[a,0],[0,b]]
 
      // -> [[a,0],[0,b]]
 
-    cout << diag_matrix(lst(a, b)) << endl;
+    cout << diag_matrix(lst@{a, b@}) << endl;
      // -> [[a,0],[0,b]]
 
     cout << unit_matrix(3) << endl;
      // -> [[a,0],[0,b]]
 
     cout << unit_matrix(3) << endl;
@@ -3267,7 +3255,7 @@ QED:
            dirac_gamma(mu.toggle_variance()) *
            (dirac_slash(l, D) + m * dirac_ONE());   
     e = dirac_trace(e).simplify_indexed(sp);
            dirac_gamma(mu.toggle_variance()) *
            (dirac_slash(l, D) + m * dirac_ONE());   
     e = dirac_trace(e).simplify_indexed(sp);
-    e = e.collect(lst(l, ldotq, m));
+    e = e.collect(lst@{l, ldotq, m@});
     cout << e << endl;
      // -> (8-4*D)*l^2+(8-4*D)*ldotq+4*D*m^2
 @}
     cout << e << endl;
      // -> (8-4*D)*l^2+(8-4*D)*ldotq+4*D*m^2
 @}
@@ -3359,7 +3347,7 @@ ways. For example
     ... 
     idx i(symbol("i"), 4);
     realsymbol s("s");
     ... 
     idx i(symbol("i"), 4);
     realsymbol s("s");
-    ex M = diag_matrix(lst(1, -1, 0, s));
+    ex M = diag_matrix(lst@{1, -1, 0, s@});
     ex e = clifford_unit(i, M);
     ex e0 = e.subs(i == 0);
     ex e1 = e.subs(i == 1);
     ex e = clifford_unit(i, M);
     ex e0 = e.subs(i == 0);
     ex e1 = e.subs(i == 1);
@@ -3425,11 +3413,11 @@ The previous code may be rewritten with the help of @code{lst_to_clifford()} as
     ...
     idx i(symbol("i"), 4);
     realsymbol s("s");
     ...
     idx i(symbol("i"), 4);
     realsymbol s("s");
-    ex M = diag_matrix(lst(1, -1, 0, s));
-    ex e0 = lst_to_clifford(lst(1, 0, 0, 0), i, M);
-    ex e1 = lst_to_clifford(lst(0, 1, 0, 0), i, M);
-    ex e2 = lst_to_clifford(lst(0, 0, 1, 0), i, M);
-    ex e3 = lst_to_clifford(lst(0, 0, 0, 1), i, M);
+    ex M = diag_matrix(lst@{1, -1, 0, s@});
+    ex e0 = lst_to_clifford(lst@{1, 0, 0, 0@}, i, M);
+    ex e1 = lst_to_clifford(lst@{0, 1, 0, 0@}, i, M);
+    ex e2 = lst_to_clifford(lst@{0, 0, 1, 0@}, i, M);
+    ex e3 = lst_to_clifford(lst@{0, 0, 0, 1@}, i, M);
   ...
 @}
 @end example
   ...
 @}
 @end example
@@ -4070,7 +4058,7 @@ The following example illustrates the differences between
 @example
 @{
     symbol A("A"), B("B"), C("C");
 @example
 @{
     symbol A("A"), B("B"), C("C");
-    ex e = lst(lst(A, B), C);
+    ex e = lst@{lst@{A, B@}, C@};
 
     std::copy(e.begin(), e.end(),
               std::ostream_iterator<ex>(cout, "\n"));
 
     std::copy(e.begin(), e.end(),
               std::ostream_iterator<ex>(cout, "\n"));
@@ -4270,13 +4258,13 @@ In the first form, @code{subs()} accepts a relational of the form
      // -> 73
 
     ex e2 = x*y + x;
      // -> 73
 
     ex e2 = x*y + x;
-    cout << "e2(-2, 4) = " << e2.subs(lst(x == -2, y == 4)) << endl;
+    cout << "e2(-2, 4) = " << e2.subs(lst@{x == -2, y == 4@}) << endl;
      // -> -10
 @}
 @end example
 
 If you specify multiple substitutions, they are performed in parallel, so e.g.
      // -> -10
 @}
 @end example
 
 If you specify multiple substitutions, they are performed in parallel, so e.g.
-@code{subs(lst(x == y, y == x))} exchanges @samp{x} and @samp{y}.
+@code{subs(lst@{x == y, y == x@})} exchanges @samp{x} and @samp{y}.
 
 The second form of @code{subs()} takes an @code{exmap} object which is a
 pair associative container that maps expressions to expressions (currently
 
 The second form of @code{subs()} takes an @code{exmap} object which is a
 pair associative container that maps expressions to expressions (currently
@@ -4307,7 +4295,7 @@ contain the same number of elements). Using this form, you would write
     symbol x("x"), y("y");
     ex e2 = x*y + x;
 
     symbol x("x"), y("y");
     ex e2 = x*y + x;
 
-    cout << "e2(-2, 4) = " << e2.subs(lst(x, y), lst(-2, 4)) << endl;
+    cout << "e2(-2, 4) = " << e2.subs(lst@{x, y@}, lst@{-2, 4@}) << endl;
 @}
 @end example
 
 @}
 @end example
 
@@ -5027,7 +5015,7 @@ one variable, the variables are given as a list.
 
 @example
 (x*y*sin(y)).is_polynomial(x)         // Returns true.
 
 @example
 (x*y*sin(y)).is_polynomial(x)         // Returns true.
-(x*y*sin(y)).is_polynomial(lst(x,y))  // Returns false.
+(x*y*sin(y)).is_polynomial(lst@{x,y@})  // Returns false.
 @end example
 
 @subsection Expanding and collecting
 @end example
 
 @subsection Expanding and collecting
@@ -5354,7 +5342,7 @@ int main()
 
 Square-free decomposition is available in GiNaC:
 @example
 
 Square-free decomposition is available in GiNaC:
 @example
-ex sqrfree(const ex & a, const lst & l = lst());
+ex sqrfree(const ex & a, const lst & l = lst@{@});
 @end example
 Here is an example that by the way illustrates how the exact form of the
 result may slightly depend on the order of differentiation, calling for
 @end example
 Here is an example that by the way illustrates how the exact form of the
 result may slightly depend on the order of differentiation, calling for
@@ -5364,10 +5352,10 @@ some care with subsequent processing of the result:
     symbol x("x"), y("y");
     ex BiVarPol = expand(pow(2-2*y,3) * pow(1+x*y,2) * pow(x-2*y,2) * (x+y));
 
     symbol x("x"), y("y");
     ex BiVarPol = expand(pow(2-2*y,3) * pow(1+x*y,2) * pow(x-2*y,2) * (x+y));
 
-    cout << sqrfree(BiVarPol, lst(x,y)) << endl;
+    cout << sqrfree(BiVarPol, lst@{x,y@}) << endl;
      // -> 8*(1-y)^3*(y*x^2-2*y+x*(1-2*y^2))^2*(y+x)
 
      // -> 8*(1-y)^3*(y*x^2-2*y+x*(1-2*y^2))^2*(y+x)
 
-    cout << sqrfree(BiVarPol, lst(y,x)) << endl;
+    cout << sqrfree(BiVarPol, lst@{y,x@}) << endl;
      // -> 8*(1-y)^3*(-y*x^2+2*y+x*(-1+2*y^2))^2*(y+x)
 
     cout << sqrfree(BiVarPol) << endl;
      // -> 8*(1-y)^3*(-y*x^2+2*y+x*(-1+2*y^2))^2*(y+x)
 
     cout << sqrfree(BiVarPol) << endl;
@@ -5776,9 +5764,9 @@ almost any kind of object (anything that is @code{subs()}able):
                                            
     cout << ex(indexed(A, i, j)).symmetrize() << endl;
      // -> 1/2*A.j.i+1/2*A.i.j
                                            
     cout << ex(indexed(A, i, j)).symmetrize() << endl;
      // -> 1/2*A.j.i+1/2*A.i.j
-    cout << ex(indexed(A, i, j, k)).antisymmetrize(lst(i, j)) << endl;
+    cout << ex(indexed(A, i, j, k)).antisymmetrize(lst@{i, j@}) << endl;
      // -> -1/2*A.j.i.k+1/2*A.i.j.k
      // -> -1/2*A.j.i.k+1/2*A.i.j.k
-    cout << ex(lst(a, b, c)).symmetrize_cyclic(lst(a, b, c)) << endl;
+    cout << ex(lst@{a, b, c@}).symmetrize_cyclic(lst@{a, b, c@}) << endl;
      // -> 1/3*@{a,b,c@}+1/3*@{b,c,a@}+1/3*@{c,a,b@}
 @}
 @end example
      // -> 1/3*@{a,b,c@}+1/3*@{b,c,a@}+1/3*@{c,a,b@}
 @}
 @end example
@@ -6081,7 +6069,7 @@ The functions only evaluate if the indices are integers greater than zero, excep
 will be interpreted as the sequence of signs for the corresponding indices
 @code{m} or the sign of the imaginary part for the
 corresponding arguments @code{a}, it must contain 1 or -1, e.g.
 will be interpreted as the sequence of signs for the corresponding indices
 @code{m} or the sign of the imaginary part for the
 corresponding arguments @code{a}, it must contain 1 or -1, e.g.
-@code{zeta(lst(3,4), lst(-1,1))} means
+@code{zeta(lst@{3,4@}, lst@{-1,1@})} means
 @tex
 $\zeta(\overline{3},4)$
 @end tex
 @tex
 $\zeta(\overline{3},4)$
 @end tex
@@ -6089,7 +6077,7 @@ $\zeta(\overline{3},4)$
 @command{zeta(\overline@{3@},4)}
 @end ifnottex
 and
 @command{zeta(\overline@{3@},4)}
 @end ifnottex
 and
-@code{G(lst(a,b), lst(-1,1), c)} means
+@code{G(lst@{a,b@}, lst@{-1,1@}, c)} means
 @tex
 $G(a-0\epsilon,b+0\epsilon;c)$.
 @end tex
 @tex
 $G(a-0\epsilon,b+0\epsilon;c)$.
 @end tex
@@ -6098,7 +6086,7 @@ $G(a-0\epsilon,b+0\epsilon;c)$.
 @end ifnottex
 The definition of @code{H} allows indices to be 0, 1 or -1 (in expanded notation) or equally to
 be any integer (in compact notation). With GiNaC expanded and compact notation can be mixed,
 @end ifnottex
 The definition of @code{H} allows indices to be 0, 1 or -1 (in expanded notation) or equally to
 be any integer (in compact notation). With GiNaC expanded and compact notation can be mixed,
-e.g. @code{lst(0,0,-1,0,1,0,0)}, @code{lst(0,0,-1,2,0,0)} and @code{lst(-3,2,0,0)} are equivalent as
+e.g. @code{lst@{0,0,-1,0,1,0,0@}}, @code{lst@{0,0,-1,2,0,0@}} and @code{lst@{-3,2,0,0@}} are equivalent as
 indices. The anonymous evaluator @code{eval()} tries to reduce the functions, if possible, to
 the least-generic multiple polylogarithm. If all arguments are unit, it returns @code{zeta}.
 Arguments equal to zero get considered, too. Riemann's zeta function @code{zeta} (with depth one)
 indices. The anonymous evaluator @code{eval()} tries to reduce the functions, if possible, to
 the least-generic multiple polylogarithm. If all arguments are unit, it returns @code{zeta}.
 Arguments equal to zero get considered, too. Riemann's zeta function @code{zeta} (with depth one)
index 56e43bd8e11ccad790003ee5a719fc074fcd5a66..4b3c07948daf1d7566913a4b2223b5237a2dff37 100644 (file)
@@ -161,15 +161,15 @@ ex clifford::get_metric(const ex & i, const ex & j, bool symmetrised) const
                                return simplify_indexed(indexed(metric.op(0)*_ex1_2, i, j) + indexed(metric.op(0)*_ex1_2, j, i));
                        }
                } else {
                                return simplify_indexed(indexed(metric.op(0)*_ex1_2, i, j) + indexed(metric.op(0)*_ex1_2, j, i));
                        }
                } else {
-                       return metric.subs(lst(metric.op(1) == i, metric.op(2) == j), subs_options::no_pattern);
+                       return metric.subs(lst{metric.op(1) == i, metric.op(2) == j}, subs_options::no_pattern);
                }
        } else {
                exvector indices = metric.get_free_indices();
                if (symmetrised)
                }
        } else {
                exvector indices = metric.get_free_indices();
                if (symmetrised)
-                       return _ex1_2*simplify_indexed(metric.subs(lst(indices[0] == i, indices[1] == j), subs_options::no_pattern)
-                                                                       + metric.subs(lst(indices[0] == j, indices[1] == i), subs_options::no_pattern));
+                       return _ex1_2*simplify_indexed(metric.subs(lst{indices[0] == i, indices[1] == j}, subs_options::no_pattern)
+                                                    + metric.subs(lst{indices[0] == j, indices[1] == i}, subs_options::no_pattern));
                else
                else
-                       return metric.subs(lst(indices[0] == i, indices[1] == j), subs_options::no_pattern);
+                       return metric.subs(lst{indices[0] == i, indices[1] == j}, subs_options::no_pattern);
        }
 }
 
        }
 }
 
@@ -892,10 +892,10 @@ ex dirac_trace(const ex & e, const std::set<unsigned char> & rls, const ex & trO
                        return e;
 
                // Substitute gammaL/R and expand product, if necessary
                        return e;
 
                // Substitute gammaL/R and expand product, if necessary
-               ex e_expanded = e.subs(lst(
+               ex e_expanded = e.subs(lst{
                        dirac_gammaL(rl) == (dirac_ONE(rl)-dirac_gamma5(rl))/2,
                        dirac_gammaR(rl) == (dirac_ONE(rl)+dirac_gamma5(rl))/2
                        dirac_gammaL(rl) == (dirac_ONE(rl)-dirac_gamma5(rl))/2,
                        dirac_gammaR(rl) == (dirac_ONE(rl)+dirac_gamma5(rl))/2
-               ), subs_options::no_pattern).expand();
+               }, subs_options::no_pattern).expand();
                if (!is_a<ncmul>(e_expanded))
                        return dirac_trace(e_expanded, rls, trONE);
 
                if (!is_a<ncmul>(e_expanded))
                        return dirac_trace(e_expanded, rls, trONE);
 
@@ -1255,8 +1255,8 @@ static ex get_clifford_comp(const ex & e, const ex & c)
                                                                ex curridx_toggle = is_a<varidx>(curridx)
                                                                        ? ex_to<varidx>(curridx).toggle_variance()
                                                                        : curridx;
                                                                ex curridx_toggle = is_a<varidx>(curridx)
                                                                        ? ex_to<varidx>(curridx).toggle_variance()
                                                                        : curridx;
-                                                               S = S * e.op(j).subs(lst(curridx == ival,
-                                                                       curridx_toggle == ival), subs_options::no_pattern);
+                                                               S = S * e.op(j).subs(lst{curridx == ival, curridx_toggle == ival},
+                                                                                    subs_options::no_pattern);
                                                        }
                                                } else
                                                        S = S * e.op(j);
                                                        }
                                                } else
                                                        S = S * e.op(j);
index e7a70f17f5b83a4a8ad9b4956819a124d5f60c14..8c31ed1315ca446943e672cbcf80feeecf7538d3 100644 (file)
 #ifdef __GNUC__
 #define unlikely(cond) __builtin_expect((cond), 0)
 #define likely(cond) __builtin_expect((cond), 1)
 #ifdef __GNUC__
 #define unlikely(cond) __builtin_expect((cond), 0)
 #define likely(cond) __builtin_expect((cond), 1)
+#define deprecated __attribute__ ((deprecated));
 #else
 #define unlikely(cond) (cond)
 #define likely(cond) (cond)
 #else
 #define unlikely(cond) (cond)
 #define likely(cond) (cond)
+#define deprecated
 #endif
 
 #ifdef _MSC_VER
 #endif
 
 #ifdef _MSC_VER
index dd8be1312a92621f4f2f03747539d920b41e3e21..04ab31d1110ce64f1af2946c4e7ac4dc51215dce 100644 (file)
@@ -27,6 +27,7 @@
 #include "print.h"
 #include "archive.h"
 #include "assertion.h"
 #include "print.h"
 #include "archive.h"
 #include "assertion.h"
+#include "compiler.h"
 
 #include <algorithm>
 #include <iterator>
 
 #include <algorithm>
 #include <iterator>
@@ -45,6 +46,7 @@ protected:
 
        container_storage() {}
        container_storage(size_t n, const ex & e) : seq(n, e) {}
 
        container_storage() {}
        container_storage(size_t n, const ex & e) : seq(n, e) {}
+       container_storage(std::initializer_list<ex> il) : seq(il) {}
 
        template <class In>
        container_storage(In b, In e) : seq(b, e) {}
 
        template <class In>
        container_storage(In b, In e) : seq(b, e) {}
@@ -160,195 +162,41 @@ public:
                setflag(get_default_flags());
        }
 
                setflag(get_default_flags());
        }
 
-       explicit container(const ex & p1)
-        : container_storage<C>(1, p1)
+       container(std::initializer_list<ex> il)
+        : container_storage<C>(il)
        {
                setflag(get_default_flags());
        }
 
        {
                setflag(get_default_flags());
        }
 
-       container(const ex & p1, const ex & p2)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 2);
-               this->seq.push_back(p1); this->seq.push_back(p2);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 3);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 4);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 5);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 6);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 7);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 8);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 9);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 10);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10, const ex & p11)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 11);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10); this->seq.push_back(p11);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10, const ex & p11, const ex & p12)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 12);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10); this->seq.push_back(p11); this->seq.push_back(p12);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10, const ex & p11, const ex & p12,
-                 const ex & p13)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 13);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10); this->seq.push_back(p11); this->seq.push_back(p12);
-               this->seq.push_back(p13);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10, const ex & p11, const ex & p12,
-                 const ex & p13, const ex & p14)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 14);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10); this->seq.push_back(p11); this->seq.push_back(p12);
-               this->seq.push_back(p13); this->seq.push_back(p14);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10, const ex & p11, const ex & p12,
-                 const ex & p13, const ex & p14, const ex & p15)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 15);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10); this->seq.push_back(p11); this->seq.push_back(p12);
-               this->seq.push_back(p13); this->seq.push_back(p14); this->seq.push_back(p15);
-       }
-
-       container(const ex & p1, const ex & p2, const ex & p3,
-                 const ex & p4, const ex & p5, const ex & p6,
-                 const ex & p7, const ex & p8, const ex & p9,
-                 const ex & p10, const ex & p11, const ex & p12,
-                 const ex & p13, const ex & p14, const ex & p15,
-                 const ex & p16)
-       {
-               setflag(get_default_flags());
-               this->reserve(this->seq, 16);
-               this->seq.push_back(p1); this->seq.push_back(p2); this->seq.push_back(p3);
-               this->seq.push_back(p4); this->seq.push_back(p5); this->seq.push_back(p6);
-               this->seq.push_back(p7); this->seq.push_back(p8); this->seq.push_back(p9);
-               this->seq.push_back(p10); this->seq.push_back(p11); this->seq.push_back(p12);
-               this->seq.push_back(p13); this->seq.push_back(p14); this->seq.push_back(p15);
-               this->seq.push_back(p16);
-       }
+       explicit container(const ex & p1) deprecated;
+       container(const ex & p1, const ex & p2) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10, const ex & p11) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10, const ex & p11, const ex & p12) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13, const ex & p14) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13, const ex & p14, const ex & p15) deprecated;
+       container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                 const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13, const ex & p14, const ex & p15, const ex & p16) deprecated;
 
        // First step of initialization of container with a comma-separated
        // sequence of expressions. Subsequent steps are handled by
        // container_init<>::operator,().
 
        // First step of initialization of container with a comma-separated
        // sequence of expressions. Subsequent steps are handled by
        // container_init<>::operator,().
-       container_init<ex, STLT> operator=(const ex & x)
-       {
-               this->seq.push_back(x);
-               return container_init<ex, STLT>(this->seq);
-       }
+       container_init<ex, STLT> operator=(const ex & x) deprecated;
 
        // functions overriding virtual functions from base classes
 public:
 
        // functions overriding virtual functions from base classes
 public:
@@ -499,6 +347,84 @@ container<C>::container()
        setflag(get_default_flags());
 }
 
        setflag(get_default_flags());
 }
 
+/** Deprecatd constructors (prefer initializer list) */
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1)
+  : container_storage<C>(1, p1) { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2)
+  : container_storage<C>{p1, p2} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3)
+  : container_storage<C>{p1, p2, p3} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4)
+  : container_storage<C>{p1, p2, p3, p4} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5)
+  : container_storage<C>{p1, p2, p3, p4, p5} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10, const ex & p11)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10, const ex & p11, const ex & p12)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13, const ex & p14)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13, const ex & p14, const ex & p15)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15} { setflag(get_default_flags()); }
+template <template <class T, class = std::allocator<T>> class C>
+container<C>::container(const ex & p1, const ex & p2, const ex & p3, const ex & p4, const ex & p5, const ex & p6, const ex & p7, const ex & p8,
+                        const ex & p9, const ex & p10, const ex & p11, const ex & p12, const ex & p13, const ex & p14, const ex & p15, const ex & p16)
+  : container_storage<C>{p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16} { setflag(get_default_flags()); }
+
+template <template <class T, class = std::allocator<T>> class C>
+container_init<ex, typename container_storage<C>::STLT> container<C>::operator=(const ex & x)
+{
+       this->seq.push_back(x);
+       return container_init<ex, typename container_storage<C>::STLT>(this->seq);
+}
 
 template <template <class T, class = std::allocator<T>> class C>
 void container<C>::do_print(const print_context & c, unsigned level) const
 
 template <template <class T, class = std::allocator<T>> class C>
 void container<C>::do_print(const print_context & c, unsigned level) const
index 290154b4838e863859db143e181ea337e8ef9e75..648283001d861b2547bd5b0a8a585f6102e263f4 100644 (file)
@@ -140,7 +140,7 @@ ex ex::subs(const lst & ls, const lst & lr, unsigned options) const
 /** Substitute objects in an expression (syntactic substitution) and return
  *  the result as a new expression.  There are two valid types of
  *  replacement arguments: 1) a relational like object==ex and 2) a list of
 /** Substitute objects in an expression (syntactic substitution) and return
  *  the result as a new expression.  There are two valid types of
  *  replacement arguments: 1) a relational like object==ex and 2) a list of
- *  relationals lst(object1==ex1,object2==ex2,...). */
+ *  relationals lst{object1==ex1,object2==ex2,...}. */
 ex ex::subs(const ex & e, unsigned options) const
 {
        if (e.info(info_flags::relation_equal)) {
 ex ex::subs(const ex & e, unsigned options) const
 {
        if (e.info(info_flags::relation_equal)) {
index 28c24a4ac9a6986631224508706f3d02a10e682f..595fd7b80f94053e2c887111a13fddfffa1b4459 100644 (file)
@@ -195,7 +195,7 @@ static excompiler global_excompiler;
 void compile_ex(const ex& expr, const symbol& sym, FUNCP_1P& fp, const std::string filename)
 {
        symbol x("x");
 void compile_ex(const ex& expr, const symbol& sym, FUNCP_1P& fp, const std::string filename)
 {
        symbol x("x");
-       ex expr_with_x = expr.subs(lst(sym==x));
+       ex expr_with_x = expr.subs(lst{sym==x});
 
        std::ofstream ofs;
        std::string unique_filename = filename;
 
        std::ofstream ofs;
        std::string unique_filename = filename;
@@ -220,7 +220,7 @@ void compile_ex(const ex& expr, const symbol& sym, FUNCP_1P& fp, const std::stri
 void compile_ex(const ex& expr, const symbol& sym1, const symbol& sym2, FUNCP_2P& fp, const std::string filename)
 {
        symbol x("x"), y("y");
 void compile_ex(const ex& expr, const symbol& sym1, const symbol& sym2, FUNCP_2P& fp, const std::string filename)
 {
        symbol x("x"), y("y");
-       ex expr_with_xy = expr.subs(lst(sym1==x, sym2==y));
+       ex expr_with_xy = expr.subs(lst{sym1==x, sym2==y});
 
        std::ofstream ofs;
        std::string unique_filename = filename;
 
        std::ofstream ofs;
        std::string unique_filename = filename;
index 7168d279dfe1dfbc661cdf7aa618afc4007e5a86..44031d4575dd4ed890a65d91abbc5a3069a572c7 100644 (file)
@@ -560,7 +560,7 @@ expair expairseq::combine_pair_with_coeff_to_pair(const expair &p,
  *  @see expairseq::split_ex_to_pair() */
 ex expairseq::recombine_pair_to_ex(const expair &p) const
 {
  *  @see expairseq::split_ex_to_pair() */
 ex expairseq::recombine_pair_to_ex(const expair &p) const
 {
-       return lst(p.rest,p.coeff);
+       return lst{p.rest, p.coeff};
 }
 
 bool expairseq::expair_needs_further_processing(epp it)
 }
 
 bool expairseq::expair_needs_further_processing(epp it)
index 34095e319ac474e354a740e47b62e011fc37d521..e96dccfa81eded8468a390f455d0b2f9f54462da 100644 (file)
@@ -2093,7 +2093,7 @@ static ex hensel_multivar(const ex& a, const ex& x, const vector<EvalPoint>& I,
        }
        else {
                lst res;
        }
        else {
                lst res;
-               return lst();
+               return lst{};
        }
 }
 
        }
 }
 
@@ -2267,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) ) {
        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);
        }
        else {
                ex vnfactors = factor(vn);
@@ -2441,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);
 
                // 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);
                        ex result = cont * unit;
                        for ( size_t i=0; i<res.nops(); ++i ) {
                                result *= res.op(i).content(x) * res.op(i).unit(x);
index 0876f9cf955bfabe56154554c96eaef0b6e31f12..7030bca66afc6759a1264b244142132e692ec317 100644 (file)
@@ -228,7 +228,7 @@ function::function(unsigned ser) : serial(ser)
 // the following lines have been generated for max. @maxargs@ parameters
 +++ for N in range(1, maxargs + 1):
 function::function(unsigned ser, @seq('const ex & param%(n)d', N)@)
 // the following lines have been generated for max. @maxargs@ parameters
 +++ for N in range(1, maxargs + 1):
 function::function(unsigned ser, @seq('const ex & param%(n)d', N)@)
-       : exprseq(@seq('param%(n)d', N)@), serial(ser)
+       : exprseq{@seq('param%(n)d', N)@}, serial(ser)
 {
 }
 ---
 {
 }
 ---
index d5f7bf85eccaeaa6fc92736a3530afc4939dfe46..675dd7c60453185e5d72107bfbc828f04e64a841 100644 (file)
@@ -61,53 +61,53 @@ indexed::indexed() : symtree(not_symmetric())
 // other constructors
 //////////
 
 // other constructors
 //////////
 
-indexed::indexed(const ex & b) : inherited(b), symtree(not_symmetric())
+indexed::indexed(const ex & b) : inherited{b}, symtree(not_symmetric())
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const ex & i1) : inherited(b, i1), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1) : inherited{b, i1}, symtree(not_symmetric())
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const ex & i1, const ex & i2) : inherited(b, i1, i2), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1, const ex & i2) : inherited{b, i1, i2}, symtree(not_symmetric())
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3) : inherited(b, i1, i2, i3), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3) : inherited{b, i1, i2, i3}, symtree(not_symmetric())
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited(b, i1, i2, i3, i4), symtree(not_symmetric())
+indexed::indexed(const ex & b, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited{b, i1, i2, i3, i4}, symtree(not_symmetric())
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2) : inherited(b, i1, i2), symtree(symm)
+indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2) : inherited{b, i1, i2}, symtree(symm)
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3) : inherited(b, i1, i2, i3), symtree(symm)
+indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3) : inherited{b, i1, i2, i3}, symtree(symm)
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited(b, i1, i2, i3, i4), symtree(symm)
+indexed::indexed(const ex & b, const symmetry & symm, const ex & i1, const ex & i2, const ex & i3, const ex & i4) : inherited{b, i1, i2, i3, i4}, symtree(symm)
 {
        validate();
 }
 
 {
        validate();
 }
 
-indexed::indexed(const ex & b, const exvector & v) : inherited(b), symtree(not_symmetric())
+indexed::indexed(const ex & b, const exvector & v) : inherited{b}, symtree(not_symmetric())
 {
        seq.insert(seq.end(), v.begin(), v.end());
        validate();
 }
 
 {
        seq.insert(seq.end(), v.begin(), v.end());
        validate();
 }
 
-indexed::indexed(const ex & b, const symmetry & symm, const exvector & v) : inherited(b), symtree(symm)
+indexed::indexed(const ex & b, const symmetry & symm, const exvector & v) : inherited{b}, symtree(symm)
 {
        seq.insert(seq.end(), v.begin(), v.end());
        validate();
 {
        seq.insert(seq.end(), v.begin(), v.end());
        validate();
@@ -683,10 +683,10 @@ bool reposition_dummy_indices(ex & e, exvector & variant_dummy_indices, exvector
                                        /*
                                         * N.B. we don't want to use
                                         *
                                        /*
                                         * N.B. we don't want to use
                                         *
-                                        *  e = e.subs(lst(
+                                        *  e = e.subs(lst{
                                         *  *it2 == ex_to<varidx>(*it2).toggle_variance(),
                                         *  ex_to<varidx>(*it2).toggle_variance() == *it2
                                         *  *it2 == ex_to<varidx>(*it2).toggle_variance(),
                                         *  ex_to<varidx>(*it2).toggle_variance() == *it2
-                                        *  ), subs_options::no_pattern);
+                                        *  }, subs_options::no_pattern);
                                         *
                                         * since this can trigger non-trivial repositioning of indices,
                                         * e.g. due to non-trivial symmetry properties of e, thus
                                         *
                                         * since this can trigger non-trivial repositioning of indices,
                                         * e.g. due to non-trivial symmetry properties of e, thus
@@ -1464,7 +1464,7 @@ lst rename_dummy_indices_uniquely(const exvector & va, const exvector & vb)
        exvector common_indices;
        set_intersection(va.begin(), va.end(), vb.begin(), vb.end(), std::back_insert_iterator<exvector>(common_indices), ex_is_less());
        if (common_indices.empty()) {
        exvector common_indices;
        set_intersection(va.begin(), va.end(), vb.begin(), vb.end(), std::back_insert_iterator<exvector>(common_indices), ex_is_less());
        if (common_indices.empty()) {
-               return lst(lst(), lst());
+               return lst{lst{}, lst{}};
        } else {
                exvector new_indices, old_indices;
                old_indices.reserve(2*common_indices.size());
        } else {
                exvector new_indices, old_indices;
                old_indices.reserve(2*common_indices.size());
@@ -1493,7 +1493,7 @@ lst rename_dummy_indices_uniquely(const exvector & va, const exvector & vb)
                        }
                        ++ip;
                }
                        }
                        ++ip;
                }
-               return lst(lst(old_indices.begin(), old_indices.end()), lst(new_indices.begin(), new_indices.end()));
+               return lst{lst(old_indices.begin(), old_indices.end()), lst(new_indices.begin(), new_indices.end())};
        }
 }
 
        }
 }
 
@@ -1563,10 +1563,10 @@ ex expand_dummy_sum(const ex & e, bool subs_idx)
                                for (int i=0; i < idim; i++) {
                                        if (subs_idx && is_a<varidx>(nu)) {
                                                ex other = ex_to<varidx>(nu).toggle_variance();
                                for (int i=0; i < idim; i++) {
                                        if (subs_idx && is_a<varidx>(nu)) {
                                                ex other = ex_to<varidx>(nu).toggle_variance();
-                                               en += result.subs(lst(
+                                               en += result.subs(lst{
                                                        nu == idx(i, idim),
                                                        other == idx(i, idim)
                                                        nu == idx(i, idim),
                                                        other == idx(i, idim)
-                                               ));
+                                               });
                                        } else {
                                                en += result.subs( nu.op(0) == i );
                                        }
                                        } else {
                                                en += result.subs( nu.op(0) == i );
                                        }
index 9cb5f676118058067112a5fd18d06d9a060d01f5..cff14f4388f9c71cfa59608041939e358a6c02ae 100644 (file)
@@ -1045,7 +1045,7 @@ ex lsolve(const ex &eqns, const ex &symbols, unsigned options)
        if (eqns.info(info_flags::relation_equal)) {
                if (!symbols.info(info_flags::symbol))
                        throw(std::invalid_argument("lsolve(): 2nd argument must be a symbol"));
        if (eqns.info(info_flags::relation_equal)) {
                if (!symbols.info(info_flags::symbol))
                        throw(std::invalid_argument("lsolve(): 2nd argument must be a symbol"));
-               const ex sol = lsolve(lst(eqns),lst(symbols));
+               const ex sol = lsolve(lst{eqns}, lst{symbols});
                
                GINAC_ASSERT(sol.nops()==1);
                GINAC_ASSERT(is_exactly_a<relational>(sol.op(0)));
                
                GINAC_ASSERT(sol.nops()==1);
                GINAC_ASSERT(is_exactly_a<relational>(sol.op(0)));
@@ -1103,12 +1103,12 @@ ex lsolve(const ex &eqns, const ex &symbols, unsigned options)
        } catch (const std::runtime_error & e) {
                // Probably singular matrix or otherwise overdetermined system:
                // It is consistent to return an empty list
        } catch (const std::runtime_error & e) {
                // Probably singular matrix or otherwise overdetermined system:
                // It is consistent to return an empty list
-               return lst();
+               return lst{};
        }
        GINAC_ASSERT(solution.cols()==1);
        GINAC_ASSERT(solution.rows()==symbols.nops());
        
        }
        GINAC_ASSERT(solution.cols()==1);
        GINAC_ASSERT(solution.rows()==symbols.nops());
        
-       // return list of equations of the form lst(var1==sol1,var2==sol2,...)
+       // return list of equations of the form lst{var1==sol1,var2==sol2,...}
        lst sollist;
        for (size_t i=0; i<symbols.nops(); i++)
                sollist.append(symbols.op(i)==solution(i,0));
        lst sollist;
        for (size_t i=0; i<symbols.nops(); i++)
                sollist.append(symbols.op(i)==solution(i,0));
index 7fbc774a5ef903fb4c79bc51e1336a8995d13ee5..2a20792475724a9035d1036d7b2b8769090ae4db 100644 (file)
@@ -4,12 +4,12 @@
  *
  *  The functions are:
  *    classical polylogarithm              Li(n,x)
  *
  *  The functions are:
  *    classical polylogarithm              Li(n,x)
- *    multiple polylogarithm               Li(lst(m_1,...,m_k),lst(x_1,...,x_k))
- *                                         G(lst(a_1,...,a_k),y) or G(lst(a_1,...,a_k),lst(s_1,...,s_k),y)
+ *    multiple polylogarithm               Li(lst{m_1,...,m_k},lst{x_1,...,x_k})
+ *                                         G(lst{a_1,...,a_k},y) or G(lst{a_1,...,a_k},lst{s_1,...,s_k},y)
  *    Nielsen's generalized polylogarithm  S(n,p,x)
  *    Nielsen's generalized polylogarithm  S(n,p,x)
- *    harmonic polylogarithm               H(m,x) or H(lst(m_1,...,m_k),x)
- *    multiple zeta value                  zeta(m) or zeta(lst(m_1,...,m_k))
- *    alternating Euler sum                zeta(m,s) or zeta(lst(m_1,...,m_k),lst(s_1,...,s_k))
+ *    harmonic polylogarithm               H(m,x) or H(lst{m_1,...,m_k},x)
+ *    multiple zeta value                  zeta(m) or zeta(lst{m_1,...,m_k})
+ *    alternating Euler sum                zeta(m,s) or zeta(lst{m_1,...,m_k},lst{s_1,...,s_k})
  *
  *  Some remarks:
  *
  *
  *  Some remarks:
  *
@@ -1252,7 +1252,7 @@ static ex G2_evalf(const ex& x_, const ex& y)
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, y).hold();
        }
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, y).hold();
        }
-       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst(x_);
+       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst{x_};
        if (x.nops() == 0) {
                return _ex1;
        }
        if (x.nops() == 0) {
                return _ex1;
        }
@@ -1295,7 +1295,7 @@ static ex G2_eval(const ex& x_, const ex& y)
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, y).hold();
        }
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, y).hold();
        }
-       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst(x_);
+       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst{x_};
        if (x.nops() == 0) {
                return _ex1;
        }
        if (x.nops() == 0) {
                return _ex1;
        }
@@ -1356,8 +1356,8 @@ static ex G3_evalf(const ex& x_, const ex& s_, const ex& y)
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, s_, y).hold();
        }
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, s_, y).hold();
        }
-       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst(x_);
-       lst s = is_a<lst>(s_) ? ex_to<lst>(s_) : lst(s_);
+       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst{x_};
+       lst s = is_a<lst>(s_) ? ex_to<lst>(s_) : lst{s_};
        if (x.nops() != s.nops()) {
                return G(x_, s_, y).hold();
        }
        if (x.nops() != s.nops()) {
                return G(x_, s_, y).hold();
        }
@@ -1420,8 +1420,8 @@ static ex G3_eval(const ex& x_, const ex& s_, const ex& y)
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, s_, y).hold();
        }
        if ((!y.info(info_flags::numeric)) || (!y.info(info_flags::positive))) {
                return G(x_, s_, y).hold();
        }
-       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst(x_);
-       lst s = is_a<lst>(s_) ? ex_to<lst>(s_) : lst(s_);
+       lst x = is_a<lst>(x_) ? ex_to<lst>(x_) : lst{x_};
+       lst s = is_a<lst>(s_) ? ex_to<lst>(s_) : lst{s_};
        if (x.nops() != s.nops()) {
                return G(x_, s_, y).hold();
        }
        if (x.nops() != s.nops()) {
                return G(x_, s_, y).hold();
        }
@@ -1727,13 +1727,13 @@ static void Li_print_latex(const ex& m_, const ex& x_, const print_context& c)
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
-               m = lst(m_);
+               m = lst{m_};
        }
        lst x;
        if (is_a<lst>(x_)) {
                x = ex_to<lst>(x_);
        } else {
        }
        lst x;
        if (is_a<lst>(x_)) {
                x = ex_to<lst>(x_);
        } else {
-               x = lst(x_);
+               x = lst{x_};
        }
        c.s << "\\mathrm{Li}_{";
        lst::const_iterator itm = m.begin();
        }
        c.s << "\\mathrm{Li}_{";
        lst::const_iterator itm = m.begin();
@@ -2175,7 +2175,7 @@ static ex S_eval(const ex& n, const ex& p, const ex& x)
                        return _ex0;
                }
                if (x == 1) {
                        return _ex0;
                }
                if (x == 1) {
-                       lst m(n+1);
+                       lst m{n+1};
                        for (int i=ex_to<numeric>(p).to_int()-1; i>0; i--) {
                                m.append(1);
                        }
                        for (int i=ex_to<numeric>(p).to_int()-1; i>0; i--) {
                                m.append(1);
                        }
@@ -2372,7 +2372,7 @@ struct map_trafo_H_convert_to_Li : public map_function
                                if (is_a<lst>(e.op(0))) {
                                                parameter = ex_to<lst>(e.op(0));
                                } else {
                                if (is_a<lst>(e.op(0))) {
                                                parameter = ex_to<lst>(e.op(0));
                                } else {
-                                       parameter = lst(e.op(0));
+                                       parameter = lst{e.op(0)};
                                }
                                ex arg = e.op(1);
 
                                }
                                ex arg = e.op(1);
 
@@ -2411,7 +2411,7 @@ struct map_trafo_H_convert_to_zeta : public map_function
                                if (is_a<lst>(e.op(0))) {
                                                parameter = ex_to<lst>(e.op(0));
                                } else {
                                if (is_a<lst>(e.op(0))) {
                                                parameter = ex_to<lst>(e.op(0));
                                } else {
-                                       parameter = lst(e.op(0));
+                                       parameter = lst{e.op(0)};
                                }
 
                                lst m;
                                }
 
                                lst m;
@@ -2444,7 +2444,7 @@ struct map_trafo_H_reduce_trailing_zeros : public map_function
                                if (is_a<lst>(e.op(0))) {
                                        parameter = ex_to<lst>(e.op(0));
                                } else {
                                if (is_a<lst>(e.op(0))) {
                                        parameter = ex_to<lst>(e.op(0));
                                } else {
-                                       parameter = lst(e.op(0));
+                                       parameter = lst{e.op(0)};
                                }
                                ex arg = e.op(1);
                                if (parameter.op(parameter.nops()-1) == 0) {
                                }
                                ex arg = e.op(1);
                                if (parameter.op(parameter.nops()-1) == 0) {
@@ -2556,7 +2556,7 @@ ex trafo_H_mult(const ex& h1, const ex& h2)
                if (h2nops > 1) {
                        hlong = ex_to<lst>(h2.op(0));
                } else {
                if (h2nops > 1) {
                        hlong = ex_to<lst>(h2.op(0));
                } else {
-                       hlong = h2.op(0).op(0);
+                       hlong = lst{h2.op(0).op(0)};
                }
        }
        for (std::size_t i=0; i<=hlong.nops(); i++) {
                }
        }
        for (std::size_t i=0; i<=hlong.nops(); i++) {
@@ -2666,7 +2666,7 @@ ex trafo_H_1tx_prepend_zero(const ex& e, const ex& arg)
                ex addzeta = convert_H_to_zeta(newparameter);
                return e.subs(h == (addzeta-H(newparameter, h.op(1)).hold())).expand();
        } else {
                ex addzeta = convert_H_to_zeta(newparameter);
                return e.subs(h == (addzeta-H(newparameter, h.op(1)).hold())).expand();
        } else {
-               return e * (-H(lst(ex(0)),1/arg).hold());
+               return e * (-H(lst{ex(0)},1/arg).hold());
        }
 }
 
        }
 }
 
@@ -2697,7 +2697,7 @@ ex trafo_H_prepend_one(const ex& e, const ex& arg)
                newparameter.prepend(1);
                return e.subs(h == H(newparameter, h.op(1)).hold());
        } else {
                newparameter.prepend(1);
                return e.subs(h == H(newparameter, h.op(1)).hold());
        } else {
-               return e * H(lst(ex(1)),1-arg).hold();
+               return e * H(lst{ex(1)},1-arg).hold();
        }
 }
 
        }
 }
 
@@ -2729,8 +2729,8 @@ ex trafo_H_1tx_prepend_minusone(const ex& e, const ex& arg)
                ex addzeta = convert_H_to_zeta(newparameter);
                return e.subs(h == (addzeta-H(newparameter, h.op(1)).hold())).expand();
        } else {
                ex addzeta = convert_H_to_zeta(newparameter);
                return e.subs(h == (addzeta-H(newparameter, h.op(1)).hold())).expand();
        } else {
-               ex addzeta = convert_H_to_zeta(lst(ex(-1)));
-               return (e * (addzeta - H(lst(ex(-1)),1/arg).hold())).expand();
+               ex addzeta = convert_H_to_zeta(lst{ex(-1)});
+               return (e * (addzeta - H(lst{ex(-1)},1/arg).hold())).expand();
        }
 }
 
        }
 }
 
@@ -2761,7 +2761,7 @@ ex trafo_H_1mxt1px_prepend_minusone(const ex& e, const ex& arg)
                newparameter.prepend(-1);
                return e.subs(h == H(newparameter, h.op(1)).hold()).expand();
        } else {
                newparameter.prepend(-1);
                return e.subs(h == H(newparameter, h.op(1)).hold()).expand();
        } else {
-               return (e * H(lst(ex(-1)),(1-arg)/(1+arg)).hold()).expand();
+               return (e * H(lst{ex(-1)},(1-arg)/(1+arg)).hold()).expand();
        }
 }
 
        }
 }
 
@@ -2792,7 +2792,7 @@ ex trafo_H_1mxt1px_prepend_one(const ex& e, const ex& arg)
                newparameter.prepend(1);
                return e.subs(h == H(newparameter, h.op(1)).hold()).expand();
        } else {
                newparameter.prepend(1);
                return e.subs(h == H(newparameter, h.op(1)).hold()).expand();
        } else {
-               return (e * H(lst(ex(1)),(1-arg)/(1+arg)).hold()).expand();
+               return (e * H(lst{ex(1)},(1-arg)/(1+arg)).hold()).expand();
        }
 }
 
        }
 }
 
@@ -2871,7 +2871,7 @@ struct map_trafo_H_1mx : public map_function
                                        // leading one
                                        map_trafo_H_1mx recursion;
                                        map_trafo_H_mult unify;
                                        // leading one
                                        map_trafo_H_1mx recursion;
                                        map_trafo_H_mult unify;
-                                       ex res = H(lst(ex(1)), arg).hold() * H(newparameter, arg).hold();
+                                       ex res = H(lst{ex(1)}, arg).hold() * H(newparameter, arg).hold();
                                        std::size_t firstzero = 0;
                                        while (parameter.op(firstzero) == 1) {
                                                firstzero++;
                                        std::size_t firstzero = 0;
                                        while (parameter.op(firstzero) == 1) {
                                                firstzero++;
@@ -2935,7 +2935,7 @@ struct map_trafo_H_1overx : public map_function
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
-                                               return unify((pow(H(lst(ex(-1)),1/arg).hold() - H(lst(ex(0)),1/arg).hold(), parameter.nops())
+                                               return unify((pow(H(lst{ex(-1)},1/arg).hold() - H(lst{ex(0)},1/arg).hold(), parameter.nops())
                                                       / factorial(parameter.nops())).expand());
                                        }
                                } else {
                                                       / factorial(parameter.nops())).expand());
                                        }
                                } else {
@@ -2947,7 +2947,7 @@ struct map_trafo_H_1overx : public map_function
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
-                                               return unify((pow(H(lst(ex(1)),1/arg).hold() + H(lst(ex(0)),1/arg).hold() + H_polesign, parameter.nops())
+                                               return unify((pow(H(lst{ex(1)},1/arg).hold() + H(lst{ex(0)},1/arg).hold() + H_polesign, parameter.nops())
                                                       / factorial(parameter.nops())).expand());
                                        }
                                }
                                                       / factorial(parameter.nops())).expand());
                                        }
                                }
@@ -2990,7 +2990,7 @@ struct map_trafo_H_1overx : public map_function
                                        // leading one
                                        map_trafo_H_1overx recursion;
                                        map_trafo_H_mult unify;
                                        // leading one
                                        map_trafo_H_1overx recursion;
                                        map_trafo_H_mult unify;
-                                       ex res = H(lst(ex(1)), arg).hold() * H(newparameter, arg).hold();
+                                       ex res = H(lst{ex(1)}, arg).hold() * H(newparameter, arg).hold();
                                        std::size_t firstzero = 0;
                                        while (parameter.op(firstzero) == 1) {
                                                firstzero++;
                                        std::size_t firstzero = 0;
                                        while (parameter.op(firstzero) == 1) {
                                                firstzero++;
@@ -3046,7 +3046,7 @@ struct map_trafo_H_1mxt1px : public map_function
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
-                                               return unify((pow(-H(lst(ex(1)),(1-arg)/(1+arg)).hold() - H(lst(ex(-1)),(1-arg)/(1+arg)).hold(), parameter.nops())
+                                               return unify((pow(-H(lst{ex(1)},(1-arg)/(1+arg)).hold() - H(lst{ex(-1)},(1-arg)/(1+arg)).hold(), parameter.nops())
                                                       / factorial(parameter.nops())).expand());
                                        }
                                } else if (parameter.op(0) == -1) {
                                                       / factorial(parameter.nops())).expand());
                                        }
                                } else if (parameter.op(0) == -1) {
@@ -3058,7 +3058,7 @@ struct map_trafo_H_1mxt1px : public map_function
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
-                                               return unify((pow(log(2) - H(lst(ex(-1)),(1-arg)/(1+arg)).hold(), parameter.nops())
+                                               return unify((pow(log(2) - H(lst{ex(-1)},(1-arg)/(1+arg)).hold(), parameter.nops())
                                                       / factorial(parameter.nops())).expand());
                                        }
                                } else {
                                                       / factorial(parameter.nops())).expand());
                                        }
                                } else {
@@ -3070,7 +3070,7 @@ struct map_trafo_H_1mxt1px : public map_function
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
                                        }
                                        if (allthesame) {
                                                map_trafo_H_mult unify;
-                                               return unify((pow(-log(2) - H(lst(ex(0)),(1-arg)/(1+arg)).hold() + H(lst(ex(-1)),(1-arg)/(1+arg)).hold(), parameter.nops())
+                                               return unify((pow(-log(2) - H(lst{ex(0)},(1-arg)/(1+arg)).hold() + H(lst{ex(-1)},(1-arg)/(1+arg)).hold(), parameter.nops())
                                                       / factorial(parameter.nops())).expand());
                                        }
                                }
                                                       / factorial(parameter.nops())).expand());
                                        }
                                }
@@ -3113,7 +3113,7 @@ struct map_trafo_H_1mxt1px : public map_function
                                        // leading one
                                        map_trafo_H_1mxt1px recursion;
                                        map_trafo_H_mult unify;
                                        // leading one
                                        map_trafo_H_1mxt1px recursion;
                                        map_trafo_H_mult unify;
-                                       ex res = H(lst(ex(1)), arg).hold() * H(newparameter, arg).hold();
+                                       ex res = H(lst{ex(1)}, arg).hold() * H(newparameter, arg).hold();
                                        std::size_t firstzero = 0;
                                        while (parameter.op(firstzero) == 1) {
                                                firstzero++;
                                        std::size_t firstzero = 0;
                                        while (parameter.op(firstzero) == 1) {
                                                firstzero++;
@@ -3316,7 +3316,7 @@ static ex H_eval(const ex& m_, const ex& x)
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
-               m = lst(m_);
+               m = lst{m_};
        }
        if (m.nops() == 0) {
                return _ex1;
        }
        if (m.nops() == 0) {
                return _ex1;
@@ -3442,7 +3442,7 @@ static ex H_deriv(const ex& m_, const ex& x, unsigned deriv_param)
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
-               m = lst(m_);
+               m = lst{m_};
        }
        ex mb = *m.begin();
        if (mb > _ex1) {
        }
        ex mb = *m.begin();
        if (mb > _ex1) {
@@ -3470,7 +3470,7 @@ static void H_print_latex(const ex& m_, const ex& x, const print_context& c)
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
-               m = lst(m_);
+               m = lst{m_};
        }
        c.s << "\\mathrm{H}_{";
        lst::const_iterator itm = m.begin();
        }
        c.s << "\\mathrm{H}_{";
        lst::const_iterator itm = m.begin();
@@ -3503,7 +3503,7 @@ ex convert_H_to_Li(const ex& m, const ex& x)
        if (is_a<lst>(m)) {
                return filter2(filter(H(m, x).hold()));
        } else {
        if (is_a<lst>(m)) {
                return filter2(filter(H(m, x).hold()));
        } else {
-               return filter2(filter(H(lst(m), x).hold()));
+               return filter2(filter(H(lst{m}, x).hold()));
        }
 }
 
        }
 }
 
@@ -4082,13 +4082,13 @@ static void zeta2_print_latex(const ex& m_, const ex& s_, const print_context& c
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
        if (is_a<lst>(m_)) {
                m = ex_to<lst>(m_);
        } else {
-               m = lst(m_);
+               m = lst{m_};
        }
        lst s;
        if (is_a<lst>(s_)) {
                s = ex_to<lst>(s_);
        } else {
        }
        lst s;
        if (is_a<lst>(s_)) {
                s = ex_to<lst>(s_);
        } else {
-               s = lst(s_);
+               s = lst{s_};
        }
        c.s << "\\zeta(";
        lst::const_iterator itm = m.begin();
        }
        c.s << "\\zeta(";
        lst::const_iterator itm = m.begin();
index d15d6ca8124cf671af50bc41e5beabcb52f94167..9ad55c57c80c427379afa83f9af6ab7f44e13653 100644 (file)
@@ -57,26 +57,26 @@ ncmul::ncmul()
 
 // public
 
 
 // public
 
-ncmul::ncmul(const ex & lh, const ex & rh) : inherited(lh,rh)
+ncmul::ncmul(const ex & lh, const ex & rh) : inherited{lh,rh}
 {
 }
 
 {
 }
 
-ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3) : inherited(f1,f2,f3)
+ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3) : inherited{f1,f2,f3}
 {
 }
 
 ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
 {
 }
 
 ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
-             const ex & f4) : inherited(f1,f2,f3,f4)
+             const ex & f4) : inherited{f1,f2,f3,f4}
 {
 }
 
 ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
 {
 }
 
 ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
-             const ex & f4, const ex & f5) : inherited(f1,f2,f3,f4,f5)
+             const ex & f4, const ex & f5) : inherited{f1,f2,f3,f4,f5}
 {
 }
 
 ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
 {
 }
 
 ncmul::ncmul(const ex & f1, const ex & f2, const ex & f3,
-             const ex & f4, const ex & f5, const ex & f6) : inherited(f1,f2,f3,f4,f5,f6)
+             const ex & f4, const ex & f5, const ex & f6) : inherited{f1,f2,f3,f4,f5,f6}
 {
 }
 
 {
 }
 
index bcb2a398bd8d57b8b8a983c2350963270e3ef3f5..c362a43afaf83265e27c06ffb8486aae27957a75 100644 (file)
@@ -2035,15 +2035,15 @@ struct normal_map_function : public map_function {
 ex basic::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (nops() == 0)
 ex basic::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (nops() == 0)
-               return (new lst(replace_with_symbol(*this, repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+               return (new lst{replace_with_symbol(*this, repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
        else {
                if (level == 1)
        else {
                if (level == 1)
-                       return (new lst(replace_with_symbol(*this, repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+                       return (new lst{replace_with_symbol(*this, repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
                else if (level == -max_recursion_level)
                        throw(std::runtime_error("max recursion level reached"));
                else {
                        normal_map_function map_normal(level - 1);
                else if (level == -max_recursion_level)
                        throw(std::runtime_error("max recursion level reached"));
                else {
                        normal_map_function map_normal(level - 1);
-                       return (new lst(replace_with_symbol(map(map_normal), repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+                       return (new lst{replace_with_symbol(map(map_normal), repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
                }
        }
 }
                }
        }
 }
@@ -2053,7 +2053,7 @@ ex basic::normal(exmap & repl, exmap & rev_lookup, int level) const
  *  @see ex::normal */
 ex symbol::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
  *  @see ex::normal */
 ex symbol::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
-       return (new lst(*this, _ex1))->setflag(status_flags::dynallocated);
+       return (new lst{*this, _ex1})->setflag(status_flags::dynallocated);
 }
 
 
 }
 
 
@@ -2077,7 +2077,7 @@ ex numeric::normal(exmap & repl, exmap & rev_lookup, int level) const
        }
 
        // Denominator is always a real integer (see numeric::denom())
        }
 
        // Denominator is always a real integer (see numeric::denom())
-       return (new lst(numex, denom()))->setflag(status_flags::dynallocated);
+       return (new lst{numex, denom()})->setflag(status_flags::dynallocated);
 }
 
 
 }
 
 
@@ -2095,11 +2095,11 @@ static ex frac_cancel(const ex &n, const ex &d)
 
        // Handle trivial case where denominator is 1
        if (den.is_equal(_ex1))
 
        // Handle trivial case where denominator is 1
        if (den.is_equal(_ex1))
-               return (new lst(num, den))->setflag(status_flags::dynallocated);
+               return (new lst{num, den})->setflag(status_flags::dynallocated);
 
        // Handle special cases where numerator or denominator is 0
        if (num.is_zero())
 
        // Handle special cases where numerator or denominator is 0
        if (num.is_zero())
-               return (new lst(num, _ex1))->setflag(status_flags::dynallocated);
+               return (new lst{num, _ex1})->setflag(status_flags::dynallocated);
        if (den.expand().is_zero())
                throw(std::overflow_error("frac_cancel: division by zero in frac_cancel"));
 
        if (den.expand().is_zero())
                throw(std::overflow_error("frac_cancel: division by zero in frac_cancel"));
 
@@ -2138,7 +2138,7 @@ static ex frac_cancel(const ex &n, const ex &d)
 
        // Return result as list
 //std::clog << " returns num = " << num << ", den = " << den << ", pre_factor = " << pre_factor << std::endl;
 
        // Return result as list
 //std::clog << " returns num = " << num << ", den = " << den << ", pre_factor = " << pre_factor << std::endl;
-       return (new lst(num * pre_factor.numer(), den * pre_factor.denom()))->setflag(status_flags::dynallocated);
+       return (new lst{num * pre_factor.numer(), den * pre_factor.denom()})->setflag(status_flags::dynallocated);
 }
 
 
 }
 
 
@@ -2148,7 +2148,7 @@ static ex frac_cancel(const ex &n, const ex &d)
 ex add::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (level == 1)
 ex add::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (level == 1)
-               return (new lst(replace_with_symbol(*this, repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+               return (new lst{replace_with_symbol(*this, repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
        else if (level == -max_recursion_level)
                throw(std::runtime_error("max recursion level reached"));
 
        else if (level == -max_recursion_level)
                throw(std::runtime_error("max recursion level reached"));
 
@@ -2205,7 +2205,7 @@ ex add::normal(exmap & repl, exmap & rev_lookup, int level) const
 ex mul::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (level == 1)
 ex mul::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (level == 1)
-               return (new lst(replace_with_symbol(*this, repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+               return (new lst{replace_with_symbol(*this, repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
        else if (level == -max_recursion_level)
                throw(std::runtime_error("max recursion level reached"));
 
        else if (level == -max_recursion_level)
                throw(std::runtime_error("max recursion level reached"));
 
@@ -2235,7 +2235,7 @@ ex mul::normal(exmap & repl, exmap & rev_lookup, int level) const
 ex power::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (level == 1)
 ex power::normal(exmap & repl, exmap & rev_lookup, int level) const
 {
        if (level == 1)
-               return (new lst(replace_with_symbol(*this, repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+               return (new lst{replace_with_symbol(*this, repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
        else if (level == -max_recursion_level)
                throw(std::runtime_error("max recursion level reached"));
 
        else if (level == -max_recursion_level)
                throw(std::runtime_error("max recursion level reached"));
 
@@ -2249,12 +2249,12 @@ ex power::normal(exmap & repl, exmap & rev_lookup, int level) const
                if (n_exponent.info(info_flags::positive)) {
 
                        // (a/b)^n -> {a^n, b^n}
                if (n_exponent.info(info_flags::positive)) {
 
                        // (a/b)^n -> {a^n, b^n}
-                       return (new lst(power(n_basis.op(0), n_exponent), power(n_basis.op(1), n_exponent)))->setflag(status_flags::dynallocated);
+                       return (new lst{power(n_basis.op(0), n_exponent), power(n_basis.op(1), n_exponent)})->setflag(status_flags::dynallocated);
 
                } else if (n_exponent.info(info_flags::negative)) {
 
                        // (a/b)^-n -> {b^n, a^n}
 
                } else if (n_exponent.info(info_flags::negative)) {
 
                        // (a/b)^-n -> {b^n, a^n}
-                       return (new lst(power(n_basis.op(1), -n_exponent), power(n_basis.op(0), -n_exponent)))->setflag(status_flags::dynallocated);
+                       return (new lst{power(n_basis.op(1), -n_exponent), power(n_basis.op(0), -n_exponent)})->setflag(status_flags::dynallocated);
                }
 
        } else {
                }
 
        } else {
@@ -2262,25 +2262,25 @@ ex power::normal(exmap & repl, exmap & rev_lookup, int level) const
                if (n_exponent.info(info_flags::positive)) {
 
                        // (a/b)^x -> {sym((a/b)^x), 1}
                if (n_exponent.info(info_flags::positive)) {
 
                        // (a/b)^x -> {sym((a/b)^x), 1}
-                       return (new lst(replace_with_symbol(power(n_basis.op(0) / n_basis.op(1), n_exponent), repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+                       return (new lst{replace_with_symbol(power(n_basis.op(0) / n_basis.op(1), n_exponent), repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
 
                } else if (n_exponent.info(info_flags::negative)) {
 
                        if (n_basis.op(1).is_equal(_ex1)) {
 
                                // a^-x -> {1, sym(a^x)}
 
                } else if (n_exponent.info(info_flags::negative)) {
 
                        if (n_basis.op(1).is_equal(_ex1)) {
 
                                // a^-x -> {1, sym(a^x)}
-                               return (new lst(_ex1, replace_with_symbol(power(n_basis.op(0), -n_exponent), repl, rev_lookup)))->setflag(status_flags::dynallocated);
+                               return (new lst{_ex1, replace_with_symbol(power(n_basis.op(0), -n_exponent), repl, rev_lookup)})->setflag(status_flags::dynallocated);
 
                        } else {
 
                                // (a/b)^-x -> {sym((b/a)^x), 1}
 
                        } else {
 
                                // (a/b)^-x -> {sym((b/a)^x), 1}
-                               return (new lst(replace_with_symbol(power(n_basis.op(1) / n_basis.op(0), -n_exponent), repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+                               return (new lst{replace_with_symbol(power(n_basis.op(1) / n_basis.op(0), -n_exponent), repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
                        }
                }
        }
 
        // (a/b)^x -> {sym((a/b)^x, 1}
                        }
                }
        }
 
        // (a/b)^x -> {sym((a/b)^x, 1}
-       return (new lst(replace_with_symbol(power(n_basis.op(0) / n_basis.op(1), n_exponent), repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+       return (new lst{replace_with_symbol(power(n_basis.op(0) / n_basis.op(1), n_exponent), repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
 }
 
 
 }
 
 
@@ -2296,7 +2296,7 @@ ex pseries::normal(exmap & repl, exmap & rev_lookup, int level) const
                        newseq.push_back(expair(restexp, it.coeff));
        }
        ex n = pseries(relational(var,point), std::move(newseq));
                        newseq.push_back(expair(restexp, it.coeff));
        }
        ex n = pseries(relational(var,point), std::move(newseq));
-       return (new lst(replace_with_symbol(n, repl, rev_lookup), _ex1))->setflag(status_flags::dynallocated);
+       return (new lst{replace_with_symbol(n, repl, rev_lookup), _ex1})->setflag(status_flags::dynallocated);
 }
 
 
 }
 
 
index 6210deff40f704b82104cffe75b496cd7b42bb81..3a8f06211e7b523bf97d30319415acfb4aaf1903 100644 (file)
@@ -279,7 +279,7 @@ exp : T_NUMBER              {$$ = $1;}
        | '[' matrix ']'        {$$ = lst_to_matrix(ex_to<lst>($2));}
        ;
 
        | '[' matrix ']'        {$$ = lst_to_matrix(ex_to<lst>($2));}
        ;
 
-exprseq        : exp                   {$$ = exprseq($1);}
+exprseq        : exp                   {$$ = exprseq{$1};}
        | exprseq ',' exp       {exprseq es(ex_to<exprseq>($1)); $$ = es.append($3);}
        ;
 
        | exprseq ',' exp       {exprseq es(ex_to<exprseq>($1)); $$ = es.append($3);}
        ;
 
@@ -287,15 +287,15 @@ list_or_empty: /* empty */        {$$ = *new lst;}
        | list                  {$$ = $1;}
        ;
 
        | list                  {$$ = $1;}
        ;
 
-list   : exp                   {$$ = lst($1);}
+list   : exp                   {$$ = lst{$1};}
        | list ',' exp          {lst l(ex_to<lst>($1)); $$ = l.append($3);}
        ;
 
        | list ',' exp          {lst l(ex_to<lst>($1)); $$ = l.append($3);}
        ;
 
-matrix : '[' row ']'           {$$ = lst($2);}
+matrix : '[' row ']'           {$$ = lst{$2};}
        | matrix ',' '[' row ']' {lst l(ex_to<lst>($1)); $$ = l.append($4);}
        ;
 
        | matrix ',' '[' row ']' {lst l(ex_to<lst>($1)); $$ = l.append($4);}
        ;
 
-row    : exp                   {$$ = lst($1);}
+row    : exp                   {$$ = lst{$1};}
        | row ',' exp           {lst l(ex_to<lst>($1)); $$ = l.append($3);}
        ;
 
        | row ',' exp           {lst l(ex_to<lst>($1)); $$ = l.append($3);}
        ;