convert: Convert a matrix to a vector of arrays

Description Usage Arguments Details Examples

Description

Convert a matrix to a vector of arrays

Usage

1
2
3

Arguments

x

object to be converted

Details

The algorithms in kdtools can accept either matrices or an arrayvec object. When a matrix is passed, it is converted to an arrayvec object internally and the results are converted back to a matrix. For optimal performance, pre-convert matrices.

Examples

1
2
3
4
5
6
7
if (has_cxx17()) {
x = matrix(1:10, 5)
y = matrix_to_tuples(x)
str(x)
str(y)
y[1:2, ]
}

kdtools documentation built on Oct. 8, 2021, 9:07 a.m.