]> www.ginac.de Git - ginac.git/commitdiff
check: indicate the test failures with non-zero exit code; split test programs.
authorAlexei Sheplyakov <varg@theor.jinr.ru>
Thu, 28 Feb 2008 07:11:50 +0000 (10:11 +0300)
committerAlexei Sheplyakov <varg@theor.jinr.ru>
Tue, 4 Mar 2008 05:57:28 +0000 (08:57 +0300)
IMNSHO parsing the output of test programs in order to check if the
tests passed is a bad idea (and it causes *real* problems, see e.g.
http://www.ginac.de/pipermail/ginac-list/2008-February/001345.html).
It's much simpler and cleaner to indicate the failure in a genuine
*NIX way: exit with nonzero code.

60 files changed:
check/Makefile.am
check/check_inifcns.cpp
check/check_lsolve.cpp
check/check_matrices.cpp
check/check_numeric.cpp
check/checks.cpp [deleted file]
check/checks.h [deleted file]
check/checks.ref [deleted file]
check/exam_archive.cpp
check/exam_clifford.cpp
check/exam_color.cpp
check/exam_differentiation.cpp
check/exam_hashmap.cpp
check/exam_indexed.cpp
check/exam_inifcns.cpp
check/exam_inifcns_nstdsums.cpp
check/exam_lsolve.cpp
check/exam_matrices.cpp
check/exam_misc.cpp
check/exam_normalization.cpp
check/exam_numeric.cpp
check/exam_paranoia.cpp
check/exam_polygcd.cpp
check/exam_powerlaws.cpp
check/exam_pseries.cpp
check/exam_structure.cpp
check/exams.cpp [deleted file]
check/exams.h [deleted file]
check/exams.ref [deleted file]
check/randomize_serials.cpp [new file with mode: 0644]
check/run_checks [deleted file]
check/run_exams [deleted file]
check/run_times [deleted file]
check/time_antipode.cpp
check/time_dennyfliegner.cpp
check/time_fateman_expand.cpp
check/time_gammaseries.cpp
check/time_hashmap.cpp
check/time_lw_A.cpp
check/time_lw_B.cpp
check/time_lw_C.cpp
check/time_lw_D.cpp
check/time_lw_E.cpp
check/time_lw_F.cpp
check/time_lw_G.cpp
check/time_lw_H.cpp
check/time_lw_IJKL.cpp
check/time_lw_M1.cpp
check/time_lw_M2.cpp
check/time_lw_N.cpp
check/time_lw_O.cpp
check/time_lw_P.cpp
check/time_lw_Pprime.cpp
check/time_lw_Q.cpp
check/time_lw_Qprime.cpp
check/time_toeplitz.cpp
check/time_vandermonde.cpp
check/times.cpp [deleted file]
check/times.h [deleted file]
check/times.ref [deleted file]

index b7c9d0fbf0972e3010c13771828f88c6530171d9..d7f372b1146ce516eb6dec3026680cc517c322ad 100644 (file)
 ## Process this file with automake to produce Makefile.in
 
-TESTS = run_exams run_checks run_times
-check_PROGRAMS = exams checks times
-TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) srcdir=$(srcdir)
-
-checks_SOURCES =  check_numeric.cpp check_inifcns.cpp check_matrices.cpp \
-  check_lsolve.cpp genex.cpp checks.cpp checks.h
-checks_LDADD = ../ginac/libginac.la
-
-exams_SOURCES = exam_paranoia.cpp exam_numeric.cpp exam_powerlaws.cpp \
-  exam_inifcns.cpp exam_inifcns_nstdsums.cpp exam_inifcns_nstdsums.h \
-  exam_differentiation.cpp exam_polygcd.cpp exam_normalization.cpp \
-  exam_pseries.cpp exam_matrices.cpp exam_lsolve.cpp exam_indexed.cpp \
-  exam_color.cpp exam_clifford.cpp exam_archive.cpp exam_structure.cpp \
-  exam_hashmap.cpp exam_misc.cpp exams.cpp exams.h
-exams_LDADD = ../ginac/libginac.la
-
-times_SOURCES = time_dennyfliegner.cpp time_gammaseries.cpp \
-  time_vandermonde.cpp time_toeplitz.cpp time_hashmap.cpp time_lw_A.cpp \
-  time_lw_B.cpp time_lw_C.cpp time_lw_D.cpp time_lw_E.cpp time_lw_F.cpp \
-  time_lw_G.cpp time_lw_H.cpp time_lw_IJKL.cpp time_lw_M1.cpp time_lw_M2.cpp \
-  time_lw_N.cpp time_lw_O.cpp time_lw_P.cpp time_lw_Pprime.cpp time_lw_Q.cpp \
-  time_lw_Qprime.cpp time_antipode.cpp time_fateman_expand.cpp timer.cpp \
-  timer.h times.cpp times.h
-times_LDADD = ../ginac/libginac.la
-
-INCLUDES = -I$(srcdir)/../ginac -I../ginac
-
-CLEANFILES = exams.out checks.out times.out exam.gar
-EXTRA_DIST = exams.ref checks.ref times.ref run_exams run_checks run_times
+CHECKS = check_numeric \
+        check_inifcns \
+        check_matrices \
+        check_lsolve 
+
+EXAMS = exam_paranoia \
+       exam_numeric \
+       exam_powerlaws  \
+       exam_inifcns \
+       exam_inifcns_nstdsums \
+       exam_differentiation  \
+       exam_polygcd  \
+       exam_normalization  \
+       exam_pseries  \
+       exam_matrices  \
+       exam_lsolve  \
+       exam_indexed  \
+       exam_color  \
+       exam_clifford  \
+       exam_archive  \
+       exam_structure  \
+       exam_hashmap  \
+       exam_misc
+
+TIMES = time_dennyfliegner \
+       time_gammaseries \
+       time_vandermonde \
+       time_toeplitz \
+       time_hashmap \
+       time_lw_A \
+       time_lw_B \
+       time_lw_C \
+       time_lw_D \
+       time_lw_E \
+       time_lw_F \
+       time_lw_G \
+       time_lw_H \
+       time_lw_IJKL \
+       time_lw_M1 \
+       time_lw_M2 \
+       time_lw_N \
+       time_lw_O \
+       time_lw_P \
+       time_lw_Pprime \
+       time_lw_Q \
+       time_lw_Qprime \
+       time_antipode \
+       time_fateman_expand
+
+TESTS = $(CHECKS) $(EXAMS) $(TIMES)
+check_PROGRAMS = $(CHECKS) $(EXAMS) $(TIMES)
+
+check_numeric_SOURCES = check_numeric.cpp 
+check_numeric_LDADD = ../ginac/libginac.la
+
+check_inifcns_SOURCES = check_inifcns.cpp
+check_inifcns_LDADD = ../ginac/libginac.la
+
+check_matrices_SOURCES = check_matrices.cpp genex.cpp
+check_matrices_LDADD = ../ginac/libginac.la
+
+check_lsolve_SOURCES = check_lsolve.cpp genex.cpp
+check_lsolve_LDADD = ../ginac/libginac.la
+
+exam_paranoia_SOURCES = exam_paranoia.cpp
+exam_paranoia_LDADD = ../ginac/libginac.la
+
+exam_numeric_SOURCES = exam_numeric.cpp
+exam_numeric_LDADD = ../ginac/libginac.la
+
+exam_powerlaws_SOURCES = exam_powerlaws.cpp
+exam_powerlaws_LDADD = ../ginac/libginac.la
+
+exam_inifcns_SOURCES = exam_inifcns.cpp
+exam_inifcns_LDADD = ../ginac/libginac.la
+
+exam_inifcns_nstdsums_SOURCES = exam_inifcns_nstdsums.cpp \
+                               exam_inifcns_nstdsums.h
+exam_inifcns_nstdsums_LDADD = ../ginac/libginac.la
+
+exam_differentiation_SOURCES = exam_differentiation.cpp
+exam_differentiation_LDADD = ../ginac/libginac.la
+
+exam_polygcd_SOURCES = exam_polygcd.cpp
+exam_polygcd_LDADD = ../ginac/libginac.la
+
+exam_normalization_SOURCES = exam_normalization.cpp
+exam_normalization_LDADD = ../ginac/libginac.la
+
+exam_pseries_SOURCES = exam_pseries.cpp
+exam_pseries_LDADD = ../ginac/libginac.la
+
+exam_matrices_SOURCES = exam_matrices.cpp
+exam_matrices_LDADD = ../ginac/libginac.la
+
+exam_lsolve_SOURCES = exam_lsolve.cpp
+exam_lsolve_LDADD = ../ginac/libginac.la
+
+exam_indexed_SOURCES = exam_indexed.cpp
+exam_indexed_LDADD = ../ginac/libginac.la
+
+exam_color_SOURCES = exam_color.cpp
+exam_color_LDADD = ../ginac/libginac.la
+
+exam_clifford_SOURCES = exam_clifford.cpp
+exam_clifford_LDADD = ../ginac/libginac.la
+
+exam_archive_SOURCES = exam_archive.cpp
+exam_archive_LDADD = ../ginac/libginac.la
+
+exam_structure_SOURCES = exam_structure.cpp
+exam_structure_LDADD = ../ginac/libginac.la
+
+exam_hashmap_SOURCES = exam_hashmap.cpp
+exam_hashmap_LDADD = ../ginac/libginac.la
+
+exam_misc_SOURCES = exam_misc.cpp
+exam_misc_LDADD = ../ginac/libginac.la
+
+
+time_dennyfliegner_SOURCES = time_dennyfliegner.cpp \
+                            randomize_serials.cpp timer.cpp timer.h
+time_dennyfliegner_LDADD = ../ginac/libginac.la
+
+time_gammaseries_SOURCES = time_gammaseries.cpp \
+                          randomize_serials.cpp timer.cpp timer.h
+time_gammaseries_LDADD = ../ginac/libginac.la
+
+time_vandermonde_SOURCES = time_vandermonde.cpp \
+                          randomize_serials.cpp timer.cpp timer.h
+time_vandermonde_LDADD = ../ginac/libginac.la
+
+time_toeplitz_SOURCES = time_toeplitz.cpp \
+                       randomize_serials.cpp timer.cpp timer.h
+time_toeplitz_LDADD = ../ginac/libginac.la
+time_hashmap_SOURCES = time_hashmap.cpp \
+                      randomize_serials.cpp timer.cpp timer.h
+time_hashmap_LDADD = ../ginac/libginac.la
+
+time_lw_A_SOURCES = time_lw_A.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_A_LDADD = ../ginac/libginac.la
+
+time_lw_B_SOURCES = time_lw_B.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_B_LDADD = ../ginac/libginac.la
+
+time_lw_C_SOURCES = time_lw_C.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_C_LDADD = ../ginac/libginac.la
+
+time_lw_D_SOURCES = time_lw_D.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_D_LDADD = ../ginac/libginac.la
+
+time_lw_E_SOURCES = time_lw_E.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_E_LDADD = ../ginac/libginac.la
+
+time_lw_F_SOURCES = time_lw_F.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_F_LDADD = ../ginac/libginac.la
+
+time_lw_G_SOURCES = time_lw_G.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_G_LDADD = ../ginac/libginac.la
+
+time_lw_H_SOURCES = time_lw_H.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_H_LDADD = ../ginac/libginac.la
+
+time_lw_IJKL_SOURCES = time_lw_IJKL.cpp \
+                      randomize_serials.cpp timer.cpp timer.h
+time_lw_IJKL_LDADD = ../ginac/libginac.la
+
+time_lw_M1_SOURCES = time_lw_M1.cpp \
+                    randomize_serials.cpp timer.cpp timer.h
+time_lw_M1_LDADD = ../ginac/libginac.la
+
+time_lw_M2_SOURCES = time_lw_M2.cpp \
+                    randomize_serials.cpp timer.cpp timer.h
+time_lw_M2_LDADD = ../ginac/libginac.la
+
+time_lw_N_SOURCES = time_lw_N.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_N_LDADD = ../ginac/libginac.la
+
+time_lw_O_SOURCES = time_lw_O.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_O_LDADD = ../ginac/libginac.la
+
+time_lw_P_SOURCES = time_lw_P.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_P_LDADD = ../ginac/libginac.la
+
+time_lw_Pprime_SOURCES = time_lw_Pprime.cpp \
+                        randomize_serials.cpp timer.cpp timer.h
+time_lw_Pprime_LDADD = ../ginac/libginac.la
+
+time_lw_Q_SOURCES = time_lw_Q.cpp \
+                   randomize_serials.cpp timer.cpp timer.h
+time_lw_Q_LDADD = ../ginac/libginac.la
+
+time_lw_Qprime_SOURCES = time_lw_Qprime.cpp \
+                        randomize_serials.cpp timer.cpp timer.h
+time_lw_Qprime_LDADD = ../ginac/libginac.la
+
+time_antipode_SOURCES = time_antipode.cpp \
+                       randomize_serials.cpp timer.cpp timer.h
+time_antipode_LDADD = ../ginac/libginac.la
+
+time_fateman_expand_SOURCES = time_fateman_expand.cpp \
+                             randomize_serials.cpp timer.cpp timer.h
+time_fateman_expand_LDADD = ../ginac/libginac.la
+
+AM_CPPFLAGS = -I$(srcdir)/../ginac -I../ginac
index 2b10178f62bb41b4ce0cad1d5bb706449de06f09..293fd8b1e52ed253266fd31d86793d5ddc106428 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "checks.h"
+#include <iostream>
+#include <cstdlib> // rand()
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 /* Some tests on the sine trigonometric function. */
 static unsigned inifcns_check_sin()
@@ -195,19 +199,16 @@ unsigned check_inifcns()
        unsigned result = 0;
 
        cout << "checking consistency of symbolic functions" << flush;
-       clog << "---------consistency of symbolic functions:" << endl;
        
        result += inifcns_check_sin();  cout << '.' << flush;
        result += inifcns_check_cos();  cout << '.' << flush;
        result += inifcns_check_tan();  cout << '.' << flush;
        result += inifcns_check_Li2();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return check_inifcns();
+}
index 02a1df5c18072458d28be436fe58c99f92f8df94..5f3c78a0fbda3542a65f5ccb66d9394bc6d511b9 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "checks.h"
+#include <iostream>
 #include <sstream>
+#include <cstdlib> // rand()
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
+
+extern const ex 
+dense_univariate_poly(const symbol & x, unsigned degree);
 
 static unsigned check_matrix_solve(unsigned m, unsigned n, unsigned p,
                                                                   unsigned degree)
@@ -161,7 +168,6 @@ unsigned check_lsolve()
        unsigned result = 0;
        
        cout << "checking linear solve" << flush;
-       clog << "---------linear solve:" << endl;
        
        // solve some numeric linear systems
        for (unsigned n=1; n<14; ++n)
@@ -191,12 +197,10 @@ unsigned check_lsolve()
        result += check_inifcns_lsolve(5);  cout << '.' << flush;
        result += check_inifcns_lsolve(6);  cout << '.' << flush;
                
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return check_lsolve();
+}
index 38c87f48efd3df92b7e320a5e094fd50e6eca56a..1b310d4f5a1d1f571eb8113b42a0ee1d3e6b146b 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "checks.h"
+#include <iostream>
+#include <cstdlib> // rand(), RAND_MAX
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
+
+extern const ex 
+sparse_tree(const symbol & x, const symbol & y, const symbol & z,
+           int level, bool trig = false, bool rational = true,
+           bool complex = false);
+extern const ex 
+dense_univariate_poly(const symbol & x, unsigned degree);
 
 /* determinants of some sparse symbolic matrices with coefficients in
  * an integral domain. */
@@ -200,7 +211,6 @@ unsigned check_matrices()
        unsigned result = 0;
        
        cout << "checking symbolic matrix manipulations" << flush;
-       clog << "---------symbolic matrix manipulations:" << endl;
        
        result += integdom_matrix_determinants();  cout << '.' << flush;
        result += rational_matrix_determinants();  cout << '.' << flush;
@@ -208,12 +218,10 @@ unsigned check_matrices()
        result += compare_matrix_determinants();  cout << '.' << flush;
        result += symbolic_matrix_inverse();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return check_matrices();
+}
index ec1eaf2814e7bfb20d7aeabe4d8cea46023d4c58..ce79a27498cad185f85b7c1b02d4ccc91d31ccd4 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "checks.h"
+#include <iostream>
+#include <cstdlib> // rand()
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 /* Simple and maybe somewhat pointless consistency tests of assorted tests and
  * conversions. */
@@ -115,12 +119,10 @@ unsigned check_numeric()
        result += check_numeric1();  cout << '.' << flush;
        result += check_numeric2();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return check_numeric();
+}
diff --git a/check/checks.cpp b/check/checks.cpp
deleted file mode 100644 (file)
index 3f063ac..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file checks.cpp
- *
- *  Main program that calls the individual tests. */
-
-/*
- *  GiNaC Copyright (C) 1999-2007 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <stdexcept>
-#include <time.h>
-
-#include "checks.h"
-
-int main()
-{
-       unsigned result = 0;
-       
-       srand((unsigned)time(NULL));
-
-#define CHECK(which) \
-try { \
-       for (int i=0; i<1; ++i) \
-               result += check_ ## which (); \
-} catch (const exception &e) { \
-       cout << "Error: caught exception " << e.what() << endl; \
-       ++result; \
-}
-       
-       CHECK(numeric)
-       CHECK(inifcns)
-       CHECK(matrices)
-       CHECK(lsolve)
-       
-       if (result) {
-               cout << "Error: something went wrong. ";
-               if (result == 1) {
-                       cout << "(one failure)" << endl;
-               } else {
-                       cout << "(" << result << " individual failures)" << endl;
-               }
-               cout << "please check checks.out against check.ref for more details."
-                    << endl << "happy debugging!" << endl;
-       }
-       
-       return result;
-}
diff --git a/check/checks.h b/check/checks.h
deleted file mode 100644 (file)
index 61e043f..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/** @file checks.h
- *
- *  Prototypes for all individual checks. */
-
-/*
- *  GiNaC Copyright (C) 1999-2007 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef CHECKS_H
-#define CHECKS_H
-
-#include <iostream>
-
-#include "config.h"
-#include "ginac.h"
-using namespace std;
-using namespace GiNaC;
-
-// prototypes for the expression generating functions in:
-const ex dense_univariate_poly(const symbol & x, unsigned degree);
-const ex dense_bivariate_poly(const symbol & x1, const symbol & x2,
-                              unsigned degree);
-const ex sparse_tree(const symbol & x, const symbol & y, const symbol & z,
-                     int level,
-                     bool trig = false, bool rational = true, bool complex = false);
-
-// prototypes for all individual checks should be unsigned fcn():
-unsigned check_numeric();
-unsigned check_inifcns();
-unsigned check_matrices();
-unsigned check_lsolve();
-
-#endif // ndef CHECKS_H
diff --git a/check/checks.ref b/check/checks.ref
deleted file mode 100644 (file)
index a109f51..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
----------consistency of numeric types:
-(no output)
----------consistency of symbolic functions:
-(no output)
----------symbolic matrix manipulations:
-(no output)
----------linear solve:
-(no output)
index a2e19c44d3dcc1f3c10cf82a100f35c37e53b645..0fcb6167975944ad696e132ffc36de2cefad94ab 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
-
+#include <iostream>
 #include <fstream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 unsigned exam_archive()
 {
        unsigned result = 0;
        
        cout << "examining archiving system" << flush;
-       clog << "----------archiving system:" << endl;
 
        symbol x("x"), y("y"), mu("mu"), dim("dim", "\\Delta");
        ex e, f;
@@ -70,14 +71,10 @@ unsigned exam_archive()
                ++result;
        }
 
-       cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_archive();
+}
index 006c07694a6595dcc634faddaaee7f9210833d14..4dbfacf94ef44e015c87024f0b9083fcdc750b92 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 const numeric half(1, 2);
 
@@ -539,7 +542,6 @@ unsigned exam_clifford()
        unsigned result = 0;
        
        cout << "examining clifford objects" << flush;
-       clog << "----------clifford objects:" << endl;
 
        result += clifford_check1(); cout << '.' << flush;
        result += clifford_check2(); cout << '.' << flush;
@@ -600,12 +602,10 @@ unsigned exam_clifford()
        result += clifford_check7(indexed(-2*minkmetric(), sy_symm(), xi, chi), dim); cout << '.' << flush;
        result += clifford_check7(-2*delta_tensor(xi, chi), dim); cout << '.' << flush;
 
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_clifford();
+}
index f2342a39f22582495f7cea586775fb1f02c04708..382f6d3f60d0887f89f2eb5ba71c053038f5d55a 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned check_equal(const ex &e1, const ex &e2)
 {
@@ -145,18 +148,15 @@ unsigned exam_color()
        unsigned result = 0;
        
        cout << "examining color objects" << flush;
-       clog << "----------color objects:" << endl;
 
        result += color_check1();  cout << '.' << flush;
        result += color_check2();  cout << '.' << flush;
        result += color_check3();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_color();
+}
index 1eb5dfcbc6df42cc3563a7b0e6926090f6549cc0..f2d6dbb31154fbf898b864feb9a9305fb9c86cf9 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned check_diff(const ex &e, const symbol &x,
                                                   const ex &d, unsigned nth=1)
@@ -260,7 +263,6 @@ unsigned exam_differentiation()
        unsigned result = 0;
        
        cout << "examining symbolic differentiation" << flush;
-       clog << "----------symbolic differentiation:" << endl;
        
        result += exam_differentiation1();  cout << '.' << flush;
        result += exam_differentiation2();  cout << '.' << flush;
@@ -270,11 +272,10 @@ unsigned exam_differentiation()
        result += exam_differentiation6();  cout << '.' << flush;
        result += exam_differentiation7();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_differentiation();
+}
index ae6a324a6411dbb19800273dc8d28d881e368038..289c2264af94759424b9dd9b8b7bbf979146c15a 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 unsigned exam_hashmap()
 {
@@ -28,7 +31,6 @@ unsigned exam_hashmap()
        unsigned N = 100;
 
        cout << "examining hash maps" << flush;
-       clog << "----------hash maps:" << endl;
 
        // Create empty container
        exhashmap<unsigned> M1;
@@ -279,15 +281,12 @@ unsigned exam_hashmap()
                clog << "count(4*x^y) returns " << n << " instead of 1" << endl;
                ++result;
        }
-
        cout << '.' << flush;
 
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_hashmap();
+}
index 06bdbaa4c7f1c25163bf9153fb982728e4a6c053..722f53f96a6785d9ddff5715fa0b854050ee07c3 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned check_equal(const ex &e1, const ex &e2)
 {
@@ -392,7 +395,6 @@ unsigned exam_indexed()
        unsigned result = 0;
        
        cout << "examining indexed objects" << flush;
-       clog << "----------indexed objects:" << endl;
 
        result += delta_check();  cout << '.' << flush;
        result += metric_check();  cout << '.' << flush;
@@ -403,12 +405,10 @@ unsigned exam_indexed()
        result += spinor_check(); cout << '.' << flush;
        result += dummy_check(); cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_indexed();
+}
index e0d595a85bfdd161cfe47626c7c2e389a32dc6c6..0b3c61451ee66095254ac7fd6ecb59d18eaa034a 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 /* Assorted tests on other transcendental functions. */
 static unsigned inifcns_consist_trans()
@@ -217,19 +220,16 @@ unsigned exam_inifcns()
        unsigned result = 0;
        
        cout << "examining consistency of symbolic functions" << flush;
-       clog << "----------consistency of symbolic functions:" << endl;
        
        result += inifcns_consist_trans();  cout << '.' << flush;
        result += inifcns_consist_gamma();  cout << '.' << flush;
        result += inifcns_consist_psi();  cout << '.' << flush;
        result += inifcns_consist_zeta();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_inifcns();
+}
index 68b11b4579169502eab168ddfdab2dfb69d1e9dc..86c1e4521ec2f99a74550fb8651901be158b54c3 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
-
+#include <iostream>
 #include <fstream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
+
 
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -292,19 +295,16 @@ unsigned exam_inifcns_nstdsums(void)
        unsigned result = 0;
        
        cout << "examining consistency of nestedsums functions" << flush;
-       clog << "----------consistency of nestedsums functions:" << endl;
        
        result += inifcns_test_zeta();
        result += inifcns_test_S();
        result += inifcns_test_HLi();
        result += inifcns_test_LiG();
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_inifcns_nstdsums();
+}
index 7df0fc40b4f2de84cc85361ccd3ac19ab9979753..67aae4e813c94c81d7ffa3747b895a9262f63339 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned exam_lsolve1()
 {
@@ -188,7 +191,6 @@ unsigned exam_lsolve()
        unsigned result = 0;
        
        cout << "examining linear solve" << flush;
-       clog << "----------linear solve:" << endl;
        
        result += exam_lsolve1();  cout << '.' << flush;
        result += exam_lsolve2a();  cout << '.' << flush;
@@ -197,12 +199,10 @@ unsigned exam_lsolve()
        result += exam_lsolve2S();  cout << '.' << flush;
        result += exam_lsolve3S();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_lsolve();
+}
index 88bc5816b602d1d78dcfda5a045d1f1aca0811e3..f4c84f973a96b88b1dcb4a37abc13e6b6b00b9dc 100644 (file)
  */
 
 #include <stdexcept>
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned matrix_determinants()
 {
@@ -337,7 +340,6 @@ unsigned exam_matrices()
        unsigned result = 0;
        
        cout << "examining symbolic matrix manipulations" << flush;
-       clog << "----------symbolic matrix manipulations:" << endl;
        
        result += matrix_determinants();  cout << '.' << flush;
        result += matrix_invert1();  cout << '.' << flush;
@@ -348,12 +350,10 @@ unsigned exam_matrices()
        result += matrix_rank();  cout << "." << flush;
        result += matrix_misc();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_matrices();
+}
index 29febf644e8cf47851c31334e3e82745d4d745de..13cb2f9a3395a06e51ff9acea051a35e3a6cfee9 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 #define VECSIZE 30
 static unsigned exam_expand_subs()
@@ -291,7 +293,6 @@ unsigned exam_misc()
        unsigned result = 0;
        
        cout << "examining miscellaneous other things" << flush;
-       clog << "----------miscellaneous other things:" << endl;
        
        result += exam_expand_subs();  cout << '.' << flush;
        result += exam_expand_subs2();  cout << '.' << flush;
@@ -302,12 +303,10 @@ unsigned exam_misc()
        result += exam_joris(); cout << '.' << flush;
        result += exam_subs_algebraic(); cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_misc();
+}
index 34176dd7bb1ef17136ae3cf91bc1e36d8e943763..7eb453116101f45383d98af08076fbe13e2baa85 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static symbol w("w"), x("x"), y("y"), z("z");
 
@@ -219,7 +222,6 @@ unsigned exam_normalization()
        unsigned result = 0;
        
        cout << "examining rational function normalization" << flush;
-       clog << "----------rational function normalization:" << endl;
        
        result += exam_normal1(); cout << '.' << flush;
        result += exam_normal2(); cout << '.' << flush;
@@ -227,12 +229,10 @@ unsigned exam_normalization()
        result += exam_normal4(); cout << '.' << flush;
        result += exam_content(); cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_normalization();
+}
index 5a916e92ca719807e6def979e51f8336fdf9e4b6..8f45dfedb47e273a612fbd1d0c99aac14a6b7dbe 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
-
+#include <iostream>
 #include <sstream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
+
 
 /* Simple and maybe somewhat pointless consistency tests of assorted tests and
  * conversions. */
@@ -378,7 +381,6 @@ unsigned exam_numeric()
        unsigned result = 0;
        
        cout << "examining consistency of numeric types" << flush;
-       clog << "----------consistency of numeric types:" << endl;
        
        result += exam_numeric1();  cout << '.' << flush;
        result += exam_numeric2();  cout << '.' << flush;
@@ -387,12 +389,10 @@ unsigned exam_numeric()
        result += exam_numeric5();  cout << '.' << flush;
        result += exam_numeric6();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_numeric();
+}
index 035235a5086df29230e0a02d6b4586c2e3d95526..003044e9a12805ab75b0a7333f2559b41d79226a 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 // The very first pair of historic problems had its roots in power.cpp and was
 // finally resolved on April 27th 1999. (Fixing the first on April 23rd
@@ -469,7 +472,6 @@ unsigned exam_paranoia()
        unsigned result = 0;
        
        cout << "examining several historic failures just out of paranoia" << flush;
-       clog << "----------several historic failures:" << endl;
        
        result += exam_paranoia1();  cout << '.' << flush;
        result += exam_paranoia2();  cout << '.' << flush;
@@ -489,12 +491,10 @@ unsigned exam_paranoia()
        result += exam_paranoia16();  cout << '.' << flush;
        result += exam_paranoia17();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_paranoia();
+}
index bb410f29458ac45398b9f01e9b4475906a3b49ff..ef90a36d0df5684fff01db6dfe6a7529b7bae575 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 const int MAX_VARIABLES = 3;
 
@@ -231,7 +234,6 @@ unsigned exam_polygcd()
        unsigned result = 0;
        
        cout << "examining polynomial GCD computation" << flush;
-       clog << "----------polynomial GCD computation:" << endl;
        
        result += poly_gcd1();  cout << '.' << flush;
        result += poly_gcd2();  cout << '.' << flush;
@@ -243,12 +245,10 @@ unsigned exam_polygcd()
        result += poly_gcd6();  cout << '.' << flush;
        result += poly_gcd7();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_polygcd();
+}
index 5af3c866d28dda62654dd57d553fb4593446b2c0..d84a0818443a8377e6f70de47a83173c47c38aa0 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned exam_powerlaws1()
 {
@@ -289,7 +292,6 @@ unsigned exam_powerlaws()
        unsigned result = 0;
        
        cout << "examining power laws" << flush;
-       clog << "----------power laws:" << endl;
        
        result += exam_powerlaws1();  cout << '.' << flush;
        result += exam_powerlaws2();  cout << '.' << flush;
@@ -297,12 +299,10 @@ unsigned exam_powerlaws()
        result += exam_powerlaws4();  cout << '.' << flush;
        result += exam_powerlaws5();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-       
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_powerlaws();
+}
index 2e5d2d6ef9e8e5f2b146022813108eb4db660d86..e24ef414790e31a36e704e38bbb989ad35084123 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 static symbol x("x");
 
@@ -367,7 +370,6 @@ unsigned exam_pseries()
        unsigned result = 0;
        
        cout << "examining series expansion" << flush;
-       clog << "----------series expansion:" << endl;
        
        result += exam_series1();  cout << '.' << flush;
        result += exam_series2();  cout << '.' << flush;
@@ -383,11 +385,10 @@ unsigned exam_pseries()
        result += exam_series12();  cout << '.' << flush;
        result += exam_series13();  cout << '.' << flush;
        
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_pseries();
+}
index 84de56babb267d73048d9fd9c4f09c908092edfa..b433600d9b81a158d81a01045879fe196ae0483b 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "exams.h"
+#include <iostream>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 
 struct sprod_s {
@@ -72,7 +75,6 @@ unsigned exam_structure()
        unsigned result = 0;
 
        cout << "examining structure template" << flush;
-       clog << "----------structure template:" << endl;
 
        symbol x("x"), y("y");
        ex e;
@@ -91,14 +93,10 @@ unsigned exam_structure()
                ++result;
        }
 
-       cout << '.' << flush;
-
-       if (!result) {
-               cout << " passed " << endl;
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed " << endl;
-       }
-
        return result;
 }
+
+int main(int argc, char** argv)
+{
+       return exam_structure();
+}
diff --git a/check/exams.cpp b/check/exams.cpp
deleted file mode 100644 (file)
index 4f669e5..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/** @file exams.cpp
- *
- *  Main program that calls all individual exams. */
-
-/*
- *  GiNaC Copyright (C) 1999-2007 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <stdexcept>
-
-#include "exams.h"
-
-int main()
-{
-       unsigned result = 0;
-
-#define EXAM(which) \
-try { \
-       result += exam_ ## which (); \
-} catch (const exception &e) { \
-       cout << "Error: caught exception " << e.what() << endl; \
-       ++result; \
-}
-       
-       EXAM(paranoia)
-       EXAM(numeric)
-       EXAM(powerlaws)
-       EXAM(inifcns)
-       EXAM(inifcns_nstdsums)
-       EXAM(differentiation)
-       EXAM(polygcd)
-       EXAM(normalization)
-       EXAM(pseries)
-       EXAM(matrices)
-       EXAM(lsolve)
-       EXAM(indexed)
-       EXAM(color)
-       EXAM(clifford)
-       EXAM(archive)
-       EXAM(structure)
-       EXAM(hashmap)
-       EXAM(misc)
-       
-       if (result) {
-               cout << "Error: something went wrong. ";
-               if (result == 1) {
-                       cout << "(one failure)" << endl;
-               } else {
-                       cout << "(" << result << " individual failures)" << endl;
-               }
-               cout << "please check exams.out against exams.ref for more details."
-                    << endl << "happy debugging!" << endl;
-       }
-       
-       return result;
-}
diff --git a/check/exams.h b/check/exams.h
deleted file mode 100644 (file)
index 8cac4fe..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/** @file exams.h
- *
- *  Prototypes for all individual exams. */
-
-/*
- *  GiNaC Copyright (C) 1999-2007 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef EXAMS_H
-#define EXAMS_H
-
-#include <iostream>
-#include "ginac.h"
-using namespace std;
-using namespace GiNaC;
-
-// prototypes for all individual checks should be unsigned fcn():
-unsigned exam_paranoia();
-unsigned exam_numeric();
-unsigned exam_powerlaws();
-unsigned exam_inifcns();
-unsigned exam_inifcns_nstdsums();
-unsigned exam_differentiation();
-unsigned exam_polygcd();
-unsigned exam_normalization();
-unsigned exam_pseries();
-unsigned exam_matrices();
-unsigned exam_lsolve();
-unsigned exam_indexed();
-unsigned exam_color();
-unsigned exam_clifford();
-unsigned exam_archive();
-unsigned exam_structure();
-unsigned exam_hashmap();
-unsigned exam_misc();
-
-#endif // ndef EXAMS_H
diff --git a/check/exams.ref b/check/exams.ref
deleted file mode 100644 (file)
index 016a9c2..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-----------several historic failures:
-(no output)
-----------consistency of numeric types:
-(no output)
-----------power laws:
-(no output)
-----------consistency of symbolic functions:
-(no output)
-----------consistency of nestedsums functions:
-(no output)
-----------symbolic differentiation:
-(no output)
-----------polynomial GCD computation:
-(no output)
-----------rational function normalization:
-(no output)
-----------series expansion:
-(no output)
-----------symbolic matrix manipulations:
-(no output)
-----------linear solve:
-(no output)
-----------indexed objects:
-(no output)
-----------color objects:
-(no output)
-----------clifford objects:
-(no output)
-----------archiving system:
-(no output)
-----------structure template:
-(no output)
-----------hash maps:
-(no output)
-----------miscellaneous other things:
-(no output)
diff --git a/check/randomize_serials.cpp b/check/randomize_serials.cpp
new file mode 100644 (file)
index 0000000..ad29a1b
--- /dev/null
@@ -0,0 +1,31 @@
+#include <cstdlib>
+#include <ctime>
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
+
+/** Generate a random amount of symbols and destroy them again immediatly.
+ *  This operation effectively makes the serial numbers of all subsequent
+ *  symbols unpredictable.  If the serials are unpredictable, then so are
+ *  their hash values.  If the hash values are unpredictable, then so are
+ *  the canonical orderings.  If the canonical orderings are unpredictable,
+ *  all subsequent times are subject to some variation.  This variation,
+ *  however is natural and desireable for two reasons: First, we cannot know
+ *  how many symbols have been generated before in real world computations.
+ *  Second, the following timings are subject to some semi-random variation
+ *  anyways because short timings need to be repeated until enough time has
+ *  gone by for the measurement to be reliable.  During this process the serial
+ *  numbers will be shifted anyways in a semi-random way.  It is better not
+ *  to lull the user in a false sense of reproducibility and instead confront
+ *  her with the normal variation to be expected.
+ */
+void randomify_symbol_serials()
+{
+       srand(time(NULL));
+       const int m = rand() % 666;
+       for (int s=0; s<m; ++s ) {
+               symbol("dummy");
+       }
+}
+
+
diff --git a/check/run_checks b/check/run_checks
deleted file mode 100755 (executable)
index 93b7706..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#! /bin/sh
-echo "GiNaC will now run through some rather costly random consistency checks:"
-./checks${EXEEXT} 2>checks.out
-cmp ${srcdir}/checks.ref checks.out
diff --git a/check/run_exams b/check/run_exams
deleted file mode 100755 (executable)
index 1e7ba46..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#! /bin/sh
-echo "GiNaC will now take an exam with specific input (like a pupils' exam):"
-./exams${EXEEXT} 2>exams.out
-cmp ${srcdir}/exams.ref exams.out
diff --git a/check/run_times b/check/run_times
deleted file mode 100755 (executable)
index eb2380b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#! /bin/sh
-echo "GiNaC will now run through some basic timings:"
-./times${EXEEXT} 2>times.out
-cmp ${srcdir}/times.ref times.out
index 67f410c7fa47e29f647815cfdcbc3c87b296d8ac..787dea2552faebdade02c50584f80cb0712feaf9 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
 #include <utility>
 #include <vector>
 #include <set>
 #include <map>
 #include <typeinfo>
 #include <stdexcept>
+#include "timer.h"
+#include "ginac.h"
+using namespace std;
+using namespace GiNaC;
 
 // whether to run this beast or not:
 static const bool do_test = true;
@@ -479,7 +482,6 @@ unsigned time_antipode()
        timer jaeger_le_coultre;
        
        cout << "timing computation of antipodes in Yukawa theory" << flush;
-       clog << "-------computation of antipodes in Yukawa theory:" << endl;
        
        if (do_test) {
                jaeger_le_coultre.start();
@@ -490,17 +492,18 @@ unsigned time_antipode()
                result += test_tree(tree5);  cout << '.' << flush;
                result += test_tree(tree6);  cout << '.' << flush;
                
-               if (!result) {
-                       cout << " passed ";
-                       clog << "(no output)" << endl;
-               } else {
-                       cout << " failed ";
-               }
                cout << jaeger_le_coultre.read() << "s (total)" << endl;
        } else {
                cout << " disabled" << endl;
-               clog << "(no output)" << endl;
        }
-       
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_antipode();
+}
index 3f6d6def19219000215f946698b1cd7fd69819f5..aca6e0e4271fe2dd8de647ee055fb796a9ef1966 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <sstream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned expand_subs(unsigned size)
 {
@@ -58,7 +64,6 @@ unsigned time_dennyfliegner()
        unsigned result = 0;
        
        cout << "timing commutative expansion and substitution" << flush;
-       clog << "-------commutative expansion and substitution:" << endl;
        
        vector<unsigned> sizes;
        vector<double> times;
@@ -76,12 +81,6 @@ unsigned time_dennyfliegner()
                cout << '.' << flush;
        }
        
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        // print the report:
        cout << endl << "       size:  ";
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
@@ -93,3 +92,12 @@ unsigned time_dennyfliegner()
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_dennyfliegner();
+}
index 904d6535576aec1cf493719d07b94fd2f132b6be..08590d29d3d4e1c078aaaeefe97503b036600d9d 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -50,7 +54,6 @@ unsigned time_fateman_expand()
        double time = .0;
 
        cout << "timing Fateman's polynomial expand benchmark" << flush;
-       clog << "-------Fateman's polynomial expand benchmark:" << endl;
 
        concord.start();
        // correct for very small times:
@@ -60,13 +63,16 @@ unsigned time_fateman_expand()
        } while ((time=concord.read())<0.1 && !result);
        cout << '.' << flush;
 
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
 
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_fateman_expand();
+}
index 3ff55d68dd120d1221b9fa593efb54655cace126..f3227878ea4aec498e5df08fae5bc0b5f6c5f726 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 unsigned tgammaseries(unsigned order)
 {
@@ -48,7 +53,6 @@ unsigned time_gammaseries()
        unsigned result = 0;
 
        cout << "timing Laurent series expansion of Gamma function" << flush;
-       clog << "-------Laurent series expansion of Gamma function:" << endl;
 
        vector<unsigned> sizes;
        vector<double> times;
@@ -66,12 +70,6 @@ unsigned time_gammaseries()
                cout << '.' << flush;
        }
 
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        // print the report:
        cout << endl << "       order: ";
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
@@ -83,3 +81,12 @@ unsigned time_gammaseries()
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_gammaseries();
+}
index 2bd2f1268a398fcf5844c391ca748e9f6ecc4967..cea635b8b411ab2409a62c85601296c9ebc83995 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 template <class T>
 static void run_timing(unsigned size, double &time_insert, double &time_find, double &time_erase)
@@ -67,7 +72,6 @@ unsigned time_hashmap()
        unsigned result = 0;
 
        cout << "timing hash map operations" << flush;
-       clog << "-------hash map operations:" << endl;
 
        unsigned s[] = {10000, 50000, 100000, 500000};
        vector<unsigned> sizes(s, s+sizeof(s)/sizeof(*s));
@@ -88,13 +92,6 @@ unsigned time_hashmap()
                cout << '.' << flush;
        }
 
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
-
        // print the report:
        cout << endl << "          size:\t";
        copy(sizes.begin(), sizes.end(), ostream_iterator<unsigned>(cout, "\t"));
@@ -108,3 +105,12 @@ unsigned time_hashmap()
 
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_hashmap();
+}
index 94450ebc0873386818cb02eb20474d7cbe43058e..d7fdc47f46c836442547e05464573f7e38a20754 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -44,7 +49,6 @@ unsigned time_lw_A()
        double time = .0;
        
        cout << "timing Lewis-Wester test A (divide factorials)" << flush;
-       clog << "-------Lewis-Wester test A (divide factorials):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -53,14 +57,16 @@ unsigned time_lw_A()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_A();
+}
index abf446eb5a037717bdd5c386e468c92aaa4a249f..396bdf800707a9c81df714aa62f5f68393865f38 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -45,7 +50,6 @@ unsigned time_lw_B()
        double time = .0;
        
        cout << "timing Lewis-Wester test B (sum of rational numbers)" << flush;
-       clog << "-------Lewis-Wester test B (sum of rational numbers):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -54,14 +58,15 @@ unsigned time_lw_B()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_B();
+}
index 07f0ebaa59336093ab2eee61bee2baa3445dfc97..e5e79f4613c66a7658e59ba9f230eacd65e3f9b5 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -49,7 +54,6 @@ unsigned time_lw_C()
        double time = .0;
        
        cout << "timing Lewis-Wester test C (gcd of big integers)" << flush;
-       clog << "-------Lewis-Wester test C (gcd of big integers):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -58,14 +62,16 @@ unsigned time_lw_C()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_C();
+}
index e3fa86d28c4264deac9fee691335cd29e989121b..8599151a798230e33c8d4dfe5ca3cdf8cb9c3f6f 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -49,7 +54,6 @@ unsigned time_lw_D()
        double time = .0;
        
        cout << "timing Lewis-Wester test D (normalized sum of rational fcns)" << flush;
-       clog << "-------Lewis-Wester test D (normalized sum of rational fcns):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -58,14 +62,16 @@ unsigned time_lw_D()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_D();
+}
index c50cc297cb919b897e045efcb3d8b4d8a9f45824..c0b52128167d37b1feb7ca517c6c1099073729ad 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -49,7 +54,6 @@ unsigned time_lw_E()
        double time = .0;
        
        cout << "timing Lewis-Wester test E (normalized sum of rational fcns)" << flush;
-       clog << "-------Lewis-Wester test E (normalized sum of rational fcns):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -58,14 +62,16 @@ unsigned time_lw_E()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_E();
+}
index 31366f696b0f804595e513b0c74ed5d8c13b5e2a..33fbc3ca0dbac736415ed330009b4e43021110ad 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -46,7 +51,6 @@ unsigned time_lw_F()
        double time = .0;
        
        cout << "timing Lewis-Wester test F (gcd of 2-var polys)" << flush;
-       clog << "-------Lewis-Wester test F (gcd of 2-var polys):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -55,14 +59,16 @@ unsigned time_lw_F()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_F();
+}
index a752d521f8ffe65b6b419903fdaa272caf32d279..1295a2d1c3eb5aa536e0e1a3266b05db45065c33 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -49,7 +54,6 @@ unsigned time_lw_G()
        double time = .0;
        
        cout << "timing Lewis-Wester test G (gcd of 3-var polys)" << flush;
-       clog << "-------Lewis-Wester test G (gcd of 3-var polys):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -58,14 +62,16 @@ unsigned time_lw_G()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_G();
+}
index d17b729876833561c33758e75565428efb034930..afbb48beae840d5c795e284c587c575127136ea5 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test(unsigned n)
 {
@@ -61,7 +66,6 @@ unsigned time_lw_H()
        double time = .0;
 
        cout << "timing Lewis-Wester test H (det of 80x80 Hilbert)" << flush;
-       clog << "-------Lewis-Wester test H (det of 80x80 Hilbert):" << endl;
 
        rolex.start();
        // correct for very small times:
@@ -70,14 +74,16 @@ unsigned time_lw_H()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
 
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_H();
+}
index 7271fe0d8e3b42dc7b70b0437c3b32377b15d728..2ad74d8ce6b5ec5983a5beafd0128a2396c16373 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test(unsigned n)
 {
@@ -31,8 +36,6 @@ static unsigned test(unsigned n)
        
        cout << "timing Lewis-Wester test " << name
             << " (invert rank " << n << " Hilbert)" << flush;
-       clog << "-------Lewis-Wester test " << name
-            << " (invert rank " << n << " Hilbert):" << endl;
        
        // Create a rank n Hilbert matrix:
        matrix H(n,n);
@@ -44,7 +47,6 @@ static unsigned test(unsigned n)
        matrix Hinv(n,n);
        Hinv = H.inverse();
        cout << ". passed ";
-       clog << "(no output)" << endl;
        cout << cartier.read() << 's' << endl;
        
        // check result:
@@ -52,8 +54,6 @@ static unsigned test(unsigned n)
        
        cout << "timing Lewis-Wester test " << name
             << " (check rank " << n << " Hilbert)" << flush;
-       clog << "-------Lewis-Wester test " << name
-            << " (check rank " << n << " Hilbert):" << endl;
        
        cartier.reset();
        matrix identity = H.mul(Hinv);
@@ -68,13 +68,8 @@ static unsigned test(unsigned n)
                                        correct = false;
                        }
                }
-       if (correct) {
-               cout << ". passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << ". failed ";
+       if (!correct)
                ++result;
-       }
        cout << cartier.read() << 's' << endl;
        return result;
 }
@@ -90,3 +85,12 @@ unsigned time_lw_IJKL()
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_IJKL();
+}
index d32603c2fd1800f0daf81cb9981155fd021e573f..f68ddc74c42312b5c67e57fc96c6631ee0dc2f2f 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -81,7 +85,6 @@ unsigned time_lw_M1()
        double time = .0;
        
        cout << "timing Lewis-Wester test M1 (26x26 sparse, det)" << flush;
-       clog << "-------Lewis-Wester test M1 (26x26 sparse, det):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -90,14 +93,16 @@ unsigned time_lw_M1()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_M1();
+}
index f9ab77540baef72b2aca49bc049a37d8026af732..e133378ae78a2e4b2f8fc468246b268b6ff7e421 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static const bool do_test = false;  // set to true in order to run this beast
 
@@ -157,7 +161,6 @@ unsigned time_lw_M2()
        double time = .0;
        
        cout << "timing Lewis-Wester test M2 (101x101 sparse, det)" << flush;
-       clog << "-------Lewis-Wester test M2 (101x101 sparse, det):" << endl;
        
        if (do_test) {
                piaget.start();
@@ -167,18 +170,19 @@ unsigned time_lw_M2()
                        ++count;
                } while ((time=piaget.read())<0.1 && !result);
                cout << '.' << flush;
-               
-               if (!result) {
-                       cout << " passed ";
-                       clog << "(no output)" << endl;
-               } else {
-                       cout << " failed ";
-               }
                cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
-               clog << "(no output)" << endl;
        }
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_M2();
+}
index 27bb9f7b2bfddbea30dce18f6f700a3aa1ba152b..d6e96b198a3406bd21e6da2a4d3d70510dd08dfe 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static const bool do_test = false;  // set to true in order to run this beast
 
@@ -60,7 +65,6 @@ unsigned time_lw_N()
        double time = .0;
        
        cout << "timing Lewis-Wester test N (poly at rational fcns)" << flush;
-       clog << "-------Lewis-Wester test N (poly at rational fcns):" << endl;
        
        if (do_test) {
                tag_heuer.start();
@@ -70,18 +74,19 @@ unsigned time_lw_N()
                        ++count;
                } while ((time=tag_heuer.read())<0.1 && !result);
                cout << '.' << flush;
-               
-               if (!result) {
-                       cout << " passed ";
-                       clog << "(no output)" << endl;
-               } else {
-                       cout << " failed ";
-               }
                cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
-               clog << "(no output)" << endl;
        }
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_N();
+}
index 4bf31e9199ce39c39c1e4acc7de545665ff237d4..f2a6094fe8b910b520ae8bde3fdbfc559f53a28e 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static const bool do_test2 = false;  // set to true in order to run this beast
 
@@ -133,7 +138,6 @@ unsigned time_lw_O()
        double time = .0;
 
        cout << "timing Lewis-Wester test O1 (three 15x15 dets)" << flush;
-       clog << "-------Lewis-Wester test O1 (three 15x15 dets):" << endl;
 
        rolex.start();
        // correct for very small times:
@@ -142,32 +146,30 @@ unsigned time_lw_O()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
 
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
+       if (result)
+               return result;
+       
        cout << time/(3*count) << "s (average)" << endl;
 
        cout << "timing Lewis-Wester test O2 (Resultant)" << flush;
-       clog << "-------Lewis-Wester test O2 (Resultant):" << endl;
 
        if (do_test2) {
                rolex.reset();
                result += test_O2();
 
-               if (!result) {
-                       cout << " passed ";
-                       clog << "(no output)" << endl;
-               } else {
-                       cout << " failed ";
-               }
                cout << rolex.read() << "s (combined)" << endl;
        } else {
                cout << " disabled" << endl;
-               clog << "(no output)" << endl;
        }
 
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_O();
+}
index c95bbe2a7fa4839b82cc9c7b70b6370320323420..d04e11aa8c005914640d2b243c36329e78c0b56b 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -59,7 +64,6 @@ unsigned time_lw_P()
        double time = .0;
        
        cout << "timing Lewis-Wester test P (det of sparse rank 101)" << flush;
-       clog << "-------Lewis-Wester test P (det of sparse rank 101):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -67,15 +71,16 @@ unsigned time_lw_P()
                result = test();
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
-       cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_P();
+}
index 5174efc05db520aedee0b007bcc57dae5f35cf27..4c7e587b23779048831e768e1089e2550de33d04 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned test()
 {
@@ -72,7 +77,6 @@ unsigned time_lw_Pprime()
        double time = .0;
        
        cout << "timing Lewis-Wester test P' (det of less sparse rank 101)" << flush;
-       clog << "-------Lewis-Wester test P' (det of less sparse rank 101):" << endl;
        
        rolex.start();
        // correct for very small times:
@@ -81,14 +85,16 @@ unsigned time_lw_Pprime()
                ++count;
        } while ((time=rolex.read())<0.1 && !result);
        cout << '.' << flush;
-       
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        cout << time/count << 's' << endl;
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_Pprime();
+}
index e506a35548ff95ba4ddf193204e1c2b854bf41f3..1236dec70b8e32980c060e6425518849b99b3830 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static const bool do_test = true;  // set to true in order to run this beast
 
@@ -62,7 +67,6 @@ unsigned time_lw_Q()
        double time = .0;
        
        cout << "timing Lewis-Wester test Q (charpoly(P))" << flush;
-       clog << "-------Lewis-Wester test Q (charpoly(P)):" << endl;
        
        if (do_test) {
                rolex.start();
@@ -72,18 +76,19 @@ unsigned time_lw_Q()
                        ++count;
                } while ((time=rolex.read())<0.1 && !result);
                cout << '.' << flush;
-               
-               if (!result) {
-                       cout << " passed ";
-                       clog << "(no output)" << endl;
-               } else {
-                       cout << " failed ";
-               }
                cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
-               clog << "(no output)" << endl;
        }
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_Q();
+}
index 643741200dc446d0f6a4fdf63460a15c7e6a867f..0046dde998d87a695aa38b5ca7aea1b4c5fba383 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static const bool do_test = true;  // set to true in order to run this beast
 
@@ -74,7 +79,6 @@ unsigned time_lw_Qprime()
        double time = .0;
        
        cout << "timing Lewis-Wester test Q' (charpoly(P'))" << flush;
-       clog << "-------Lewis-Wester test Q' (charpoly(P')):" << endl;
        
        if (do_test) {
                rolex.start();
@@ -84,18 +88,19 @@ unsigned time_lw_Qprime()
                        ++count;
                } while ((time=rolex.read())<0.1 && !result);
                cout << '.' << flush;
-               
-               if (!result) {
-                       cout << " passed ";
-                       clog << "(no output)" << endl;
-               } else {
-                       cout << " failed ";
-               }
                cout << time/count << 's' << endl;
        } else {
                cout << " disabled" << endl;
-               clog << "(no output)" << endl;
        }
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_lw_Qprime();
+}
index 9bf569ab7d6b35ad7c8f00a5a7b080aaf90b094b..2b27e90bb75fde44914d81e7c4d94af73241af2b 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned toeplitz_det(unsigned size)
 {
@@ -69,7 +74,6 @@ unsigned time_toeplitz()
        unsigned result = 0;
 
        cout << "timing determinant of polyvariate symbolic Toeplitz matrices" << flush;
-       clog << "-------determinant of polyvariate symbolic Toeplitz matrices:" << endl;
 
        vector<unsigned> sizes;
        vector<double> times;
@@ -93,12 +97,6 @@ unsigned time_toeplitz()
                cout << '.' << flush;
        }
 
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        // print the report:
        cout << endl << "       dim:   ";
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
@@ -110,3 +108,12 @@ unsigned time_toeplitz()
 
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_toeplitz();
+}
index fccc1392ab6ee74504344a3dc0f775ea33f1c4d3..1caaa407448097dec43930eb3240dcb41f0321c9 100644 (file)
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include "times.h"
+#include <iostream>
+#include <vector>
+#include "ginac.h"
+#include "timer.h"
+using namespace std;
+using namespace GiNaC;
 
 static unsigned vandermonde_det(unsigned size)
 {
@@ -66,7 +71,6 @@ unsigned time_vandermonde()
        unsigned result = 0;
        
        cout << "timing determinant of univariate symbolic Vandermonde matrices" << flush;
-       clog << "-------determinant of univariate symbolic Vandermonde matrices:" << endl;
        
        vector<unsigned> sizes;
        vector<double> times;
@@ -90,12 +94,6 @@ unsigned time_vandermonde()
                cout << '.' << flush;
        }
        
-       if (!result) {
-               cout << " passed ";
-               clog << "(no output)" << endl;
-       } else {
-               cout << " failed ";
-       }
        // print the report:
        cout << endl << "       dim:   ";
        for (vector<unsigned>::iterator i=sizes.begin(); i!=sizes.end(); ++i)
@@ -107,3 +105,12 @@ unsigned time_vandermonde()
        
        return result;
 }
+
+extern void randomify_symbol_serials();
+
+int main(int argc, char** argv)
+{
+       randomify_symbol_serials();
+       cout << setprecision(2) << showpoint;
+       return time_vandermonde();
+}
diff --git a/check/times.cpp b/check/times.cpp
deleted file mode 100644 (file)
index b825543..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-/** @file times.cpp
- *
- *  Main program that calls the individual timings. */
-
-/*
- *  GiNaC Copyright (C) 1999-2007 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include <stdexcept>
-#include "times.h"
-
-/** Generate a random amount of symbols and destroy them again immediatly.
- *  This operation effectively makes the serial numbers of all subsequent
- *  symbols unpredictable.  If the serials are unpredictable, then so are
- *  their hash values.  If the hash values are unpredictable, then so are
- *  the canonical orderings.  If the canonical orderings are unpredictable,
- *  all subsequent times are subject to some variation.  This variation,
- *  however is natural and desireable for two reasons: First, we cannot know
- *  how many symbols have been generated before in real world computations.
- *  Second, the following timings are subject to some semi-random variation
- *  anyways because short timings need to be repeated until enough time has
- *  gone by for the measurement to be reliable.  During this process the serial
- *  numbers will be shifted anyways in a semi-random way.  It is better not
- *  to lull the user in a false sense of reproducibility and instead confront
- *  her with the normal variation to be expected.
- */
-void randomify_symbol_serials()
-{
-       srand(time(NULL));
-       const int m = rand() % 666;
-       for (int s=0; s<m; ++s ) {
-               symbol("dummy");
-       }
-}
-
-int main()
-{
-       randomify_symbol_serials();
-
-       unsigned result = 0;
-
-       // For all timings:
-       cout << setprecision(2) << showpoint;
-       
-#define TIME(which) \
-try { \
-       result += time_ ## which (); \
-} catch (const exception &e) { \
-       cout << "Error: caught exception " << e.what() << endl; \
-       ++result; \
-}
-
-       TIME(dennyfliegner)
-       TIME(gammaseries)
-       TIME(vandermonde)
-       TIME(toeplitz)
-       TIME(hashmap)
-       TIME(lw_A)
-       TIME(lw_B)
-       TIME(lw_C)
-       TIME(lw_D)
-       TIME(lw_E)
-       TIME(lw_F)
-       TIME(lw_G)
-       TIME(lw_H)
-       TIME(lw_IJKL)
-       TIME(lw_M1)
-       TIME(lw_M2)
-       TIME(lw_N)
-       TIME(lw_O)
-       TIME(lw_P)
-       TIME(lw_Pprime)
-       TIME(lw_Q)
-       TIME(lw_Qprime)
-       TIME(antipode)
-       TIME(fateman_expand)
-       
-       if (result) {
-               cout << "Error: something went wrong. ";
-               if (result == 1) {
-                       cout << "(one failure)" << endl;
-               } else {
-                       cout << "(" << result << " individual failures)" << endl;
-               }
-               cout << "please check times.out against times.ref for more details."
-                    << endl << "happy debugging!" << endl;
-       }
-       
-       return result;
-}
diff --git a/check/times.h b/check/times.h
deleted file mode 100644 (file)
index 40b1340..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/** @file times.h
- *
- *  Prototypes for all individual timings. */
-
-/*
- *  GiNaC Copyright (C) 1999-2007 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
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#ifndef CHECKS_H
-#define CHECKS_H
-
-#include <cstdlib>
-#include <iostream>
-#include <sstream>
-#include <vector>
-#include "config.h"
-#include "ginac.h"
-using namespace std;
-using namespace GiNaC;
-
-#include "timer.h"
-
-// prototypes for all individual timings should be unsigned fcn():
-unsigned time_dennyfliegner();
-unsigned time_gammaseries();
-unsigned time_vandermonde();
-unsigned time_toeplitz();
-unsigned time_hashmap();
-unsigned time_lw_A();
-unsigned time_lw_B();
-unsigned time_lw_C();
-unsigned time_lw_D();
-unsigned time_lw_E();
-unsigned time_lw_F();
-unsigned time_lw_G();
-unsigned time_lw_H();
-unsigned time_lw_IJKL();
-unsigned time_lw_M1();
-unsigned time_lw_M2();
-unsigned time_lw_N();
-unsigned time_lw_O();
-unsigned time_lw_P();
-unsigned time_lw_Pprime();
-unsigned time_lw_Q();
-unsigned time_lw_Qprime();
-unsigned time_antipode();
-unsigned time_fateman_expand();
-
-#endif // ndef CHECKS_H
diff --git a/check/times.ref b/check/times.ref
deleted file mode 100644 (file)
index 08e9b39..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
--------commutative expansion and substitution:
-(no output)
--------Laurent series expansion of Gamma function:
-(no output)
--------determinant of univariate symbolic Vandermonde matrices:
-(no output)
--------determinant of polyvariate symbolic Toeplitz matrices:
-(no output)
--------hash map operations:
-(no output)
--------Lewis-Wester test A (divide factorials):
-(no output)
--------Lewis-Wester test B (sum of rational numbers):
-(no output)
--------Lewis-Wester test C (gcd of big integers):
-(no output)
--------Lewis-Wester test D (normalized sum of rational fcns):
-(no output)
--------Lewis-Wester test E (normalized sum of rational fcns):
-(no output)
--------Lewis-Wester test F (gcd of 2-var polys):
-(no output)
--------Lewis-Wester test G (gcd of 3-var polys):
-(no output)
--------Lewis-Wester test H (det of 80x80 Hilbert):
-(no output)
--------Lewis-Wester test I (invert rank 40 Hilbert):
-(no output)
--------Lewis-Wester test J (check rank 40 Hilbert):
-(no output)
--------Lewis-Wester test K (invert rank 70 Hilbert):
-(no output)
--------Lewis-Wester test L (check rank 70 Hilbert):
-(no output)
--------Lewis-Wester test M1 (26x26 sparse, det):
-(no output)
--------Lewis-Wester test M2 (101x101 sparse, det):
-(no output)
--------Lewis-Wester test N (poly at rational fcns):
-(no output)
--------Lewis-Wester test O1 (three 15x15 dets):
-(no output)
--------Lewis-Wester test O2 (Resultant):
-(no output)
--------Lewis-Wester test P (det of sparse rank 101):
-(no output)
--------Lewis-Wester test P' (det of less sparse rank 101):
-(no output)
--------Lewis-Wester test Q (charpoly(P)):
-(no output)
--------Lewis-Wester test Q' (charpoly(P')):
-(no output)
--------computation of antipodes in Yukawa theory:
-(no output)
--------Fateman's polynomial expand benchmark:
-(no output)