pub struct MultiJagged {
pub part_count: usize,
pub max_iter: usize,
}Expand description
§Multi-Jagged algorithm
This algorithm is inspired by Multi-Jagged: A Scalable Parallel Spatial Partitioning Algorithm“ by Mehmet Deveci, Sivasankaran Rajamanickam, Karen D. Devine, Umit V. Catalyurek.
It improves over RCB by following the same idea but by creating more than two subparts in each iteration which leads to decreasing recursion depth. It also allows to generate a partition of any number of parts.
More precisely, given a number of parts, the algorithm will generate a “partition scheme”, which describes how
to perform splits at each iteration, such that the total number of iteration is less than max_iter.
More iteration does not necessarily result in a better partition.
§Example
use coupe::Partition as _;
use coupe::Point2D;
let points = vec![
Point2D::new(0., 0.),
Point2D::new(1., 0.),
Point2D::new(2., 0.),
Point2D::new(0., 1.),
Point2D::new(1., 1.),
Point2D::new(2., 1.),
Point2D::new(0., 2.),
Point2D::new(1., 2.),
Point2D::new(2., 2.),
];
let weights = [4.2; 9];
let mut partition = [0; 9];
// generate a partition of 4 parts
coupe::MultiJagged { part_count: 9, max_iter: 4 }
.partition(&mut partition, (&points, &weights))
.unwrap();
for i in 0..9 {
for j in 0..9 {
if j == i {
continue
}
assert_ne!(partition[i], partition[j])
}
}Fields§
§part_count: usize§max_iter: usizeTrait Implementations§
Auto Trait Implementations§
impl Freeze for MultiJagged
impl RefUnwindSafe for MultiJagged
impl Send for MultiJagged
impl Sync for MultiJagged
impl Unpin for MultiJagged
impl UnwindSafe for MultiJagged
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.