[Scilab-Dev] eigs woes

Guillaume Horel guillaume.horel at gmail.com
Mon Nov 26 05:53:22 CET 2012


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.

It's a boundary problem for the helmholtz equation:
http://bpaste.net/show/60377/

On scilab-5.4.0, the code fails with the following error message:

eigs: Impossible to invert complex sparse matrix.
at line     333 of function speigs called by :
at line     112 of function eigs called by :
[D V] = eigs(A, [], M2,'SM');
at line      54 of exec file called by :
exec('/home/guillaume/test-eigs.sce', -1)

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?
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: http://bpaste.net/show/60375/

I still have two questions:
- 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.
- 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?

Thanks for your insights,
Guillaume
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20121125/4d8f269b/attachment.htm>


More information about the dev mailing list