quadpack icon indicating copy to clipboard operation
quadpack copied to clipboard

Replace linpack DGTSL with lapack DGTSV

Open jacobwilliams opened this issue 3 years ago • 4 comments

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

jacobwilliams avatar Jan 01 '22 15:01 jacobwilliams

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 avatar Jan 17 '22 02:01 ivan-pi

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.

ivan-pi avatar Jan 17 '22 16:01 ivan-pi

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

  • use original
  • use embedded dgtsv procedure we add to the module (with refactoring)
  • link with system lapack

jacobwilliams avatar Jan 17 '22 18:01 jacobwilliams

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.

ivan-pi avatar Jan 19 '22 23:01 ivan-pi