From: Christian Bauer Date: Fri, 1 Jun 2001 22:46:02 +0000 (+0000) Subject: added test for evalm() X-Git-Tag: release_0-9-0~22 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=e39e83acafe16854ac052f3e3dca25943a4083a8;hp=c8e2c9967b23aac88c91771dac5d1f5f04589f18 added test for evalm() --- diff --git a/check/exam_matrices.cpp b/check/exam_matrices.cpp index 9e8d90c7..cf764926 100644 --- a/check/exam_matrices.cpp +++ b/check/exam_matrices.cpp @@ -216,6 +216,31 @@ static unsigned matrix_solve2(void) return result; } +static unsigned matrix_evalm(void) +{ + unsigned result = 0; + + matrix S(2, 2, lst( + 1, 2, + 3, 4 + )), T(2, 2, lst( + 1, 1, + 2, -1 + )), R(2, 2, lst( + 27, 14, + 36, 26 + )); + + ex e = ((S + T) * (S + 2*T)); + ex f = e.evalm(); + if (!f.is_equal(R)) { + clog << "Evaluating " << e << " erroneously returned " << f << " instead of " << R << endl; + result++; + } + + return result; +} + static unsigned matrix_misc(void) { unsigned result = 0; @@ -279,6 +304,7 @@ unsigned exam_matrices(void) result += matrix_invert2(); cout << '.' << flush; result += matrix_invert3(); cout << '.' << flush; result += matrix_solve2(); cout << '.' << flush; + result += matrix_evalm(); cout << "." << flush; result += matrix_misc(); cout << '.' << flush; if (!result) {