QuadratRanking: The workhorse of the package.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/QuadratRanking.R

Description

Takes a square matrix of zeros with number of rows equal to a power of 2. When the number of rows is at least 2, this matrix is split in to four equal submatrices: in half along the columns and in half along the rows. Then the QuadratRanking function is applied recursively while increasing the level with 1.

Usage

1
QuadratRanking(Ranking, Level = 0)

Arguments

Ranking

A square matrix with number of rows equal to a power of 2. Must start with a matrix of zeros.

Level

A square matrix with number of rows equal to a power of 2. Must start with a matrix of zeros.

Details

When the Ranking matrix recudes to a 1x1 matrix, the function returns this 1x1 matrix. When the Ranking matrix is split into four submatrices, the number 0 to 3 are assigned at random to one of the submatrices. Then the values of the submatrix, after recursively applying the QuadratRanking function, is increased with the random number times 4 to the power of the level.

WARNING: This function does not do any checking on the sanity of Ranking and Level. That would be a computational burden since the function is called recursively. Please use the GRTS wrapper function instead. That does the necessary checking prior to calling QuadratRanking.

Value

A matrix with the same dimension of Ranking filled with a randomised order of points.

Author(s)

Thierry Onkelinx Thierry.Onkelinx@inbo.be, Paul Quataert

See Also

GRTS

Examples

1
 QuadratRanking(Ranking = matrix(0, ncol = 4, nrow = 4))

ThierryO/grts documentation built on Jan. 15, 2022, 8:31 p.m.