pub struct IntegerSet { /* private fields */ }Expand description
A finite set of i64 values stored as sorted, disjoint inclusive ranges. JSON endpoints are decimal strings; loading rejects noncanonical ranges.
Implementations§
Source§impl IntegerSet
impl IntegerSet
pub fn empty() -> Self
Sourcepub fn interval(lower: i64, upper: i64) -> Self
pub fn interval(lower: i64, upper: i64) -> Self
A reversed interval denotes the empty set, as in MiniZinc.
pub fn from_values(values: impl IntoIterator<Item = i64>) -> Self
pub fn minimum(&self) -> Option<i64>
pub fn maximum(&self) -> Option<i64>
pub fn hull(&self) -> Self
pub fn is_convex(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn contains(&self, value: i64) -> bool
pub fn is_subset(&self, other: &Self) -> bool
pub fn union(&self, other: &Self) -> Self
pub fn intersection(&self, other: &Self) -> Self
pub fn difference(&self, other: &Self) -> Self
pub fn symmetric_difference(&self, other: &Self) -> Self
pub fn is_disjoint(&self, other: &Self) -> bool
Sourcepub fn lex_cmp(&self, other: &Self) -> Ordering
pub fn lex_cmp(&self, other: &Self) -> Ordering
Compare the sorted element sequences, skipping each shared interval.
Sourcepub fn characteristic_cmp(&self, other: &Self) -> Ordering
pub fn characteristic_cmp(&self, other: &Self) -> Ordering
Gecode compares membership bits from the smallest differing element: 0 < 1.
Sourcepub fn cardinality(&self) -> Option<i64>
pub fn cardinality(&self) -> Option<i64>
None means the mathematical cardinality exceeds i64::MAX.
Trait Implementations§
Source§impl Clone for IntegerSet
impl Clone for IntegerSet
Source§impl Debug for IntegerSet
impl Debug for IntegerSet
Source§impl Default for IntegerSet
impl Default for IntegerSet
Source§impl<'de> Deserialize<'de> for IntegerSet
impl<'de> Deserialize<'de> for IntegerSet
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for IntegerSet
impl Display for IntegerSet
impl Eq for IntegerSet
Source§impl PartialEq for IntegerSet
impl PartialEq for IntegerSet
Source§impl Serialize for IntegerSet
impl Serialize for IntegerSet
impl StructuralPartialEq for IntegerSet
Auto Trait Implementations§
impl Freeze for IntegerSet
impl RefUnwindSafe for IntegerSet
impl Send for IntegerSet
impl Sync for IntegerSet
impl Unpin for IntegerSet
impl UnsafeUnpin for IntegerSet
impl UnwindSafe for IntegerSet
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