Compute Distances Between Vectors on a GPU
gpuDist.RdThis 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,
precision = getOption("gputools.precision", "single"))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.
- precision
"single"or"double": the floating point precision the GPU computes in. Single precision is the default, set withoptions(gputools.precision = "double"); it runs many times faster on most consumer GPUs. Results are returned as doubles either way.