1 /** @file time_lw_IJKL.cpp
3 * Tests I, J, K and L from the paper "Comparison of Polynomial-Oriented CAS"
4 * by Robert H. Lewis and Michael Wester. */
7 * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
26 static unsigned test(unsigned n)
30 char name = (n==40?'I':(n==70?'K':'?'));
32 cout << "timing Lewis-Wester test " << name
33 << " (invert rank " << n << " Hilbert)" << flush;
34 clog << "-------Lewis-Wester test " << name
35 << " (invert rank " << n << " Hilbert):" << endl;
37 // Create a rank n Hilbert matrix:
39 for (unsigned r=0; r<n; ++r)
40 for (unsigned c=0; c<n; ++c)
41 H.set(r,c,numeric(1,r+c+1));
47 clog << "(no output)" << endl;
48 cout << cartier.read() << 's' << endl;
51 name = (n==40?'J':(n==70?'L':'?'));
53 cout << "timing Lewis-Wester test " << name
54 << " (check rank " << n << " Hilbert)" << flush;
55 clog << "-------Lewis-Wester test " << name
56 << " (check rank " << n << " Hilbert):" << endl;
59 matrix identity = H.mul(Hinv);
61 for (unsigned r=0; r<n; ++r)
62 for (unsigned c=0; c<n; ++c) {
73 clog << "(no output)" << endl;
78 cout << cartier.read() << 's' << endl;
82 unsigned time_lw_IJKL()