exams_SOURCES = exam_paranoia.cpp exam_numeric.cpp exam_powerlaws.cpp \
exam_inifcns.cpp exam_differentiation.cpp exam_polygcd.cpp \
exam_normalization.cpp exam_pseries.cpp exam_matrices.cpp exam_lsolve.cpp \
- exam_indexed.cpp exam_misc.cpp exams.cpp exams.h
+ exam_indexed.cpp exam_color.cpp exam_misc.cpp exams.cpp exams.h
exams_LDADD = ../ginac/libginac.la
times_SOURCES = time_dennyfliegner.cpp time_gammaseries.cpp \
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; \
+}
- try {
- for (int i=0; i<1; ++i)
- result += check_numeric();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- for (int i=0; i<1; ++i)
- result += check_inifcns();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- for (int i=0; i<1; ++i)
- result += check_matrices();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- for (int i=0; i<1; ++i)
- result += check_lsolve();
- } 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. ";
int main()
{
unsigned result = 0;
+
+#define EXAM(which) \
+try { \
+ result += exam_ ## which (); \
+} catch (const exception &e) { \
+ cout << "Error: caught exception " << e.what() << endl; \
+ ++result; \
+}
- try {
- result += exam_paranoia();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_numeric();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_powerlaws();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_inifcns();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_differentiation();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_polygcd();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_normalization();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_pseries();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_matrices();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_lsolve();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_indexed();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += exam_misc();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
+ EXAM(paranoia)
+ EXAM(numeric)
+ EXAM(powerlaws)
+ EXAM(inifcns)
+ EXAM(differentiation)
+ EXAM(polygcd)
+ EXAM(normalization)
+ EXAM(pseries)
+ EXAM(matrices)
+ EXAM(lsolve)
+ EXAM(indexed)
+ EXAM(color)
+ EXAM(misc)
if (result) {
cout << "Error: something went wrong. ";
unsigned exam_matrices();
unsigned exam_lsolve();
unsigned exam_indexed();
+unsigned exam_color();
unsigned exam_misc();
#endif // ndef EXAMS_H
(no output)
----------indexed objects:
(no output)
+----------color objects:
+(no output)
----------miscellaneous other things:
(no output)
{
unsigned result = 0;
- try {
- result += time_dennyfliegner();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_gammaseries();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_vandermonde();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_toeplitz();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_A();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_B();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_C();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_D();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_E();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_F();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_G();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_H();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_IJKL();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_M1();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_M2();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_N();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_O();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_P();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_Pprime();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_Q();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_lw_Qprime();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
-
- try {
- result += time_antipode();
- } catch (const exception &e) {
- cout << "Error: caught exception " << e.what() << endl;
- ++result;
- }
+#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(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)
if (result) {
cout << "Error: something went wrong. ";