This function computes the rank matrix based on the specified graph type and number of neighbors.
rank_mats(S, Dd, gtype, k)A numeric matrix representing the rank matrix
A numeric matrix representing the similarity matrix
A dist object representing the distance matrix
A character string indicating the graph type to use ("NNG", "MST", or "rNNG")
A numeric representing the number of neighbors to use for graph
Zhu, Y., & Chen, H. (2023). A new robust graph for graph-based methods. arXiv preprint arXiv:2307.15205.