From: Richard Kreckel Date: Thu, 26 Nov 2015 20:36:46 +0000 (+0100) Subject: Use initializer lists to construct container<>, lst. X-Git-Tag: release_1-7-0~7^2~43 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=8f283de519668b70b2e675a7055c7f1bf7ba197c Use initializer lists to construct container<>, lst. Add constructor of initializer_list to container>. 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). --- diff --git a/check/exam_archive.cpp b/check/exam_archive.cpp index cc5891cd..8a9bf5f9 100644 --- a/check/exam_archive.cpp +++ b/check/exam_archive.cpp @@ -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( - 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)), - 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 ) @@ -64,7 +64,7 @@ unsigned exam_archive() 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()) { diff --git a/check/exam_clifford.cpp b/check/exam_clifford.cpp index 24655e48..0430e2da 100644 --- a/check/exam_clifford.cpp +++ b/check/exam_clifford.cpp @@ -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(mu) - ? lst ( + ? lst { mu == idx(j, mu.get_dim()), ex_to(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 " @@ -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, 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)); @@ -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 - 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; } @@ -417,17 +417,17 @@ template unsigned clifford_check6(const matrix &A) 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*/ - 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*/ - 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); @@ -436,32 +436,32 @@ template unsigned clifford_check6(const matrix &A) 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; - 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); - 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); - 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*/ - 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(); - 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); - 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(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; @@ -546,7 +546,7 @@ static unsigned clifford_check8() 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; @@ -565,15 +565,15 @@ unsigned exam_clifford() result += clifford_check5(); cout << '.' << flush; // anticommuting, symmetric examples - result += clifford_check6(ex_to(diag_matrix(lst(-1, 1, 1, 1)))); - result += clifford_check6(ex_to(diag_matrix(lst(-1, 1, 1, 1))));; cout << '.' << flush; - result += clifford_check6(ex_to(diag_matrix(lst(-1, -1, -1, -1))))+clifford_check6(ex_to(diag_matrix(lst(-1, -1, -1, -1))));; cout << '.' << flush; - result += clifford_check6(ex_to(diag_matrix(lst(-1, 1, 1, -1))))+clifford_check6(ex_to(diag_matrix(lst(-1, 1, 1, -1))));; cout << '.' << flush; - result += clifford_check6(ex_to(diag_matrix(lst(-1, 0, 1, -1))))+clifford_check6(ex_to(diag_matrix(lst(-1, 0, 1, -1))));; cout << '.' << flush; - result += clifford_check6(ex_to(diag_matrix(lst(-3, 0, 2, -1))))+clifford_check6(ex_to(diag_matrix(lst(-3, 0, 2, -1))));; cout << '.' << flush; + result += clifford_check6(ex_to(diag_matrix(lst{-1, 1, 1, 1}))); + result += clifford_check6(ex_to(diag_matrix(lst{-1, 1, 1, 1})));; cout << '.' << flush; + result += clifford_check6(ex_to(diag_matrix(lst{-1, -1, -1, -1})))+clifford_check6(ex_to(diag_matrix(lst{-1, -1, -1, -1})));; cout << '.' << flush; + result += clifford_check6(ex_to(diag_matrix(lst{-1, 1, 1, -1})))+clifford_check6(ex_to(diag_matrix(lst{-1, 1, 1, -1})));; cout << '.' << flush; + result += clifford_check6(ex_to(diag_matrix(lst{-1, 0, 1, -1})))+clifford_check6(ex_to(diag_matrix(lst{-1, 0, 1, -1})));; cout << '.' << flush; + result += clifford_check6(ex_to(diag_matrix(lst{-3, 0, 2, -1})))+clifford_check6(ex_to(diag_matrix(lst{-3, 0, 2, -1})));; cout << '.' << flush; realsymbol s("s"), t("t"); // symbolic entries in matric - result += clifford_check6(ex_to(diag_matrix(lst(-1, 1, s, t))))+clifford_check6(ex_to(diag_matrix(lst(-1, 1, s, t))));; cout << '.' << flush; + result += clifford_check6(ex_to(diag_matrix(lst{-1, 1, s, t})))+clifford_check6(ex_to(diag_matrix(lst{-1, 1, s, t})));; cout << '.' << flush; matrix A(4, 4); A = 1, 0, 0, 0, // anticommuting, not symmetric, Tr=0 diff --git a/check/exam_color.cpp b/check/exam_color.cpp index 4e5894c0..3e44718a 100644 --- a/check/exam_color.cpp +++ b/check/exam_color.cpp @@ -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++) - 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; @@ -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, 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); - result += check_equal_simplify(color_trace(e, lst(0, 1)), 2); + result += check_equal_simplify(color_trace(e, lst{0, 1}), 2); return result; } diff --git a/check/exam_differentiation.cpp b/check/exam_differentiation.cpp index fd1a7ccb..540c276d 100644 --- a/check/exam_differentiation.cpp +++ b/check/exam_differentiation.cpp @@ -69,19 +69,19 @@ static unsigned exam_differentiation1() 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: - 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: - 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: - 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; diff --git a/check/exam_factor.cpp b/check/exam_factor.cpp index 98dc90fa..bed95aa1 100644 --- a/check/exam_factor.cpp +++ b/check/exam_factor.cpp @@ -113,8 +113,7 @@ static unsigned exam_factor2() 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); @@ -172,8 +171,7 @@ static unsigned exam_factor3() 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); diff --git a/check/exam_indexed.cpp b/check/exam_indexed.cpp index 7351e969..cf58ac7f 100644 --- a/check/exam_indexed.cpp +++ b/check/exam_indexed.cpp @@ -267,12 +267,12 @@ static unsigned edyn_check() * 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); @@ -285,7 +285,7 @@ static unsigned edyn_check() // 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()) @@ -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) - * 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()) - * 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 - 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)); @@ -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()); - 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; diff --git a/check/exam_inifcns_nstdsums.cpp b/check/exam_inifcns_nstdsums.cpp index 9415b9b3..0fbfaec6 100644 --- a/check/exam_inifcns_nstdsums.cpp +++ b/check/exam_inifcns_nstdsums.cpp @@ -134,19 +134,19 @@ static unsigned inifcns_test_HLi() 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()); @@ -160,8 +160,8 @@ static unsigned inifcns_test_HLi() Digits = digitsbuf; // conjugate test - numeric cdif = ex_to(H(lst(2,2,1),5.0-5.0*I) - H(lst(2,2,1),5.0+5.0*I)); - numeric cadd = ex_to(H(lst(2,2,1),5.0-5.0*I) + H(lst(2,2,1),5.0+5.0*I)); + numeric cdif = ex_to(H(lst{2,2,1},5.0-5.0*I) - H(lst{2,2,1},5.0+5.0*I)); + numeric cadd = ex_to(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++; @@ -186,16 +186,16 @@ static unsigned inifcns_test_zeta() 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)); - 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; @@ -241,42 +241,42 @@ static unsigned inifcns_test_LiG() 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; - 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); - 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 - 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; - 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 - 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()); @@ -308,7 +308,7 @@ static unsigned inifcns_test_legacy() 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++; @@ -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 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(); - 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++; @@ -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 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++; } - 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++; @@ -373,15 +373,15 @@ static unsigned inifcns_test_legacy() 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 { diff --git a/check/exam_matrices.cpp b/check/exam_matrices.cpp index 3e1c25e5..b5b27ffc 100644 --- a/check/exam_matrices.cpp +++ b/check/exam_matrices.cpp @@ -224,16 +224,16 @@ static unsigned matrix_evalm() { unsigned result = 0; - matrix S(2, 2, lst( + matrix S(2, 2, lst{ 1, 2, 3, 4 - )), T(2, 2, lst( + }), T(2, 2, lst{ 1, 1, 2, -1 - )), R(2, 2, lst( + }), R(2, 2, lst{ 27, 14, 36, 26 - )); + }); ex e = ((S + T) * (S + 2*T)); ex f = e.evalm(); diff --git a/check/exam_misc.cpp b/check/exam_misc.cpp index cdbb7637..50837cef 100644 --- a/check/exam_misc.cpp +++ b/check/exam_misc.cpp @@ -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); - e2 = sqrfree(expand(e1),lst(x)); + e2 = sqrfree(expand(e1),lst{x}); if (e1 != e2) { clog << "sqrfree(expand(" << e1 << ")) erroneously returned " << e2 << endl; @@ -110,19 +110,19 @@ static unsigned exam_sqrfree() << 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; } - 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; } - 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; diff --git a/check/exam_numeric.cpp b/check/exam_numeric.cpp index 8170e364..73700a13 100644 --- a/check/exam_numeric.cpp +++ b/check/exam_numeric.cpp @@ -366,7 +366,7 @@ static unsigned exam_numeric6() // 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)) { diff --git a/check/exam_powerlaws.cpp b/check/exam_powerlaws.cpp index b8176035..3bfac6e8 100644 --- a/check/exam_powerlaws.cpp +++ b/check/exam_powerlaws.cpp @@ -69,7 +69,7 @@ static unsigned exam_powerlaws1() 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(e4) && is_exactly_a(e4.op(0)) && is_exactly_a(e4.op(0).op(0)) && @@ -81,7 +81,7 @@ static unsigned exam_powerlaws1() 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(e5) && is_exactly_a(e5.op(0)) && is_exactly_a(e5.op(1)) && @@ -91,7 +91,7 @@ static unsigned exam_powerlaws1() 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(e6) && is_exactly_a(e6.op(0)) && is_exactly_a(e6.op(1)) && @@ -162,7 +162,7 @@ static unsigned exam_powerlaws2() 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(e5) && (e5.nops()==2) && is_exactly_a(e5.op(0)) && @@ -174,7 +174,7 @@ static unsigned exam_powerlaws2() 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(e6) && (e6.nops()==2) && is_exactly_a(e6.op(0)) && @@ -186,7 +186,7 @@ static unsigned exam_powerlaws2() 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(e7) && is_exactly_a(e7.op(0)) && (e7.op(0).nops()==2) && diff --git a/check/time_lw_M1.cpp b/check/time_lw_M1.cpp index 2b3864af..455c2f1d 100644 --- a/check/time_lw_M1.cpp +++ b/check/time_lw_M1.cpp @@ -70,7 +70,7 @@ static unsigned test() } 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; diff --git a/check/time_lw_N.cpp b/check/time_lw_N.cpp index c4ad95f9..c3ce01b0 100644 --- a/check/time_lw_N.cpp +++ b/check/time_lw_N.cpp @@ -40,16 +40,16 @@ static unsigned test() 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; diff --git a/check/time_toeplitz.cpp b/check/time_toeplitz.cpp index 39509f5b..bb8a1c15 100644 --- a/check/time_toeplitz.cpp +++ b/check/time_toeplitz.cpp @@ -35,16 +35,16 @@ static unsigned toeplitz_det(unsigned size) { 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]]): diff --git a/doc/examples/compile2.cpp b/doc/examples/compile2.cpp index fb0813cb..faff99cc 100644 --- a/doc/examples/compile2.cpp +++ b/doc/examples/compile2.cpp @@ -22,7 +22,7 @@ int main() 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; @@ -46,7 +46,7 @@ int main() // 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 diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi index 1b8a1a6a..7f6c9535 100644 --- a/doc/tutorial/ginac.texi +++ b/doc/tutorial/ginac.texi @@ -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. -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; - 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 -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: @@ -2052,13 +2040,13 @@ Here are a couple of examples for constructing matrices: 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]] - 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]] - cout << diag_matrix(lst(a, b)) << endl; + cout << diag_matrix(lst@{a, b@}) << 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); - 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 @} @@ -3359,7 +3347,7 @@ ways. For example ... 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); @@ -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"); - 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 @@ -4070,7 +4058,7 @@ The following example illustrates the differences between @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(cout, "\n")); @@ -4270,13 +4258,13 @@ In the first form, @code{subs()} accepts a relational of the form // -> 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. -@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 @@ -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; - 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 @@ -5027,7 +5015,7 @@ one variable, the variables are given as a list. @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 @@ -5354,7 +5342,7 @@ int main() 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 @@ -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)); - 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) - 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; @@ -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, 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 - 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 @@ -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. -@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 @@ -6089,7 +6077,7 @@ $\zeta(\overline{3},4)$ @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 @@ -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, -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) diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index 56e43bd8..4b3c0794 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -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 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) - 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 - 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 & rls, const ex & trO 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 - ), subs_options::no_pattern).expand(); + }, subs_options::no_pattern).expand(); if (!is_a(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(curridx) ? ex_to(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); diff --git a/ginac/compiler.h b/ginac/compiler.h index e7a70f17..8c31ed13 100644 --- a/ginac/compiler.h +++ b/ginac/compiler.h @@ -26,9 +26,11 @@ #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) +#define deprecated #endif #ifdef _MSC_VER diff --git a/ginac/container.h b/ginac/container.h index dd8be131..04ab31d1 100644 --- a/ginac/container.h +++ b/ginac/container.h @@ -27,6 +27,7 @@ #include "print.h" #include "archive.h" #include "assertion.h" +#include "compiler.h" #include #include @@ -45,6 +46,7 @@ protected: container_storage() {} container_storage(size_t n, const ex & e) : seq(n, e) {} + container_storage(std::initializer_list il) : seq(il) {} template container_storage(In b, In e) : seq(b, e) {} @@ -160,195 +162,41 @@ public: setflag(get_default_flags()); } - explicit container(const ex & p1) - : container_storage(1, p1) + container(std::initializer_list il) + : container_storage(il) { 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,(). - container_init operator=(const ex & x) - { - this->seq.push_back(x); - return container_init(this->seq); - } + container_init operator=(const ex & x) deprecated; // functions overriding virtual functions from base classes public: @@ -499,6 +347,84 @@ container::container() setflag(get_default_flags()); } +/** Deprecatd constructors (prefer initializer list) */ +template