X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=check%2Ftime_lw_H.cpp;h=730228a828d6609abaf02f209fc47303b7af3eb5;hp=d9604b1145463887d9aa3224c650212cf039d1f0;hb=0b985d5336debdd396f0fbeca8df850af5f569f4;hpb=383d5eb3b0f0506810d9105a268f939125bfc347 diff --git a/check/time_lw_H.cpp b/check/time_lw_H.cpp index d9604b11..730228a8 100644 --- a/check/time_lw_H.cpp +++ b/check/time_lw_H.cpp @@ -4,7 +4,7 @@ * Lewis and Michael Wester. */ /* - * GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany + * GiNaC Copyright (C) 1999-2015 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 @@ -18,52 +18,73 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "times.h" +#include "ginac.h" +#include "timer.h" +using namespace GiNaC; -static unsigned test(void) +#include +#include +using namespace std; + +static unsigned test(unsigned n) { - matrix h80(80,80); - - for (unsigned r=0; r<80; ++r) - for (unsigned c=0; c<80; ++c) - h80.set(r,c,numeric(1,r+c+1)); - ex det = h80.determinant(); + matrix hilbert(n,n); + + for (unsigned r=0; rnumeric("1.E-3800")) { - clog << "determinant of 80x80 erroneously returned " << det << endl; + n-1 / \ + ----- | pow(factorial(r),3) | + | | | ------------------- | + | | | factorial(r+n) | + r = 0 \ / + */ + + ex hilbdet = 1; + for (unsigned r=0; r