<!--
{
  "availability" : [
    "iOS: 18.5.0 -",
    "iPadOS: 18.5.0 -",
    "macCatalyst: 18.5.0 -",
    "macOS: 15.5.0 -",
    "tvOS: 18.5.0 -",
    "visionOS: 2.5.0 -",
    "watchOS: 11.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/SparseUpdateFactor(_:_:_:_:_:)-9qg54",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@SparseUpdateFactor#$@EA@SparseUpdate_t#*$@SA@SparseOpaqueFactorization_Float#I#*1I#$@SA@SparseMatrix_Float#"
  },
  "title" : "SparseUpdateFactor(_:_:_:_:_:)"
}
-->

# SparseUpdateFactor(_:_:_:_:_:)

Apply a low-rank update to an existing factorization of a matrix of float values.

```
func SparseUpdateFactor(_ updateAlgorithm: SparseUpdate_t, _ Factorization: UnsafeMutablePointer<SparseOpaqueFactorization_Float>, _ updateCount: Int32, _ updatedIndices: UnsafePointer<Int32>, _ Update: SparseMatrix_Float)
```

## 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, `updatedIndices` should be a list of `updateCount`
  (row, column) pairs indicating modified values (i.e. a total of `2*updateCount` integers),
  and `Update` should be a full copy of the original matrix with those value modified to their
  new values. The structure of `Update` must be identical to that of the original matrix.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)