<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: 16.0.0 -",
    "macOS: 13.0.0 -",
    "tvOS: 16.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 9.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Accelerate",
  "identifier" : "/documentation/Accelerate/SparseGetInertia(_:_:_:_:)-2ykzq",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@SparseGetInertia#$@SA@SparseOpaqueFactorization_Double#*I#S1_#S1_#"
  },
  "title" : "SparseGetInertia(_:_:_:_:)"
}
-->

# SparseGetInertia(_:_:_:_:)

Returns the inertia of a double-precision *LDLᵀ* factorization.

```
func SparseGetInertia(_ Factored: SparseOpaqueFactorization_Double, _ num_positive: UnsafeMutablePointer<Int32>, _ num_zero: UnsafeMutablePointer<Int32>, _ num_negative: UnsafeMutablePointer<Int32>) -> Int32
```

## Parameters

`Factored`

The [`SparseFactorizationLDLTTPP`](/documentation/Accelerate/SparseFactorizationLDLTTPP) factorization.

`num_positive`

On return, the number of positive pivots the sparse factorization functions take during the factorization of `Factored`.

`num_zero`

On return, the number of zero pivots the sparse factorization functions take during the factorization of `Factored`.

`num_negative`

On return, the number of negative pivots the sparse factorization functions take during the factorization of `Factored`.

## Return Value

`0` on success; otherwise, a nonzero value on error.

## Discussion

This function returns the number of negative, zero, and positive pivots that the sparse factorization functions, [`SparseFactor(_:_:)`](/documentation/Accelerate/SparseFactor(_:_:)-8gl6j) and [`SparseFactor(_:_:_:_:)`](/documentation/Accelerate/SparseFactor(_:_:_:_:)-88xmk), take during an *LDLᵀ* factorization.

In some cases — for example, when the original matrix’s eigenvalues are close to zero — the computed numerical inertia may not be an accurate reflection of the true inertia. In such cases, the computed numerical inertia is dependent on the [`zeroTolerance`](/documentation/Accelerate/SparseNumericFactorOptions/zeroTolerance) and [`pivotTolerance`](/documentation/Accelerate/SparseNumericFactorOptions/pivotTolerance) values of the [`SparseNumericFactorOptions`](/documentation/Accelerate/SparseNumericFactorOptions) structure.

> Important:
> This function supports only ``doc://com.apple.accelerate/documentation/Accelerate/SparseFactorizationLDLTTPP`` factorizations.

---

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)