toroidal_dist_matrix_optimized {ldmppr}R Documentation

Optimized function to compute toroidal distance matrix over a rectangular domain

Description

Optimized function to compute toroidal distance matrix over a rectangular domain

Usage

toroidal_dist_matrix_optimized(location_matrix, x_bound, y_bound)

Arguments

location_matrix

a 2 column matrix of (x,y) coordinates.

x_bound

the upper bound for the x dimension.

y_bound

the upper bound for the y dimension.

Value

a matrix of toroidal distances.

Examples

# Generate a matrix of locations
location_matrix <- matrix(c(1, 2, 3, 4, 5, 6), ncol = 2)
x_bound <- 10
y_bound <- 10

# Compute the toroidal distance matrix
toroidal_dist_matrix_optimized(location_matrix, x_bound, y_bound)


[Package ldmppr version 1.0.4 Index]