X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Ftime_toeplitz.cpp;h=d5f64c0989a32dab7bb53e53f03fc9ca217cdd35;hp=7383a3b92657ed2907ac53db6f5b7e0b65c5aa74;hb=26e9e289dd5e4f0790ee687d56db41b95dfe98f7;hpb=95ede03f00106be5fb087d76c86ca5c27edb9122 diff --git a/check/time_toeplitz.cpp b/check/time_toeplitz.cpp index 7383a3b9..d5f64c09 100644 --- a/check/time_toeplitz.cpp +++ b/check/time_toeplitz.cpp @@ -6,7 +6,7 @@ */ /* - * GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2017 Johannes Gutenberg University Mainz, Germany * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -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]]): @@ -61,7 +61,7 @@ static unsigned toeplitz_det(unsigned size) // dirty consistency check of result: if (!tdet.subs(a==0).subs(b==0).is_zero()) { - clog << "Determaint of Toeplitz matrix " << endl + clog << "Determinant of Toeplitz matrix " << endl << "M==" << M << endl << "was miscalculated: det(M)==" << tdet << endl; ++result; @@ -76,15 +76,10 @@ unsigned time_toeplitz() cout << "timing determinant of polyvariate symbolic Toeplitz matrices" << flush; - vector sizes; + vector sizes = {7, 8, 9, 10}; vector times; timer longines; - sizes.push_back(7); - sizes.push_back(8); - sizes.push_back(9); - sizes.push_back(10); - for (vector::iterator i=sizes.begin(); i!=sizes.end(); ++i) { int count = 1; longines.start();