pub trait Partition<M> {
type Metadata;
type Error;
// Required method
fn partition(
&mut self,
part_ids: &mut [usize],
data: M,
) -> Result<Self::Metadata, Self::Error>;
}Expand description
The Partition trait allows for partitioning data.
Partitioning algorithms implement this trait.
The generic argument M defines the input of the algorithms (e.g. an
adjacency matrix or a 2D set of points).
The input partition must be of the correct size and its contents may or may not be used by the algorithms.
Required Associated Types§
Required Methods§
Sourcefn partition(
&mut self,
part_ids: &mut [usize],
data: M,
) -> Result<Self::Metadata, Self::Error>
fn partition( &mut self, part_ids: &mut [usize], data: M, ) -> Result<Self::Metadata, Self::Error>
Partition the given data and output the part ID of each element in
part_ids.
Part IDs must be contiguous and start from zero, meaning the number of
parts is one plus the maximum of part_ids. If a lower ID does not
appear in the array, the part is assumed to be empty.