Function kodama::linkage_with

source ·
pub fn linkage_with<T: Float>(
    state: &mut LinkageState<T>,
    condensed_dissimilarity_matrix: &mut [T],
    observations: usize,
    method: Method,
    steps: &mut Dendrogram<T>
)
Expand description

Like linkage, but amortizes allocation.

The linkage function is more ergonomic to use, but also potentially more costly. Therefore, linkage_with exposes two key points for amortizing allocation.

Firstly, LinkageState corresponds to internal mutable scratch space used by the clustering algorithms. It can be reused in subsequent calls to linkage_with (or any of the other with clustering functions).

Secondly, the caller must provide a Dendrogram that is mutated in place. This is in constrast to linkage where a dendrogram is created and returned.