pub struct CwComplex {
pub cells: HashMap<(usize, usize), CwCell>,
pub max_dim: usize,
}Expand description
A CW complex represented by its cells, organised by dimension.
Provides access to the cellular chain complex boundary operators and the Euler characteristic.
Fields§
§cells: HashMap<(usize, usize), CwCell>All cells, keyed by (dim, id).
max_dim: usizeMaximum cell dimension.
Implementations§
Source§impl CwComplex
impl CwComplex
Sourcepub fn cells_of_dim(&self, dim: usize) -> Vec<&CwCell>
pub fn cells_of_dim(&self, dim: usize) -> Vec<&CwCell>
Return all cells of dimension dim, sorted by id.
Sourcepub fn euler_characteristic(&self) -> i64
pub fn euler_characteristic(&self) -> i64
Euler characteristic χ = Σ_k (-1)^k |C_k|.
Sourcepub fn boundary_matrix(&self, k: usize) -> Vec<Vec<i32>>
pub fn boundary_matrix(&self, k: usize) -> Vec<Vec<i32>>
Boundary operator ∂k : C_k → C{k-1} as integer matrix.
Rows index (k-1)-cells, columns index k-cells (both sorted by id). Entry [i, j] = sign of the incidence of the i-th (k-1)-cell in ∂(e_j).
Sourcepub fn standard_tetrahedron() -> Self
pub fn standard_tetrahedron() -> Self
Build a standard simplicial tetrahedron (4 vertices, 6 edges, 4 faces, 1 3-cell).
Sourcepub fn standard_sphere_s2() -> Self
pub fn standard_sphere_s2() -> Self
Build a standard 2-sphere (two hemispheres, equatorial circle).
Sourcepub fn standard_torus() -> Self
pub fn standard_torus() -> Self
Build a standard torus T² as a CW complex. 1 vertex, 2 edges (a and b), 1 face.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CwComplex
impl RefUnwindSafe for CwComplex
impl Send for CwComplex
impl Sync for CwComplex
impl Unpin for CwComplex
impl UnsafeUnpin for CwComplex
impl UnwindSafe for CwComplex
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.