cocycle 0.1.1

Topological data analysis in pure Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::Result;

/// Internal contract for a finite F2 filtered chain complex.
///
/// Values are finite and nondecreasing. A boundary contains sorted, distinct
/// indices smaller than the current index, each of dimension one lower. The
/// boundary operator squares to zero. Implementors establish these properties;
/// reduction does not revalidate the whole complex on each column access.
pub(in crate::persistence) trait FilteredBoundary {
    fn len(&self) -> usize;
    fn dimension(&self, index: usize) -> usize;
    fn value(&self, index: usize) -> f64;
    /// Replace the buffer's contents, retaining its capacity when possible.
    fn write_boundary(&self, index: usize, output: &mut Vec<usize>) -> Result<()>;
}