---
title: DenseMatrix_Float
framework: accelerate
role: symbol
role_heading: Structure
path: accelerate/densematrix_float
---

# DenseMatrix_Float

A structure that contains a dense matrix of single-precision, floating-point values.

## Declaration

```swift
struct DenseMatrix_Float
```

## Overview

Overview You typically use dense matrices to represent the unknowns matrix, X, and the right-hand-side matrix, B, in the matrix equation AX = B. A DenseMatrix_Float structure provides a pointer to its underlying data, and information about its structure and attributes. The following code shows an example of how to create a dense matrix structure from an array of double-precision values. In this case, use withUnsafeMutableBufferPointer(_:) to pass a pointer to your collection. The DenseMatrix_Float structure is valid only during the execution of the closure. Don’t store or return the structure for later use. // An array of `rowCount` x `columnCount` single-precision values. var matrixValues = [...] let rowCount = Int32(5) let columnCount = Int32(5)

matrixValues.withUnsafeMutableBufferPointer {     let matrix = DenseMatrix_Float(rowCount: rowCount,                                    columnCount: columnCount,                                    columnStride: rowCount,                                    attributes: SparseAttributes_t(),                                    data: $0.baseAddress!)          // Perform operations using `matrix`. }

## Topics

### Initializers

- [init(rowCount:columnCount:columnStride:attributes:data:)](accelerate/densematrix_float/init(rowcount:columncount:columnstride:attributes:data:).md)

### Inspecting a Matrix’s Structure and Data

- [rowCount](accelerate/densematrix_float/rowcount.md)
- [columnCount](accelerate/densematrix_float/columncount.md)
- [columnStride](accelerate/densematrix_float/columnstride.md)
- [attributes](accelerate/densematrix_float/attributes.md)
- [SparseAttributes_t](accelerate/sparseattributes_t.md)
- [data](accelerate/densematrix_float/data.md)

## See Also

### Creating dense matrices and dense vectors

- [DenseMatrix_Double](accelerate/densematrix_double.md)
- [DenseVector_Double](accelerate/densevector_double.md)
- [DenseVector_Float](accelerate/densevector_float.md)
