<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/MPSMatrixDecompositionLU",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSMatrixDecompositionLU"
  },
  "title" : "MPSMatrixDecompositionLU"
}
-->

# MPSMatrixDecompositionLU

A kernel for computing the LU factorization of a matrix using partial pivoting with row interchanges.

```
class MPSMatrixDecompositionLU
```

## Overview

This kernel object computes an LU factorization, *PA = LU*, where:

- *A* is a matrix for which the LU factorization is to be computed
- *L* is a unit lower triangular matrix
- *U* is an upper triangular matrix
- *P* is a permutation matrix

## Topics

### Initializers

[`-  initWithDevice:rows:columns:`](/documentation/MetalPerformanceShaders/MPSMatrixDecompositionLU/init(device:rows:columns:))

### Instance Methods

[`-  encodeToCommandBuffer:sourceMatrix:resultMatrix:pivotIndices:status:`](/documentation/MetalPerformanceShaders/MPSMatrixDecompositionLU/encode(commandBuffer:sourceMatrix:resultMatrix:pivotIndices:info:))

## Relationships

### Conforms To

[`NSCopying`](/documentation/Foundation/NSCopying)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSCoding`](/documentation/Foundation/NSCoding)

[`NSSecureCoding`](/documentation/Foundation/NSSecureCoding)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

### Inherits From

[`MPSMatrixUnaryKernel`](/documentation/MetalPerformanceShaders/MPSMatrixUnaryKernel)

---

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)