Contribution proposal: Wrapper for fortran tridiagonal solvers similar to scipy.linalg.solve_triangular

Hi, I'm a PhD student at UC Berkeley and in my research I often use tridiagonal solvers similar to those found in LAPACK (dgtsv for example). I would like to contribute a function similar to scipy.linalg.solve_triangular that accepts a tridiagonal matrix from the user and calls the appropriate LAPACK function. If this feature seems appropriate for scipy please let me know and I will open a pull request on github. Cheers! Jack

That could be useful, but can I interest you in the more general problem? https://github.com/scipy/scipy/pull/12824 Once the matrix is determined to be tridiagonal in that PR's `solve` function, perhaps the logic could be shared with a `solve_tridiagonal` function. So it might be worth looking at what logic is already in that PR before writing something from scratch. On Sat, Apr 16, 2022, 4:53 PM J Roth <jc.roth73@gmail.com> wrote:
Hi,
I'm a PhD student at UC Berkeley and in my research I often use tridiagonal solvers similar to those found in LAPACK (dgtsv for example). I would like to contribute a function similar to scipy.linalg.solve_triangular that accepts a tridiagonal matrix from the user and calls the appropriate LAPACK function. If this feature seems appropriate for scipy please let me know and I will open a pull request on github.
Cheers! Jack _______________________________________________ SciPy-Dev mailing list -- scipy-dev@python.org To unsubscribe send an email to scipy-dev-leave@python.org https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: mhaberla@calpoly.edu

Thanks for bringing my attention to that PR--I think I will try tackling a the general solve function instead.

Situation is a bit better now for that PR. Since v1.8 we have added the bandwith function and its Cythonized bowels so that you can call bandwidth and if the result is (1, 1) then you have tridiagonal array that you can extract the entries and send it to ?gtsv. But the premise of new solve is for it to work with nd-arrays (not just 2d) and also should return ill-conditioning warnings in case it is. That is completed for tridiagonal matrices as is but the PR was before bandwidth and others in place hence will require a bit of shuffling to use those tools. Main hoop jumping is about taming Cython to switch from numpy numeric types to C types and back which is truly annoying and takes the most time. The rest is basically the flow diagram given in the PR description. On Tue, Apr 19, 2022 at 7:31 AM J Roth <jc.roth73@gmail.com> wrote:
Thanks for bringing my attention to that PR--I think I will try tackling a the general solve function instead. _______________________________________________ SciPy-Dev mailing list -- scipy-dev@python.org To unsubscribe send an email to scipy-dev-leave@python.org https://mail.python.org/mailman3/lists/scipy-dev.python.org/ Member address: ilhanpolat@gmail.com
participants (3)
-
Ilhan Polat
-
J Roth
-
Matt Haberland