Struct math::partition::integer_partitions::IntegerPartitions
source · pub struct IntegerPartitions<T: Copy + Integer + ToPrimitive> { /* private fields */ }
Expand description
A collection of disjoint integer intervals
Implementations§
source§impl<T: Copy + Integer + ToPrimitive> IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> IntegerPartitions<T>
pub fn new(partitions: Vec<Partition<T>>) -> IntegerPartitions<T>
pub fn num_partitions(&self) -> usize
sourcepub fn iter(&self) -> IntegerPartitionIter<T> ⓘ
pub fn iter(&self) -> IntegerPartitionIter<T> ⓘ
Creates an iterator that iterates through the partitions.
Trait Implementations§
source§impl<T: Clone + Copy + Integer + ToPrimitive> Clone for IntegerPartitions<T>
impl<T: Clone + Copy + Integer + ToPrimitive> Clone for IntegerPartitions<T>
source§fn clone(&self) -> IntegerPartitions<T>
fn clone(&self) -> IntegerPartitions<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T: Debug + Copy + Integer + ToPrimitive> Debug for IntegerPartitions<T>
impl<T: Debug + Copy + Integer + ToPrimitive> Debug for IntegerPartitions<T>
source§impl<T: Copy + Integer + ToPrimitive> Index<usize> for IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> Index<usize> for IntegerPartitions<T>
source§impl<T: PartialEq + Copy + Integer + ToPrimitive> PartialEq for IntegerPartitions<T>
impl<T: PartialEq + Copy + Integer + ToPrimitive> PartialEq for IntegerPartitions<T>
source§fn eq(&self, other: &IntegerPartitions<T>) -> bool
fn eq(&self, other: &IntegerPartitions<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq + Copy + Integer + ToPrimitive> Eq for IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> StructuralEq for IntegerPartitions<T>
impl<T: Copy + Integer + ToPrimitive> StructuralPartialEq for IntegerPartitions<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for IntegerPartitions<T>where
T: RefUnwindSafe,
impl<T> Send for IntegerPartitions<T>where
T: Send,
impl<T> Sync for IntegerPartitions<T>where
T: Sync,
impl<T> Unpin for IntegerPartitions<T>where
T: Unpin,
impl<T> UnwindSafe for IntegerPartitions<T>where
T: UnwindSafe,
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