pub struct FinitePartialOrder {
pub size: usize,
pub le: Vec<Vec<bool>>,
}Expand description
A partial order on a finite set, stored as an adjacency matrix.
Fields§
§size: usizeNumber of elements.
le: Vec<Vec<bool>>The order relation as a boolean matrix: le[i][j] = (i ≤ j).
Implementations§
Source§impl FinitePartialOrder
impl FinitePartialOrder
Sourcepub fn is_reflexive(&self) -> bool
pub fn is_reflexive(&self) -> bool
Check reflexivity: x ≤ x for all x.
Sourcepub fn is_antisymmetric(&self) -> bool
pub fn is_antisymmetric(&self) -> bool
Check antisymmetry: x ≤ y and y ≤ x implies x = y.
Sourcepub fn is_transitive(&self) -> bool
pub fn is_transitive(&self) -> bool
Check transitivity: x ≤ y and y ≤ z implies x ≤ z.
Sourcepub fn maximal_elements(&self) -> Vec<usize>
pub fn maximal_elements(&self) -> Vec<usize>
Find all maximal elements (elements with nothing strictly above them).
Sourcepub fn transitive_closure(&self) -> FinitePartialOrder
pub fn transitive_closure(&self) -> FinitePartialOrder
Compute the transitive closure using Floyd-Warshall.
Auto Trait Implementations§
impl Freeze for FinitePartialOrder
impl RefUnwindSafe for FinitePartialOrder
impl Send for FinitePartialOrder
impl Sync for FinitePartialOrder
impl Unpin for FinitePartialOrder
impl UnsafeUnpin for FinitePartialOrder
impl UnwindSafe for FinitePartialOrder
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