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.
Summary
Decided to dive in on the sparse cholesky. This is a WIP.
The interesting wrinkle here is that
does not (without a lot of coercing) perform a Cholesky decomposition of
A
. It instead performs a Cholesky ofA.twistedBy(perm)
, whereperm
is stored in theEigen::SimplicialLLT<T>
class. This means that it is not enough forcholesky_decompose
to returnas this will not be the matrix we are looking for. This is the problem with @SteveBronder's old branch
math/stan/math/prim/mat/fun/cholesky_decompose.hpp
Line 114 in a97bfa2
The two options here are to compute perm explicitly somewhere else and carry it around (I do not like this option). The other option is to carry treat
Eigen::SimplicialLLT<T>
as if it were the lower triangular matrix when performing triangular solves, multiplication, and anything else we might need. (those operations require knowledge ofperm
).I'm not quite sure how my preferred option will work with autodiff - we might need a light specialization.
Tests
Coming
Side Effects
By adding a new, non-matrix Eigen type, we need to be very careful that none of the other template patterns match it. It should be fine, but care is needed.
Release notes
Replace this text with a short note on what will change if this pull request is merged in which case this will be included in the release notes.
Checklist
Copyright holder: Daniel Simpson
The copyright holder is typically you or your assignee, such as a university or company. By submitting this pull request, the copyright holder is agreeing to the license the submitted work under the following licenses:
- Code: BSD 3-clause (https://opensource.org/licenses/BSD-3-Clause)
- Documentation: CC-BY 4.0 (https://creativecommons.org/licenses/by/4.0/)
the basic tests are passing
./runTests.py test/unit
)make test-headers
)make test-math-dependencies
)make doxygen
)make cpplint
)the code is written in idiomatic C++ and changes are documented in the doxygen
the new changes are tested