Skip to main content

CubicalComplex

Struct CubicalComplex 

Source
pub struct CubicalComplex { /* private fields */ }
Expand description

A cubical complex, stored as the cells of each dimension 0..=dim.

Implementations§

Source§

impl CubicalComplex

Source

pub fn from_top_cells(top: Vec<Cube>) -> Self

Build from filled top-dimensional cells, taking the downward closure (all faces of all faces).

Source

pub fn progress(lengths: &[usize], forbidden: &[Vec<usize>]) -> Self

The progress complex of d processes with the given step lengths: every grid d-cell is filled, except those in forbidden (the mutual-exclusion / synchronization region).

Source

pub fn dim(&self) -> usize

Source

pub fn num_cells(&self, k: usize) -> usize

Source

pub fn betti(&self) -> Vec<usize>

The Betti vector (β₀, …, β_d): β_k = #C_k − rank ∂_k − rank ∂_{k+1} over GF(2).

Source

pub fn euler(&self) -> i64

χ = Σ (−1)^k #C_k — the alternating cell count, equal to Σ (−1)^k β_k (Euler–Poincaré).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.