jacobwilliams / quadpack

Modern Fortran QUADPACK Library for 1D numerical quadrature
Other
66 stars 8 forks source link

Replace linpack DGTSL with lapack DGTSV #3

Open jacobwilliams opened 2 years ago

jacobwilliams commented 2 years ago

Consider replacing linpack DGTSL with lapack DGTSV. This was done in the SciPy version. See: https://github.com/scipy/scipy/commit/361468a6b08e731936d761f5130799fca962acaf#diff-3bc2ad4ff04dcd0fd46bde7b0a273a6b453177a8494cbc77f08009db5cb8ad93

ivan-pi commented 2 years ago

I'd be happy to contribute this fix. Biggest obstacle I see is that fpm doesn't yet have first class LAPACK or BLAS support (see https://github.com/fortran-lang/fpm/issues/368).

ivan-pi commented 2 years ago

Upon further inspection, the reference version of DGTSV only makes call to the external routine XERBLA for error reports. So you could probably just add it to this repository and forget about linking with linpack/lapack.

If you know the tridiagonal system is diagonally dominant, we could also just replace it with an implementation of the Thomas algorithm without pivoting.

jacobwilliams commented 2 years ago

Maybe there could be options, depend on some preprocessor flags?

ivan-pi commented 2 years ago

I can see that as a temporary solution until fpm has native support for locating if lapack is installed and what is the name of the library.