Structure

DenseVector_Float

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

Declaration

struct DenseVector_Float

Overview

The following example shows the code required to create and iterate over a dense vector containing four Float values.

var values: [Float] = [2.20, 2.85, 2.79, 2.87]
let vector = DenseVector_Float(count: Int32(values.count),
                               data: &values)
 
stride(from: 0, to: vector.count, by: 1).forEach {i in
    print(vector.data[Int(i)])
}

Topics

Initializers

init(count: Int32, data: UnsafeMutablePointer<Float>)

Creates a new vector of single-precision values.

Inspecting a Vector's Structure and Data

var count: Int32

The number of items in the vector.

var data: UnsafeMutablePointer<Float>

The array of single-precision, floating-point values.

See Also

Dense Matrices and Vectors

struct DenseMatrix_Double

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

struct DenseMatrix_Float

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

struct DenseVector_Double

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