---
title: "init(dimensions:columns:rowBytes:dataType:)"
framework: metalperformanceshaders
role: symbol
role_heading: Initializer
path: "metalperformanceshaders/mpsmatrixdescriptor/init(dimensions:columns:rowbytes:datatype:)"
---

# init(dimensions:columns:rowBytes:dataType:)

Creates a matrix descriptor with the specified dimensions and data type.

## Declaration

```swift
convenience init(dimensions rows: Int, columns: Int, rowBytes: Int, dataType: MPSDataType)
```

## Parameters

- `rows`: The number of rows in the matrix.
- `columns`: The number of columns in the matrix.
- `rowBytes`: The stride, in bytes, between corresponding elements of consecutive rows in the matrix.
- `dataType`: The type of the data to be stored in the matrix.

## Return Value

Return Value A valid MPSMatrixDescriptor object.

## Discussion

Discussion For performance considerations, the optimal row stride may not necessarily be equal to the number of columns in the matrix. The rowBytes(fromColumns:dataType:) method may be used to help you determine this value.

## See Also

### Methods

- [rowBytes(fromColumns:dataType:)](metalperformanceshaders/mpsmatrixdescriptor/rowbytes(fromcolumns:datatype:).md)
- [rowBytes(forColumns:dataType:)](metalperformanceshaders/mpsmatrixdescriptor/rowbytes(forcolumns:datatype:).md)
