Structure

DenseVector_Float

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

Declaration

typedef 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

Inspecting a Vector's Structure and Data

count

The number of items in the vector.

data

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

See Also

Dense Matrices and Vectors

DenseMatrix_Double

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

DenseMatrix_Float

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

DenseVector_Double

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

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software