pub struct VecColumn { /* private fields */ }
Expand description
A column represented by an increasing vector of the non-zero indices.
To construct call VecColumn::from
or use VecColumn::new_with_dimension
and VecColumn::add_entries
Trait Implementations§
source§impl Column for VecColumn
impl Column for VecColumn
source§fn pivot(&self) -> Option<usize>
fn pivot(&self) -> Option<usize>
Returns the index of the lowest non-zero column, or
None
if the column is empty.source§fn add_entry(&mut self, entry: usize)
fn add_entry(&mut self, entry: usize)
Should be equivalent to
self.add_col(e_entry)
where e_entry
is the column
with all zeros except a 1 in index entry
.source§fn has_entry(&self, entry: &usize) -> bool
fn has_entry(&self, entry: &usize) -> bool
Return whether or not entry appears with value 1 in the column
§type EntriesIter<'a> = Copied<Iter<'a, usize>>
type EntriesIter<'a> = Copied<Iter<'a, usize>>
The output type of
Self::entries
source§fn entries<'a>(&'a self) -> Self::EntriesIter<'a>
fn entries<'a>(&'a self) -> Self::EntriesIter<'a>
Returns the entries of the columns as an iterator over the non-zero indices (not necessarily sorted)
§type EntriesRepr = Vec<usize>
type EntriesRepr = Vec<usize>
A format that the user can provide the entries of the column in, in order to efficiently construct the column.
The
Default
should correspond to the empty columnsource§fn set_entries(&mut self, entries: Self::EntriesRepr)
fn set_entries(&mut self, entries: Self::EntriesRepr)
Efficiently override the column, by providing entries in the internal format.
source§fn dimension(&self) -> usize
fn dimension(&self) -> usize
Return the dimension of this column (assuming the matrix represents a chain complex boundary matrix)
source§fn set_dimension(&mut self, dimension: usize)
fn set_dimension(&mut self, dimension: usize)
Change column to provided dimension
source§fn is_cycle(&self) -> bool
fn is_cycle(&self) -> bool
Returns whether or not the column is a cycle, i.e. has no entries.
Provided implementation makes call to
Self::pivot
.
You may wish to provide a more efficient implementationsource§fn new_with_dimension(dimension: usize) -> Self
fn new_with_dimension(dimension: usize) -> Self
Init an empty column with the given dimension
source§fn set_mode(&mut self, _mode: ColumnMode)
fn set_mode(&mut self, _mode: ColumnMode)
Change the underlying representation of the column to optimise it for the corresponding
mode
.
Only relevant for certain representations.source§fn is_boundary(&self) -> bool
fn is_boundary(&self) -> bool
Returns whether or not the column is a boundary, i.e. is non-empty.
Provided implementation negates
Self::is_cycle
source§fn add_entries<B: Iterator<Item = usize>>(&mut self, entries: B)
fn add_entries<B: Iterator<Item = usize>>(&mut self, entries: B)
Uses
Self::add_entry
to add elements from the iterator to the columnsource§fn clear_entries(&mut self)
fn clear_entries(&mut self)
Removes all entries from the column
source§impl Decomposition<VecColumn> for DecompositionFileFormat
impl Decomposition<VecColumn> for DecompositionFileFormat
source§fn get_r_col<'a>(&'a self, index: usize) -> Self::RColRef<'a>
fn get_r_col<'a>(&'a self, index: usize) -> Self::RColRef<'a>
Returns a reference to the column in position
index
of R, in the decompositionsource§fn get_v_col<'a>(
&'a self,
index: usize
) -> Result<Self::VColRef<'a>, NoVMatrixError>
fn get_v_col<'a>( &'a self, index: usize ) -> Result<Self::VColRef<'a>, NoVMatrixError>
Returns a reference to the column in position
index
of V, in the decomposition.
Returns NoVMatrixError
if V was not maintained by the algorithm.source§fn n_cols(&self) -> usize
fn n_cols(&self) -> usize
Returns the number of column in R (equal to the number of columns in D).
source§fn diagram(&self) -> PersistenceDiagram
fn diagram(&self) -> PersistenceDiagram
Uses the methods implemented by this trait to read-off the column pairings which constiute the persistence diagram.
source§impl<'de> Deserialize<'de> for VecColumn
impl<'de> Deserialize<'de> for VecColumn
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for VecColumn
impl PartialEq for VecColumn
impl StructuralPartialEq for VecColumn
Auto Trait Implementations§
impl RefUnwindSafe for VecColumn
impl Send for VecColumn
impl Sync for VecColumn
impl Unpin for VecColumn
impl UnwindSafe for VecColumn
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