Struct lophat::columns::VecColumn

source ·
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 Clone for VecColumn

source§

fn clone(&self) -> VecColumn

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Column for VecColumn

source§

fn pivot(&self) -> Option<usize>

Returns the index of the lowest non-zero column, or None if the column is empty.
source§

fn add_col(&mut self, other: &Self)

Adds one copy of other into self
source§

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

Return whether or not entry appears with value 1 in the column
§

type EntriesIter<'a> = Copied<Iter<'a, usize>>

The output type of Self::entries
source§

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>

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 column
source§

fn set_entries(&mut self, entries: Self::EntriesRepr)

Efficiently override the column, by providing entries in the internal format.
source§

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)

Change column to provided dimension
source§

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 implementation
source§

fn new_with_dimension(dimension: usize) -> Self

Init an empty column with the given dimension
source§

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

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)

Uses Self::add_entry to add elements from the iterator to the column
source§

fn clear_entries(&mut self)

Removes all entries from the column
source§

impl Debug for VecColumn

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decomposition<VecColumn> for DecompositionFileFormat

§

type RColRef<'a> = &'a VecColumn where Self: 'a

Return type of get_r_col, typically &'a C.
source§

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 decomposition
§

type VColRef<'a> = &'a VecColumn where Self: 'a

Return type of get_v_col, typically &'a C.
source§

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

Returns the number of column in R (equal to the number of columns in D).
source§

fn diagram(&self) -> PersistenceDiagram

Uses the methods implemented by this trait to read-off the column pairings which constiute the persistence diagram.
source§

fn has_v(&self) -> bool

By checking whether self.get_v_col(0) returns an error, determines whether the V matrix was maintained for this decomposition.
source§

impl Default for VecColumn

source§

fn default() -> VecColumn

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for VecColumn

source§

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 From<(usize, Vec<usize>)> for VecColumn

source§

fn from((dimension, boundary): (usize, Vec<usize>)) -> Self

Constructs a VecColumn, from a tuple where boundary is the vector of non-zero indices, sorted in increasing order.

source§

impl PartialEq for VecColumn

source§

fn eq(&self, other: &VecColumn) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for VecColumn

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl StructuralPartialEq for VecColumn

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.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> Ungil for T
where T: Send,