---
title: DenseVector_Float
framework: accelerate
role: symbol
role_heading: Structure
path: accelerate/densevector_float
---

# DenseVector_Float

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

## Declaration

```swift
struct DenseVector_Float
```

## Overview

Overview You typically use dense vectors to represent the unknowns vector, x, and the right-hand-side vector, b, in the matrix equation Ax = b. A DenseVector_Float structure provides a pointer to its underlying data and a count of its number of elements. The following code shows an example of how to create a dense vector structure from an array of single-precision values. In this case, use withUnsafeMutableBufferPointer(_:) to pass a pointer to your collection. The DenseVector_Float structure is valid only during the execution of the closure. Don’t store or return the structure for later use. var vectorValues: [Float] = [10, 20, 30, 40] let vectorValuesCount = Int32(vectorValues.count)

vectorValues.withUnsafeMutableBufferPointer { vectorValuesPtr in          let vector = DenseVector_Float(count: vectorValuesCount,                                    data: vectorValuesPtr.baseAddress!)          // Perform operations using `vector`. }

## Topics

### Initializers

- [init(count:data:)](accelerate/densevector_float/init(count:data:).md)

### Inspecting a Vector’s Structure and Data

- [count](accelerate/densevector_float/count.md)
- [data](accelerate/densevector_float/data.md)

## Relationships

### Conforms To

- [BitwiseCopyable](swift/bitwisecopyable.md)

## See Also

### Creating dense matrices and dense vectors

- [DenseMatrix_Double](accelerate/densematrix_double.md)
- [DenseMatrix_Float](accelerate/densematrix_float.md)
- [DenseVector_Double](accelerate/densevector_double.md)
