/* http://www.physics.oregonstate.edu/~rubin/nacphy/lapack/codes/linear-c.html */ /* solving the matrix equation A*x=b using LAPACK */ #include #define size 3 /* dimension of matrix */ struct complex {double re; double im;}; /* a complex number */ void test_zgeev() { /* finding the eigenvalues of a complex matrix */ struct complex A[3][3], b[3], DUMMY[1][1], WORK[6]; double AT[2*size*size]; /* for transformed matrix */ int i, j, ok, c1, c2, c3; char c4; A[0][0].re=3.1;A[0][0].im=-1.8; /* the input matrix */ A[0][1].re=1.3;A[0][1].im=0.2; A[0][2].re=-5.7;A[0][2].im=-4.3; A[1][0].re=1.0;A[1][0].im=0; A[1][1].re=-6.9;A[1][1].im=3.2; A[1][2].re=5.8;A[1][2].im=2.2; A[2][0].re=3.4;A[2][0].im=-4; A[2][1].re=7.2;A[2][1].im=2.9; A[2][2].re=-8.8;A[2][2].im=3.2; for (i=0; i=2*order of A, dimension of WORK workspace array dim=2*order of A, return value */ if (ok==0) /* output of eigenvalues */ { for (i=0; i