Compute row-wise ranks of a similarity matrix for two cases:
method = "row": within-pattern block (Sii) (square). Because self-pairs exist, the diagonal
(self-similarity) is first forced below the minimum entry of (S) so that self-neighbors are always ranked last
and thus excluded when top-(k) truncation is applied downstream.
method = "rowij": cross-pattern block (Sij) (rectangular, i!=j). There are no self-pairs,
so no diagonal adjustment is needed.
Ranks are computed row-wise with rank() and then shifted by 1 (i.e., the function returns rank - 1).
BRISE_Rank(S, method = "row")A numeric matrix with the same dimensions as S containing row-wise ranks minus one.
Numeric similarity matrix: (Sii) (square) when method = "row"; (Sij) (rectangular) when
method = "rowij". Larger values indicate greater similarity.
Character, either "row" (within-pattern (Sii), diagonal suppressed) or "rowij"
(cross-pattern (Sij), no diagonal to suppress).