This function is not exported. It serves as the core computational engine for evaluating Anti-Robinson (AR), Generalized Anti-Robinson (GAR), and Relative GAR (RGAR) scores.
.compute_gar_core(mat, order, w = NULL, normalize = FALSE)
A numeric value indicating the number (or proportion) of Anti-Robinson violations.
A numeric, symmetric distance matrix.
A permutation vector indicating the new ordering of rows/columns.
An integer window size (if NULL, evaluates all triplets globally).
Logical. If TRUE, returns a proportion; otherwise returns the raw count.