Learn R Programming

deepgp (version 1.1.3)

sq_dist: Calculates squared pairwise distances

Description

Calculates squared pairwise euclidean distances using C.

Usage

sq_dist(X1, X2 = NULL)

Value

symmetric matrix of squared euclidean distances

Arguments

X1

matrix of input locations

X2

matrix of second input locations (if NULL, distance is calculated between X1 and itself)

Details

C code derived from the "laGP" package (Robert B Gramacy and Furong Sun).

References

Gramacy, RB and F Sun. (2016). laGP: Large-Scale Spatial Modeling via Local Approximate Gaussian Processes in R. Journal of Statistical Software 72 (1), 1-46. doi:10.18637/jss.v072.i01

Examples

Run this code
x <- seq(0, 1, length = 10)
d2 <- sq_dist(x)

Run the code above in your browser using DataLab