RFC: Add julia ldlt factorization and solver for SymTridiagonal and julia lu factorization for Tridiagonal #6265
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@alanedelman suggested Julia implementation for factorizations of
SymTridiagonal
s. I have followed LAPACK and used ldlt forSymTridiagonal
because it doesn't require allocation. I also wrote a solver for the factorization and removed the calls to LAPACK.For
Tridiagonal
, I translated the lu from LAPACK to Julia since I didn't dare to open a pull request with a version without pivoting. To do so, I have changed theTridiagonal
type to only have one extra vector allocation. This is required for the pivoting. This also caused some cleanup of the tridiagonal code. I have changed allsolve
methods toA_ldiv_B
to be consistent with the rest ofBase
. If anyone uses theTridiagonal
code please have a look and test.A style innovation that I would like some comments on is that I have parametrized lu and ldlt on matrix type. In consequence there is only one lu type definition because it works for ordinary matrices as well as tridiagonals. This change also makes it possible to use array views in factorizations. I would like to extend this innovation to the other special matrices such that e.g.
Triangular
can be anyAbstractMatrix
.Finally, I Implement
convert(AbstractArray,x)
andconvert(Factorization,x)
methods as proposed by @JeffBezanson in #6078. I get the same type of warningscould not show value of type Tuple
. @JeffBezanson can you figure out what is wrong?cc: @jiahao