pub struct FiniteLinearOrder {
pub size: usize,
pub order: Vec<usize>,
}Expand description
A finite linear order (totally ordered finite set).
Elements are represented as indices 0..n, with a permutation defining the order.
Fields§
§size: usizeNumber of elements.
order: Vec<usize>The permutation defining the order: order[i] is the i-th smallest element.
Implementations§
Source§impl FiniteLinearOrder
impl FiniteLinearOrder
Sourcepub fn from_permutation(perm: Vec<usize>) -> Option<Self>
pub fn from_permutation(perm: Vec<usize>) -> Option<Self>
Create a linear order from a permutation.
Sourcepub fn compare(&self, a: usize, b: usize) -> Ordering
pub fn compare(&self, a: usize, b: usize) -> Ordering
Compare two elements a, b (by their rank in the order).
Sourcepub fn is_well_founded(&self) -> bool
pub fn is_well_founded(&self) -> bool
Check if the order is well-founded (always true for finite sets).
Sourcepub fn reverse_order(&self) -> FiniteLinearOrder
pub fn reverse_order(&self) -> FiniteLinearOrder
Reverse the order.
Auto Trait Implementations§
impl Freeze for FiniteLinearOrder
impl RefUnwindSafe for FiniteLinearOrder
impl Send for FiniteLinearOrder
impl Sync for FiniteLinearOrder
impl Unpin for FiniteLinearOrder
impl UnsafeUnpin for FiniteLinearOrder
impl UnwindSafe for FiniteLinearOrder
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