Mackey  V3.1
A C++ library for computing RO(G) graded homology
AMT< diff_t > Class Template Reference

#include <Morse.hpp>

Inheritance diagram for AMT< diff_t >:
[legend]

Public Member Functions

const auto & original_to_reduced () const
 Returns vector of "change of basis" matrices from the original to the reduced basis. More...
 
const auto & reduced_to_original () const
 Returns vector of "change of basis" matrices from the reduced to the original basis. More...
 
double reduction_ratio () const
 Returns the average compression ratio as a double in [0,1]. Ideally as close to 0 as possible. More...
 
 AMT (std::vector< diff_t > &A, bool compute_original_to_reduced, bool compute_reduced_to_original)
 Constructor that reduces. More...
 

Protected Types

typedef diff_t::StorageIndex ind
 The storage type of the differential matrices (eg size_t) More...
 
typedef diff_t::Scalar scalar_t
 The scalar type of the differential matrices (eg int or Z2) More...
 
typedef Eigen::SparseMatrix< scalar_t, 1, indrow_major_t
 The type of row major of the differential matrices (eg size_t) More...
 

Protected Member Functions

 AMT (std::vector< diff_t > &A, bool compute_original_to_reduced, bool compute_reduced_to_original, bool onlyresize)
 Constructor that allows only to resize. More...
 
void reduce ()
 Performs the reduction and sets the "change of basis" f,g. More...
 
void find_Morse_matching (int k, bool normalize)
 Sets the morse matchiing and normalizes diff if normalize=1 (this speeds up the AMT algorithm) More...
 
void normalize (int k)
 Normalize diff if not done in find_Morse_matching. More...
 
void erase_matchings (int k, const std::vector< std::pair< ind, ind >> &toremove)
 Erase the given morse matchings (eg if they are not equivariant). More...
 

Protected Attributes

std::vector< diff_t > & diff
 The reduced differential. More...
 
std::vector< std::map< ind, ind > > morse
 The morse matching. More...
 
std::vector< std::vector< ind > > critical
 The critical basis elements. More...
 

Detailed Description

template<typename diff_t>
class Mackey::AMT< diff_t >

Reduces given chain complex to a homotopy equivalent one but ideally smaller, using Algebraic Morse Theory

The constructor performs the computation and modifies the chain complex in place to avoid copies. If you need the original chain complex please store it before passing it here.

Member Typedef Documentation

◆ ind

typedef diff_t::StorageIndex ind
protected

The storage type of the differential matrices (eg size_t)

◆ scalar_t

typedef diff_t::Scalar scalar_t
protected

The scalar type of the differential matrices (eg int or Z2)

◆ row_major_t

typedef Eigen::SparseMatrix<scalar_t, 1, ind> row_major_t
protected

The type of row major of the differential matrices (eg size_t)

Constructor & Destructor Documentation

◆ AMT() [1/2]

AMT ( std::vector< diff_t > &  A,
bool  compute_original_to_reduced,
bool  compute_reduced_to_original 
)

Constructor that reduces.

◆ AMT() [2/2]

AMT ( std::vector< diff_t > &  A,
bool  compute_original_to_reduced,
bool  compute_reduced_to_original,
bool  onlyresize 
)
protected

Constructor that allows only to resize.

Member Function Documentation

◆ original_to_reduced()

const auto& original_to_reduced ( ) const

Returns vector of "change of basis" matrices from the original to the reduced basis.

◆ reduced_to_original()

const auto& reduced_to_original ( ) const

Returns vector of "change of basis" matrices from the reduced to the original basis.

◆ reduction_ratio()

double reduction_ratio ( ) const

Returns the average compression ratio as a double in [0,1]. Ideally as close to 0 as possible.

◆ reduce()

void reduce ( )
protected

Performs the reduction and sets the "change of basis" f,g.

◆ find_Morse_matching()

void find_Morse_matching ( int  k,
bool  normalize 
)
protected

Sets the morse matchiing and normalizes diff if normalize=1 (this speeds up the AMT algorithm)

◆ normalize()

void normalize ( int  k)
protected

Normalize diff if not done in find_Morse_matching.

◆ erase_matchings()

void erase_matchings ( int  k,
const std::vector< std::pair< ind, ind >> &  toremove 
)
protected

Erase the given morse matchings (eg if they are not equivariant).

Member Data Documentation

◆ diff

std::vector<diff_t>& diff
protected

The reduced differential.

◆ morse

std::vector<std::map<ind, ind> > morse
protected

The morse matching.

◆ critical

std::vector<std::vector<ind> > critical
protected

The critical basis elements.


The documentation for this class was generated from the following file: