pub trait Affectation<DataId, DataLabel> {
// Required methods
fn get_affectation(&self, dataid: DataId) -> DataLabel;
fn get_nb_points(&self) -> usize;
fn iter(&self) -> impl Iterator<Item = (DataId, DataLabel)>;
}Expand description
The cluster affectation of any clustering scheme should be able to provide a structure implementing this trait.
Typically an affectation abstract a clusterization as something giving the label or the rank of the cluster attached to a dataid.
The DataId should satisfy the Hash trait. Morally The label is a discrete value (satisfy the PrimInt + Unsigned trait).
Required Methods§
Sourcefn get_affectation(&self, dataid: DataId) -> DataLabel
fn get_affectation(&self, dataid: DataId) -> DataLabel
given a dataId, returns its label or cluster Id
Sourcefn get_nb_points(&self) -> usize
fn get_nb_points(&self) -> usize
returns number of points in clusters
Sourcefn iter(&self) -> impl Iterator<Item = (DataId, DataLabel)>
fn iter(&self) -> impl Iterator<Item = (DataId, DataLabel)>
iterator on couples (dataid, label)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".