cachePermute {flintyR} | R Documentation |
Permutation by Caching Distances
Description
What do you do when you have to compute pairwise distances many times, and those damn distances take a long time to compute? Answer: You cache the distances and permute the underlying sample labels!
Usage
cachePermute(dists, forward, reverse)
Arguments
dists |
|
forward |
|
reverse |
|
Details
This function permutes the distances (Hamming, l_p^p
, etc.) within blocks.
Permutations respect the fact that we are actually permuting the
underlying labels. Arguments forward and reverse should be
precomputed using buildForward and buildReverse.
Dependencies: buildForward, buildReverse
Value
A matrix with same dimensions as dists containing the block-permuted pairwise distances