[−][src]Struct analytic::partition::ordered_interval_partitions::OrderedIntervalPartitions
Methods
impl<E: Integer + Copy> OrderedIntervalPartitions<E>[src]
pub fn from_vec(
partitions: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntervalPartitions<E>[src]
partitions: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntervalPartitions<E>
pub fn from_vec_with_trusted_order(
partitions: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntervalPartitions<E>[src]
partitions: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntervalPartitions<E>
pub fn from_slice(slice: &[[E; 2]]) -> OrderedIntervalPartitions<E>[src]
pub fn num_partitions(&self) -> usize[src]
pub fn get_partitions_by_ref(&self) -> &Vec<ContiguousIntegerSet<E>>[src]
pub fn into_vec(self) -> Vec<ContiguousIntegerSet<E>>[src]
impl<E: Integer + Copy + Hash> OrderedIntervalPartitions<E>[src]
pub fn get_partition_containing(
&self,
subinterval: &ContiguousIntegerSet<E>
) -> Option<(usize, ContiguousIntegerSet<E>)>[src]
&self,
subinterval: &ContiguousIntegerSet<E>
) -> Option<(usize, ContiguousIntegerSet<E>)>
if there is a partition containing the subinterval, returns a tuple (partition_index, partition)
Trait Implementations
impl<E: Integer + Copy> Refineable<OrderedIntervalPartitions<E>> for OrderedIntervalPartitions<E>[src]
fn get_common_refinement(
&self,
other: &OrderedIntervalPartitions<E>
) -> OrderedIntervalPartitions<E>[src]
&self,
other: &OrderedIntervalPartitions<E>
) -> OrderedIntervalPartitions<E>
Example
use analytic::partition::ordered_interval_partitions::OrderedIntervalPartitions; use analytic::set::traits::Refineable; use analytic::set::ordered_integer_set::ContiguousIntegerSet; let p1 = OrderedIntervalPartitions::from_slice(&[[-1, 4], [8, 10]]); let p2 = OrderedIntervalPartitions::from_slice(&[[3, 7]]); assert_eq!(p1.get_common_refinement(&p2).into_vec(), [[-1, 2], [3, 4], [5, 7], [8, 10]] .iter() .map(|[a, b]| ContiguousIntegerSet::new(*a, *b)) .collect::<Vec<ContiguousIntegerSet<i32>>>());
Auto Trait Implementations
impl<E> Unpin for OrderedIntervalPartitions<E> where
E: Unpin,
E: Unpin,
impl<E> Sync for OrderedIntervalPartitions<E> where
E: Sync,
E: Sync,
impl<E> Send for OrderedIntervalPartitions<E> where
E: Send,
E: Send,
impl<E> UnwindSafe for OrderedIntervalPartitions<E> where
E: UnwindSafe,
E: UnwindSafe,
impl<E> RefUnwindSafe for OrderedIntervalPartitions<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for T[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,