Fixes a bug in plotdf: When one of the points in the arrows grid happened
[maxima.git] / tests / rtest_lapack.mac
blob4c30a0a0c7ecdac012104a466ecdaeb168ebd0d5
1 /* Tests for LAPACK routines */
3 /* Square test matrix */
4 a:matrix([.35,.45,-.14,-.17],[.09,.07,-.54,.35],[-.44,-.33,-.03,.17],[.25,-.32,-.13,.11]);
5 matrix([.35,.45,-.14,-.17],[.09,.07,-.54,.35],[-.44,-.33,-.03,.17],[.25,-.32,-.13,.11]);
7 /* Test dlange (matrix norms) */
8 dlange('max,a);
9 0.54;
11 dlange('one_norm,a);
12 1.17;
14 dlange('inf_norm,a);
15 1.11;
17 is(abs(dlange('frobenius,a)-1.151868047998554) < 1e-10);
18 true;
20 /* Test dgeev */
21 (res:dgeev(a,true),0);
24 is(zlange('inf_norm, matrix(res[1])-matrix([.79948,-.099412+%i*.40079,-.099412-%i*.40079,-.10066]))<1e-4);
25 true;
27 (eig:transpose(matrix([-.65509,-.52363,.53622,-.095607],
28                       [-.19330+%i*.25463, .25186-%i*.52240, .097182-%i*.30838, .67595],
29                       [-.19330-%i*.25463, .25186+%i*.52240, .097182+%i*.30838, .67595],
30                       [ .12533, .33202, .59384, .72209]))
31  ,0);
34 is(zlange('one_norm, res[2]-eig) < 5e-5);
35 true;
37 /* SF bug # 2634: "zgeev does not operate on real matrices" */
39 zgeev (matrix ([1, 0], [0, 1]), true, false);
40 [[1.0,1.0],matrix([1.0,0.0],[0.0,1.0]),false];