Discussion/Tracking issue for a design enabling L[D]LT update w/out compute call
Submitted by Christopher Suter
Assigned to Nobody
Link to original bugzilla bug (#1599)
Description
In some applications I and my colleagues have been working on, it would be useful to be able to make low-rank updates to an existing factorization, in cases where we don't have access to an LLT or LDLT instance that was used to compute it.
Currently, the only route to the rankUpdate methods are through the public interface of an LLT/LDLT instance, and the only way to construct an instance of LLT/LDLT is to instantiate it with an SP[S]D matrix, which is then factorized in the various constructors.
I can see at least two routes to enabling what we want
-
Add an extra constructor to the LLT/LDLT classes, which takes a tril matrix and skips the computation
-
Refactor things to separate rankUpdate functions from the LLT/LDLT classes entirely
Other options that come to mind amount to minor variations on these (e.g., instead of a
new constructor, use a factory method, an additional boolean flag on existing constructors, or a separate boolean trait).
I implemented a simplistic version of the "new constructor" approach in my local fork; and it is straightforward to implement and use. My current sketch of an implementation is pretty naïve, though: eg, it ignores existence of _UpLo trait, and in order to avoid collision with existing constructor signatures, introduces a boolean flag 'validate_input' that lets me tell the ctor whether to validate that the input is indeed triangular (it's not clear to me, as a total Eigen dev n00b whether such optional validations are customary in this code base; anyway, it feels like a sloppy hack to differentiate this ctor from the others).
I'd love to get feedback on the above sketch of a proposal. If it sounds generally reasonable, I can actually write a less sketch-y proposal and eventually start submitting patches. I'd be happy to contribute the work here, as this will be very useful to us and, I hope, to others.
Thanks in advance!