<!--
{
  "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/SparseCreateSubfactor(_:_:)-39487",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Accelerate"
    ],
    "preciseIdentifier" : "c:@F@SparseCreateSubfactor#$@EA@SparseSubfactor_t#$@SA@SparseOpaqueFactorization_Complex_Double#"
  },
  "title" : "SparseCreateSubfactor(_:_:)"
}
-->

# SparseCreateSubfactor(_:_:)

Returns an opaque object representing a sub-factor of a
factorization in complex double.

```
func SparseCreateSubfactor(_ subfactor: SparseSubfactor_t, _ Factor: SparseOpaqueFactorization_Complex_Double) -> SparseOpaqueSubfactor_Complex_Double
```

## Parameters

`subfactor`

The sub-factor the new object should represent.

`Factor`

The factorization to extract the sub-factor from.

## Return Value

Object representing the requested sub-factor. Must be cleaned up
by a call to `SparseCleanup` once it is no longer required.

## Discussion

Here the term “sub-factor” is used to mean one or more parts of
the whole factorization. For example, just the `Q` factor from `A=QRP`.
The returned object is a wrapper around the orignal factorization, and does
not actually perform any extraction (sub-factors are stored in non-standard
formats that exploit implicit structure for efficiency, and formation of the
sub-factor explicitly can be expensive). It is intended to be used as an
argument to `SparseMultiply` and `SparseSolve` functions only.

As `Factor` is contained in the returned object, its underlying reference
count in incremented, and the returned object must hence be destroyed
through a call to `SparseCleanup` to prevent a memory leak (however it is
safe to call `SparseCleanup` on the original factorization whilst this
object is still being used).

---

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)