---
title: "encode(commandBuffer:sourceMatrix:rightHandSideMatrix:pivotIndices:solutionMatrix:)"
framework: metalperformanceshaders
role: symbol
role_heading: Instance Method
path: "metalperformanceshaders/mpsmatrixsolvelu/encode(commandbuffer:sourcematrix:righthandsidematrix:pivotindices:solutionmatrix:)"
---

# encode(commandBuffer:sourceMatrix:rightHandSideMatrix:pivotIndices:solutionMatrix:)

## Declaration

```swift
func encode(commandBuffer: any MTLCommandBuffer, sourceMatrix: MPSMatrix, rightHandSideMatrix: MPSMatrix, pivotIndices: MPSMatrix, solutionMatrix: MPSMatrix)
```
