SparseUpdateFactor(_:_:_:_:_:)
Apply a low-rank update to an existing factorization of a matrix of double values.
Declaration
func SparseUpdateFactor(_ updateAlgorithm: SparseUpdate_t, _ Factorization: UnsafeMutablePointer<SparseOpaqueFactorization_Double>, _ updateCount: Int32, _ updatedIndices: UnsafePointer<Int32>, _ Update: SparseMatrix_Double)Parameters
- updateAlgorithm:
The update algorithm to use
- Factorization:
The existing factorization to be updated. The existing factorization will be modified and will no longer solve
AX=B. - updateCount:
Number of updated entries or columns
- updatedIndices:
List of updated indices, interpreted as described above
- Update:
The updated entries.
Discussion
If we have a factorization A = LU and now wish to solve a system ĀX = B where Ā = A + UV^T for some low-rank update matrices U of size m x k and V of size k x n for some small k there exist methods to modify (update) the original factors at a lower cost than a full factorization.
Supported techniques are:
SparseUpdatePartialRefactor: The most stable, but most expensive, method is to perform a partial refactorization that will recalculate the L and U factor values that would be different if performing an LU factorization from scratch.For the partial refactorization,
updatedIndicesshould be a list ofupdateCount(row, column) pairs indicating modified values (i.e. a total of2*updateCountintegers), andUpdateshould be a full copy of the original matrix with those value modified to their new values. The structure ofUpdatemust be identical to that of the original matrix.