[][src]Function flann_sys::flann_compute_cluster_centers

pub unsafe extern "C" fn flann_compute_cluster_centers(
    dataset: *mut f32,
    rows: c_int,
    cols: c_int,
    clusters: c_int,
    result: *mut f32,
    flann_params: *mut FLANNParameters
) -> c_int

Clusters the features in the dataset using a hierarchical kmeans clustering approach. This is significantly faster than using a flat kmeans clustering for a large number of clusters.

Params: dataset = pointer to a data set stored in row major order rows = number of rows (features) in the dataset cols = number of columns in the dataset (feature dimensionality) clusters = number of cluster to compute result = memory buffer where the output cluster centers are storred index_params = used to specify the kmeans tree parameters (branching factor, max number of iterations to use) flann_params = generic flann parameters

Returns: number of clusters computed or a number <0 for error. This number can be different than the number of clusters requested, due to the way hierarchical clusters are computed. The number of clusters returned will be the highest number of the form (branch_size-1)*K+1 smaller than the number of clusters requested.