gpuDist {gputools}R Documentation

Compute Distances Between Vectors on a GPU

Description

This function computes the distance between each vector of the 'points' argument using the metric specified by 'method'.

Usage

        gpuDist(points, method = "euclidean", p = 2.0)

Arguments

points a matrix of floating point numbers in which each row is a vector in $R^n$ space where $n$ is ncol(points).
method a string representing the name of the metric to use to calculate the distance between the vectors of 'points'. Currently supported values are: "binary", "canberra", "euclidean", "manhattan", "maximum", and "minkowski".
p a floating point parameter for the Minkowski metric.

Value

a matrix of floating point numbers whose i, j entry represents the distance between vector i and vector j from the 'points' argument.

See Also

dist

Examples

numVectors <- 5
dimension <- 10
Vectors <- matrix(runif(numVectors*dimension), numVectors, dimension)
gpuDist(Vectors, "euclidean")
gpuDist(Vectors, "maximum")
gpuDist(Vectors, "manhattan")
gpuDist(Vectors, "minkowski", 4)

[Package gputools version 0.1-0 Index]