MatchingPP: Stable matching of point patterns

Description Usage Arguments Value Examples

View source: R/MatchingPP.R

Description

Stable matching of two point patterns in a cubic simulation box [0,L)^d: It is the core function of the package MatchingPP.

The nearest neighbor search uses the function nn2 from the package RANN.

Usage

1
MatchingPP(linear.system.size, coords.1, coords.2, fout=FALSE, fname="example-matchedpp.dat", verb=TRUE, nn2.treetype = "kd", nn2.eps=0)

Arguments

linear.system.size

Linear system size L of the simulation box [0,L)^d

coords.1

A point pattern stored in a matrix, where each row stores the coordinates of one point

coords.2

Another point pattern stored in a matrix, where each row stores the coordinates of one point

fout

Output of matched points to file if set to TRUE (default=FALSE)

fname

Name of output file (default="example-matchedpp.dat")

verb

Output of progress if set to TRUE (default=TRUE)

nn2.treetype

Optional argument of the function nn2 from the package RANN, which is used for the nearest neighbor search: "Either the standard kd tree or a bd (box-decomposition, AMNSW98) tree which may perform better for larger point sets" (default="kd")

nn2.eps

Optional argument of the function nn2 from the package RANN, which is used for the nearest neighbor search: "error bound: default of 0.0 implies exact nearest neighbour search" (default=0)

Value

Matrix that stores all matched points of the 1st point pattern (in columns 1 to dimension) and of the 2nd point pattern (in columns dimension+1 to end). Each row contains one pair of matched points.

Examples

1
2
3
4
5
6
linear.sys.size <- 4.0
n.pts <- 25
coords.bino <- matrix(runif(2*n.pts,0,linear.sys.size), nrow = n.pts)
n.pts <- rpois(1,n.pts)
coords.pois <- matrix(runif(2*n.pts,0,linear.sys.size), nrow = n.pts)
out <- MatchingPP(linear.sys.size, coords.pois, coords.bino)

michael-klatt/matchingpp documentation built on May 29, 2019, 3:06 a.m.