rpuDist {rpud}R Documentation

Compute the Distance Matrix on GPU

Description

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

Usage

    rpuDist(points, method = "euclidean", diag = FALSE, upper = FALSE, p = 2)

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".

diag

logical value indicating whether the diagonal of the distance matrix should be printed by print.dist.

upper

logical value indicating whether the upper triangle of the distance matrix should be printed by print.dist.

p

The power of the Minkowski distance.

Details

Compute the distance matrix with GPU. The processing capacity of rpud is confined by the GPU device memory by default. With the rpudplus add-on, rpud will make use of the system RAM, and can handle much larger data sets.

Value

a class of type "dist" containing floating point numbers representing the distances between vectors from the 'points' argument.

See Also

dist, gpuDist

Examples

## Not run: 
numVectors <- 5
dimension <- 10
Vectors <- matrix(runif(numVectors*dimension), numVectors, dimension)
rpuDist(Vectors, "euclidean")
rpuDist(Vectors, "maximum")
rpuDist(Vectors, "manhattan")
rpuDist(Vectors, "canberra")
rpuDist(Vectors, "binary")
rpuDist(Vectors, "minkowski")

## End(Not run)

[Package rpud version 0.7.1 Index]