<!--
{
  "documentType" : "article",
  "framework" : "MetalPerformanceShaders",
  "identifier" : "/documentation/MetalPerformanceShaders/matrices-and-vectors",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Matrices and Vectors"
}
-->

# Matrices and Vectors

Solve systems of equations, factorize matrices and multiply matrices and vectors.

## Topics

### Matrices

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

A 2D array of data that stores the data’s values.

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

A description of attributes used to create an MPS matrix.

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

A matrix allocated on GPU private memory.

### Vectors

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

A 1D array of data that stores the data’s values.

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

A description of the length and data type of a vector.

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

A vector allocated on GPU private memory.

### Classes for Decomposition and Solving

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

A kernel for computing the Cholesky factorization of a matrix.

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

A kernel for computing the solution of a linear system of equations using a Cholesky factorization.

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

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

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

A kernel for computing the solution of a linear system of equations using an LU factorization.

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

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

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

A kernel that consumes one matrix and produces one matrix.

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

A kernel that consumes two matrices and produces one matrix.

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

### Matrix Arithmetic Operations

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

A kernel for performing a pointwise summation of a matrix.

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

A matrix multiplication kernel.

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

A matrix-vector multiplication kernel

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

A kernel for computing the top-K values and their corresponding indices in a matrix.

### Matrix Copying Operations

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

A class that can perform multiple matrix copy operations.

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

A kernel that copies matrix data to a Metal Performance Shaders image.

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

A description of multiple matrix copy operations.

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

A class that copies image data to a matrix.

### Matrix Neural Network Operations

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

A kernel for applying a fully connected neural network layer.

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

A kernel for applying a fully gradient connected neural network layer.

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

A neuron activation kernel that operates on matrices.

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

A gradient neuron activation kernel that operates on matrices.

### Matrix Softmax Operations

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

A logarithmic softmax kernel that operates on matrices.

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

A logarithmic gradient softmax kernel that operates on matrices.

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

A softmax kernel that operates on matrices.

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

A gradient softmax kernel that operates on matrices.

### Matrix Normalization Operations

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

A batch normalization kernel that operates on matrices.

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

A batch normalization gradient kernel that operates on matrices.



---

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)