sq_dist: Calculates squared pairwise distances

View source: R/misc.R

sq_distR Documentation

Calculates squared pairwise distances

Description

Calculates squared pairwise euclidean distances using C.

Usage

sq_dist(X1, X2 = NULL)

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

Value

symmetric matrix of squared euclidean distances

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

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


deepgp documentation built on Sept. 11, 2024, 8:30 p.m.