This is a rather long email about my fight with the eigs function in scilab. It might be better suited for a bug report, but I wanted to try out this list first.<br><br>It's a boundary problem for the helmholtz equation:<br>

<a href="http://bpaste.net/show/60377/">http://bpaste.net/show/60377/</a><br><br>On scilab-5.4.0, the code fails with the following error message:<br><br>eigs: Impossible to invert complex sparse matrix.<br>at line     333 of function speigs called by :  <br>

at line     112 of function eigs called by :  <br>[D V] = eigs(A, [], M2,'SM');<br>at line      54 of exec file called by :    <br>exec('/home/guillaume/test-eigs.sce', -1)<br><br>In the code of the eigs function, it turns out that there is a test to check if the factors of the LU decomposition of A-sigma I are complex (which is the majority of cases if you start from a complex matrix), and the code fails with this error. Is there any reason to have such a test in there?<br>

I also realized that the code was computing the inverse by actually calling inv(L) and inv(U), which completely defeats the purpose of doing a LU decomposition. Long story short, the following patch fixes the two aforementionned issues: <a href="http://bpaste.net/show/60375/">http://bpaste.net/show/60375/</a><br>

<br>I still have two questions:<br>- I'm still unsure about why the code needs two different lu solvers: lufact and mf_lufact. Unless lufact is really faster than umf_lufact for real numbers, I think that just using umf_lufact should be enough and would further simplify the code.<br>

- after applying this patch scilab computes my eigenfunctions fine. However the performance is pretty disappointing. On my laptop, scilab takes around 15s to compute 100 eigenvalues, but on the same machine octave takes less than 3s. I checked the octave eigs function and it's all written in C. However I would think the computation time is dominated by the calls to the various arpack functions and lu solvers rather than all the plumbing, but maybe I'm wrong... Any thoughts?<br>

<br>Thanks for your insights,<br>Guillaume<br>