[−][src]Struct analytic::set::ordered_integer_set::OrderedIntegerSet
An OrderedIntegerSet
consists of a sequence of ContiguousIntegerSet
that are sorted
in ascending order where successive intervals are not coalesceable, i.e. if intervals A and B
are successive intervals, then A.end + 1 < B.start
E.g. An OrderedIntegerSet
containing ContiguousIntegerSet
s [2,3] and [5,7] will represent the set of
integers {2, 3, 5, 6, 7}
Methods
impl<E: Integer + Copy + ToPrimitive> OrderedIntegerSet<E>
[src]
pub fn new() -> OrderedIntegerSet<E>
[src]
pub fn first(&self) -> Option<E>
[src]
Returns the smallest element in the set e.g. {[1,3], [4,8]} -> 1
pub fn last(&self) -> Option<E>
[src]
Returns the largest element in the set e.g. {[1,3], [4,8]} -> 8
pub fn first_and_last(&self) -> Option<(E, E)>
[src]
Returns both the smallest and the largest element in the set e.g. {[1,3], [4,8]} -> the tuple (1, 8)
pub fn slice<'a, I: Slicing<&'a OrderedIntegerSet<E>, OrderedIntegerSet<E>>>(
&'a self,
slicer: I
) -> OrderedIntegerSet<E>
[src]
&'a self,
slicer: I
) -> OrderedIntegerSet<E>
The slicer
can be any struct that implements the Slicing
trait.
For example, the Slicing
trait has been implemented for the Range<usize>
struct.
For an OrderedIntegerSet
containing n elements, the Range<usize>
object
created by a..b
will slice the integer set and return all the elements from the a-th (inclusive)
to the b-th (exclusive) in the form of an OrderedIntegerSet
pub fn from_slice(slice: &[[E; 2]]) -> OrderedIntegerSet<E>
[src]
Creates an OrderedIntegerSet
where the i-th interval is represented by
the i-th two-element array in slice
.
E.g. [[2, 3], [5, 7]] will create an OrderedIntegerSet
representing {2, 3, 5, 6, 7}, where
the contiguous integers are stored as ContiguousIntegerSet
s
Note that the intervals in the slice
parameters do not have to be sorted or non-overlapping.
pub fn from_contiguous_integer_sets(
sets: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntegerSet<E>
[src]
sets: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntegerSet<E>
pub fn from_ordered_coalesced_contiguous_integer_sets(
sets: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntegerSet<E>
[src]
sets: Vec<ContiguousIntegerSet<E>>
) -> OrderedIntegerSet<E>
pub fn to_non_empty_intervals(&self) -> Self
[src]
pub fn into_non_empty_intervals(self) -> Self
[src]
pub fn remove_empty_intervals(&mut self)
[src]
pub fn get_intervals_by_ref(&self) -> &Vec<ContiguousIntegerSet<E>>
[src]
pub fn into_intervals(self) -> Vec<ContiguousIntegerSet<E>>
[src]
pub fn intervals_iter(&self) -> Iter<ContiguousIntegerSet<E>>
[src]
pub fn num_intervals(&self) -> usize
[src]
Trait Implementations
impl<E: Integer + Copy + ToPrimitive> CoalesceIntervals<ContiguousIntegerSet<E>, E> for OrderedIntegerSet<E>
[src]
fn to_coalesced_intervals(&self) -> Vec<ContiguousIntegerSet<E>>
[src]
fn coalesce_intervals_inplace(&mut self)
[src]
fn into_coalesced(self) -> Self
[src]
impl<'_, E: Integer + Copy + ToPrimitive> Sample<'_, ContiguousIntegerSetIter<E>, E, OrderedIntegerSet<E>> for ContiguousIntegerSet<E>
[src]
fn sample_subset_without_replacement<'s: 'a>(
&'s self,
size: usize
) -> Result<O, String>
[src]
&'s self,
size: usize
) -> Result<O, String>
samples size
elements without replacement size
: the number of samples to be drawn returns Err if size
is larger than the population size Read more
impl<'_, E: Integer + Copy + ToPrimitive + Sum> Sample<'_, IntegerSetIter<E>, E, OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn sample_subset_without_replacement<'s: 'a>(
&'s self,
size: usize
) -> Result<O, String>
[src]
&'s self,
size: usize
) -> Result<O, String>
samples size
elements without replacement size
: the number of samples to be drawn returns Err if size
is larger than the population size Read more
impl<'_, E: Integer + Copy + FromPrimitive + ToPrimitive + Debug> Slicing<&'_ OrderedIntegerSet<E>, OrderedIntegerSet<E>> for Range<usize>
[src]
fn slice(self, input: &OrderedIntegerSet<E>) -> OrderedIntegerSet<E>
[src]
the end
index is exclusive
impl<E: Integer + Copy + ToPrimitive> Set<E, OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn is_empty(&self) -> bool
[src]
fn contains(&self, item: E) -> bool
[src]
fn intersect(&self, other: &OrderedIntegerSet<E>) -> OrderedIntegerSet<E>
[src]
impl<E: Integer + Copy + Sum + ToPrimitive> Finite for OrderedIntegerSet<E>
[src]
impl<E: Integer + Copy + ToPrimitive> Constructable for OrderedIntegerSet<E>
[src]
fn new() -> OrderedIntegerSet<E>
[src]
impl<E: Integer + Copy + ToPrimitive> Collecting<E> for OrderedIntegerSet<E>
[src]
impl<'_, E: Integer + Copy + ToPrimitive> ToIterator<'_, IntegerSetIter<E>, E> for OrderedIntegerSet<E>
[src]
ⓘImportant traits for IntegerSetIter<E>fn to_iter(&self) -> IntegerSetIter<E>
[src]
impl<E: Integer + Copy + ToPrimitive> From<Vec<ContiguousIntegerSet<E>>> for OrderedIntegerSet<E>
[src]
fn from(intervals: Vec<ContiguousIntegerSet<E>>) -> OrderedIntegerSet<E>
[src]
impl<E: Integer + Copy + ToPrimitive> From<OrderedIntegerSet<E>> for IntegerSetIter<E>
[src]
ⓘImportant traits for IntegerSetIter<E>fn from(ordered_integer_set: OrderedIntegerSet<E>) -> IntegerSetIter<E>
[src]
impl<E: Clone + Integer + Copy + ToPrimitive> Clone for OrderedIntegerSet<E>
[src]
fn clone(&self) -> OrderedIntegerSet<E>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<E: PartialEq + Integer + Copy + ToPrimitive> PartialEq<OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn eq(&self, other: &OrderedIntegerSet<E>) -> bool
[src]
fn ne(&self, other: &OrderedIntegerSet<E>) -> bool
[src]
impl<E: Debug + Integer + Copy + ToPrimitive> Debug for OrderedIntegerSet<E>
[src]
impl<'_, E: Integer + Copy + ToPrimitive> Sub<&'_ ContiguousIntegerSet<E>> for OrderedIntegerSet<E>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: &ContiguousIntegerSet<E>) -> Self::Output
[src]
impl<E: Integer + Copy + ToPrimitive> Sub<ContiguousIntegerSet<E>> for OrderedIntegerSet<E>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: ContiguousIntegerSet<E>) -> Self::Output
[src]
impl<'_, E: Integer + Copy + ToPrimitive> Sub<&'_ OrderedIntegerSet<E>> for ContiguousIntegerSet<E>
[src]
type Output = OrderedIntegerSet<E>
The resulting type after applying the -
operator.
fn sub(self, rhs: &OrderedIntegerSet<E>) -> Self::Output
[src]
impl<E: Integer + Copy + ToPrimitive> Sub<OrderedIntegerSet<E>> for ContiguousIntegerSet<E>
[src]
type Output = OrderedIntegerSet<E>
The resulting type after applying the -
operator.
fn sub(self, rhs: OrderedIntegerSet<E>) -> Self::Output
[src]
impl<'_, E: Integer + Copy + ToPrimitive> Sub<&'_ OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: &OrderedIntegerSet<E>) -> Self::Output
[src]
impl<E: Integer + Copy + ToPrimitive> Sub<OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
type Output = Self
The resulting type after applying the -
operator.
fn sub(self, rhs: OrderedIntegerSet<E>) -> Self::Output
[src]
impl<'_, E: Integer + Copy + ToPrimitive> SubAssign<&'_ ContiguousIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn sub_assign(&mut self, rhs: &ContiguousIntegerSet<E>)
[src]
impl<E: Integer + Copy + ToPrimitive> SubAssign<ContiguousIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn sub_assign(&mut self, rhs: ContiguousIntegerSet<E>)
[src]
impl<'_, E: Integer + Copy + ToPrimitive> SubAssign<&'_ OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn sub_assign(&mut self, rhs: &OrderedIntegerSet<E>)
[src]
impl<E: Integer + Copy + ToPrimitive> SubAssign<OrderedIntegerSet<E>> for OrderedIntegerSet<E>
[src]
fn sub_assign(&mut self, rhs: OrderedIntegerSet<E>)
[src]
Auto Trait Implementations
impl<E> Unpin for OrderedIntegerSet<E> where
E: Unpin,
E: Unpin,
impl<E> Send for OrderedIntegerSet<E> where
E: Send,
E: Send,
impl<E> Sync for OrderedIntegerSet<E> where
E: Sync,
E: Sync,
impl<E> RefUnwindSafe for OrderedIntegerSet<E> where
E: RefUnwindSafe,
E: RefUnwindSafe,
impl<E> UnwindSafe for OrderedIntegerSet<E> where
E: UnwindSafe,
E: UnwindSafe,
Blanket Implementations
impl<T> HasCardinality for T where
T: Countable,
[src]
T: Countable,
fn get_cardinality(&Self) -> Cardinality
[src]
impl<T> Countable for T where
T: Finite,
[src]
T: Finite,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut 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>,