<!--
{
  "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/MPSMatrixSolveTriangular",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Metal Performance Shaders"
    ],
    "preciseIdentifier" : "c:objc(cs)MPSMatrixSolveTriangular"
  },
  "title" : "MPSMatrixSolveTriangular"
}
-->

# MPSMatrixSolveTriangular

A kernel for computing the solution of a linear system of equations using a triangular coefficient matrix.

```
class MPSMatrixSolveTriangular
```

## Overview

This kernel finds the solution matrix to the system *op(A) * X = alpha * B* or *X * op(A) = alpha * B*, where:

- A is either an upper or lower triangular matrix
- *op(A)* is either *Aᵀ* or *A*
- *X* is the resulting matrix of solutions
- *B* is the array of right hand sides for which the equations are to be solved

## Topics

### Initializers

[`-  initWithDevice:right:upper:transpose:unit:order:numberOfRightHandSides:alpha:`](/documentation/MetalPerformanceShaders/MPSMatrixSolveTriangular/init(device:right:upper:transpose:unit:order:numberOfRightHandSides:alpha:))

### Instance Methods

[`-  encodeToCommandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:`](/documentation/MetalPerformanceShaders/MPSMatrixSolveTriangular/encode(commandBuffer:sourceMatrix:rightHandSideMatrix:solutionMatrix:))

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

### Inherits From

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

---

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)