LAPACKE_zheevx: How to set ABSTOL=2*DLAMCH('S') in C++

Open discussion regarding features, bugs, issues, vendors, etc.

LAPACKE_zheevx: How to set ABSTOL=2*DLAMCH('S') in C++

Postby Boris_MV » Wed Aug 17, 2016 4:53 pm

This is a question about setting proper tolerance ("abstol") for convergence of eigenvalue calculation with LAPACKE_zheevx() function in C++.

When LAPACKE_zheev() fails to converge when calculating eigenvalues/eigenvectors with the default value of "abstol" (i.e. abstol=-1), the LAPACK manual says to set abstol=2*DLAMCH('S'). However, DLAMCH is Fortran function and I use C++ which does not recognize it as a valid C++ function. Could anyone please help me how to properly set "abstol=2*DLAMCH('S')" when using LAPACK with C++ (i.e. when using LAPACKE)?

Thanks very much in advance!!
Boris_MV
 
Posts: 7
Joined: Fri Dec 19, 2014 9:39 pm

Re: LAPACKE_zheevx: How to set ABSTOL=2*DLAMCH('S') in C++

Postby Julien Langou » Thu Aug 18, 2016 4:57 am

Hi Boris,

LAMCH is in LAPACKE so to set ABSTOL=2*DLAMCH('S'), one can use the C LAPACKE wrapper:
Code: Select all
double LAPACKE_dlamch( char cmach );

from C++.

If this does not work, then I would suggest to set ABSTOL to 5e-16 (for double precision) and give it a try.

Cheers,
Julien.
Julien Langou
 
Posts: 820
Joined: Thu Dec 09, 2004 12:32 pm
Location: Denver, CO, USA

Re: LAPACKE_zheevx: How to set ABSTOL=2*DLAMCH('S') in C++

Postby Boris_MV » Thu Aug 18, 2016 1:53 pm

Thanks for the reply. I will try it and will post my finidngs.
Boris_MV
 
Posts: 7
Joined: Fri Dec 19, 2014 9:39 pm


Return to User Discussion

Who is online

Users browsing this forum: No registered users and 2 guests