Reputation: 39
I need to solve a large system of (573 or more) equations which has the form (A0-A1*t)*x=b
where A0,A1
are matrices t
is a real number and x,b
are vectors. I have used both Lapack's dgesv
and MUMPS to solve this for a range of values of t
and both solvers fail for some values of t
but not for the same. If the step of t
is made sufficiently small (1.0e-6
) both solvers show clearly defined regions where they can solve or not, but they do not agree on them.
The error both solvers report is that the matrix is singular when they fail to solve. This seems to me like an ill-conditioned matrix problem, so I tried using Lapack's expert routines dgesvx and dgesvxx on a much smaller matrix I prepared as an example. I understand that these routines search for preconditioners to solve, but I am not completely sure.
The matrix in the example is constructed in such a way that varying the parameter lam
, makes the matrix's determinant 0
when lam=0
and the solution of the system is [2,3,5,7] regardless of the value of lam
. I could make dgesvx
compile and solve without any problem but I could not appreciate almost any improvement from the errors dgesv
returns.
So I tried to use dgesvxx
instead but gfortran
will not compile it. I run the command
$ gfortran ill_conditioned.f90 -o ill_conditioned -llapack
and get an error
/tmp/ccaC8jCk.o: In function `MAIN__':
ill_conditioned.f90:(.text+0x38e): undefined reference to `dgesvxx_'
collect2: error: ld returned 1 exit status
which does not happen with dgesv
or dgesvx
. I installed lapack version 3.5.0-2ubuntu1 in my Ubuntu machine with the command sudo apt-get install liblapack-dev
.
Upvotes: 3
Views: 861
Reputation: 60018
It seems like some distribution problem to me.
On my distro (OpenSUSE) I have also the dgesvxx.f
missing although lapacke.h
defines the C interface to dgesvxx
.
Searching for the symbol dgesvx
in the shared library
nm -D /usr/lib64/liblapack.so | grep dgesvx
also finds dgesvx
only and not dgesvxx
.
I would recommend you to download the LAPACK source from netlib and to build it yourself with some high-performance BLAS. You can also try OpenBLAS which includes LAPACK too.
Upvotes: 2