Dmitry, I confirm I get the same error using the matrix transpose. I will log this in the bug tracker, since it might take me some time to diagnose and fix the problem. In the meantime, perhaps you can use the non-transposed matrix, since A and A^T have the same eigenvalues.
Patrick On 12/29/20 3:15 PM, Dmitry Cheshkov wrote: > Dear Patrick, > > I'm also using gsl 2.6. And the difference between your code and my is > that I'm filled the matrix in transposed form. Then I tried to > calculate eigenvalues for transposed matrix by your code, the error > come back. > > Try to calculate eigenvalues of the folowing matrices by your code: > > const double data[] = { > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 2, 0, 2, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 3, 0, 0, 0, > 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 3, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 2, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 1, 0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 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, > 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; > > Wolfram Mathematica: > In[4]:= Eigenvalues[data] > Out[4]= {-9, -9, -9, -9, 9, 9, 9, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} > > > With best regards, > Dmitry Cheshkov > > 29.12.2020 20:11, Patrick Alken пишет: >> Dear Dmitry, >> >> I successfully found the eigenvalues of your matrix using GSL 2.6 >> (see >> attached code). The output of the program is: >> >> --- >> $ ./eig >> eval[1] = 0.000000000000e+00 + i 0.000000000000e+00 >> eval[2] = 0.000000000000e+00 + i 0.000000000000e+00 >> eval[3] = 0.000000000000e+00 + i 0.000000000000e+00 >> eval[4] = 4.300443739734e-16 + i 0.000000000000e+00 >> eval[5] = -6.000000000000e+00 + i 0.000000000000e+00 >> eval[6] = 6.000000000000e+00 + i 0.000000000000e+00 >> eval[7] = 6.000000000000e+00 + i 0.000000000000e+00 >> eval[8] = -6.000000000000e+00 + i 0.000000000000e+00 >> eval[9] = 5.377642775528e-17 + i 0.000000000000e+00 >> eval[10] = 3.000000000000e+00 + i 0.000000000000e+00 >> eval[11] = -3.000000000000e+00 + i 0.000000000000e+00 >> eval[12] = 6.000000000000e+00 + i 0.000000000000e+00 >> eval[13] = -6.000000000000e+00 + i 0.000000000000e+00 >> eval[14] = 3.000000000000e+00 + i 0.000000000000e+00 >> eval[15] = -2.912706738243e-16 + i 0.000000000000e+00 >> eval[16] = 6.000000000000e+00 + i 0.000000000000e+00 >> eval[17] = -6.000000000000e+00 + i 0.000000000000e+00 >> eval[18] = -3.000000000000e+00 + i 0.000000000000e+00 >> --- >> >> Can you clarify which version of GSL you are using? Also you might want >> to print out your matrix m to make sure it is initialized correctly. I >> did not try to debug your code. >> >> Best, >> Patrick >> >> On 12/29/20 7:44 AM, Dmitry Cheshkov wrote: >>> Dear Sirs! >>> >>> I have to calculate the eigenvalues of the following 18x18 real >>> non-symmetric square matrix: >>> >>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 >>> 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 >>> 0 0 0 0 0 0 0 0 0 0 0 0 2 0 1 0 0 0 >>> 0 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 3 >>> 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 6 0 >>> 0 0 0 0 0 0 0 0 0 6 0 3 0 0 0 6 0 3 >>> 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 0 0 0 >>> 0 0 0 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 >>> 0 0 0 0 0 0 0 0 0 0 0 0 4 0 2 0 0 0 >>> 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 >>> 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 >>> 0 0 0 2 0 1 0 0 0 0 0 0 0 0 0 0 0 0 >>> 0 0 3 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 >>> 0 6 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 >>> 6 0 3 0 0 0 6 0 3 0 0 0 0 0 0 0 0 0 >>> 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 0 0 >>> 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 0 0 0 >>> 0 0 0 4 0 2 0 0 0 0 0 0 0 0 0 0 0 0 > >>> With best regards, >>> Dmitry Cheshkov