template<typename Obj, template<typename> typename Mor, typename Coeff>
Complex_Base class

base class for complexes

A complex consists of a list objects of objects, a matrix diffs of morphisms that defines a differential and a list cancelled_indices of cancelled indices.

Derived classes

template<typename Obj, template<typename> typename Mor, typename Coeff>
class Complex
generic child of Complex_Base

Constructors, destructors, conversion operators

constructor of zero object in the category of complexes
Complex_Base(std::vector<Obj> objects, Eigen::SparseMatrix<Mor<Coeff>> diffs)
standard constructor

Public functions

void cancel()
computes fully reduced complex obtained by repeated application of the Cancellation Lemma from [4]
void cancel(const ssize_t& sourceindex, const ssize_t& targetindex)
implements the Cancellation Lemma from [4] for a single component of the differential
auto check() const -> bool
true if the components of the differential d are well-defined and d²=0. Otherwise, this function will give a warning.
auto find_invertible() -> std::pair<int, int>
component of the differential to which one can apply the Cancellation Lemma from [4]; if there is no such component, this returns (n,n), where n is the number of objects in the complex
auto get_cancelled_indices() const -> std::list<unsigned int>
list of cancelled indices
auto get_diffs() const -> Eigen::SparseMatrix<Mor<Coeff>>
Eigen matrix defining the differential.
auto get_objects() const -> std::vector<Obj>
list of objects in the complex
void isotopy(const ssize_t& start, const ssize_t& end, const Mor<Coeff>& mor)
implements the Clean-Up Lemma from [4], ie performs a basic isotopy along start—(mor)—>end
void print(const ssize_t& index_from, const ssize_t& index_to) const
print a component of the differential of a complex in terminal
void resize()
resizes the list of objects and matrix of differentials according to the list of cancelled indices
auto to_string() const -> std::string
string representative of a complex

Protected variables

std::list<unsigned int> cancelled_indices
list of cancelled indices, which is empty by default; cancel() adds the indices of the cancelled generators, but keeps objects and diffs intact; resize() then actually deletes the objects and resizes diffs according to this list.
Eigen::SparseMatrix<Mor<Coeff>> diffs
matrix defining the differential of the complex
std::vector<Obj> objects
list of objects of the complex (corresponds to the underlying 'chain module')
size_t start_find_invertible
starting index for finding invertible generators