pub struct ChainComplex {
pub groups: Vec<GradedGroup>,
pub boundaries: Vec<Vec<Vec<i64>>>,
}Expand description
A chain complex C_• with integer boundary matrices.
groups[i] = C_i, boundaries[i] = d_{i+1}: C_{i+1} → C_i.
Fields§
§groups: Vec<GradedGroup>The chain groups.
boundaries: Vec<Vec<Vec<i64>>>Boundary matrices (one fewer than groups).
Implementations§
Source§impl ChainComplex
impl ChainComplex
Sourcepub fn add_boundary(&mut self, matrix: Vec<Vec<i64>>)
pub fn add_boundary(&mut self, matrix: Vec<Vec<i64>>)
Add a boundary matrix d_k.
Sourcepub fn betti_numbers(&self) -> Vec<i64>
pub fn betti_numbers(&self) -> Vec<i64>
Compute Betti numbers β_i = ker(d_i) − im(d_{i+1}).
Sourcepub fn compute_homology(&self) -> Vec<HomologyGroup>
pub fn compute_homology(&self) -> Vec<HomologyGroup>
Compute all homology groups H_n(C).
Sourcepub fn euler_characteristic(&self) -> i64
pub fn euler_characteristic(&self) -> i64
Euler characteristic χ = ∑_n (-1)^n β_n.
Sourcepub fn is_exact_at(&self, k: usize) -> bool
pub fn is_exact_at(&self, k: usize) -> bool
Check if the complex is exact at position k (H_k = 0).
Trait Implementations§
Source§impl Clone for ChainComplex
impl Clone for ChainComplex
Source§fn clone(&self) -> ChainComplex
fn clone(&self) -> ChainComplex
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChainComplex
impl Debug for ChainComplex
Source§impl Default for ChainComplex
impl Default for ChainComplex
Source§fn default() -> ChainComplex
fn default() -> ChainComplex
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChainComplex
impl RefUnwindSafe for ChainComplex
impl Send for ChainComplex
impl Sync for ChainComplex
impl Unpin for ChainComplex
impl UnsafeUnpin for ChainComplex
impl UnwindSafe for ChainComplex
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