TTK
Loading...
Searching...
No Matches
ripser.cpp File Reference
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <fstream>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <ripser.h>

Go to the source code of this file.

Classes

class  binomial_coeff_table
 
struct  diameter_entry_t
 
struct  greater_diameter_or_smaller_index< Entry >
 
class  compressed_distance_matrix< Layout >
 
struct  sparse_distance_matrix
 
struct  euclidean_distance_matrix
 
class  union_find
 
class  compressed_sparse_matrix< ValueType >
 
class  Ripser< DistanceMatrix >
 
class  Ripser< DistanceMatrix >::simplex_coboundary_enumerator
 

Macros

#define USE_COEFFICIENTS
 
#define PACK(...)
 

Typedefs

template<class Key, class T, class H, class E>
using hash_map = std::unordered_map<Key, T, H, E>
 
template<class Key>
using hash = std::hash<Key>
 
using diameter_index_t = std::pair<value_t, index_t>
 
using index_diameter_t = std::pair<index_t, value_t>
 
using compressed_lower_distance_matrix = compressed_distance_matrix<LOWER_TRIANGULAR>
 
using compressed_upper_distance_matrix = compressed_distance_matrix<UPPER_TRIANGULAR>
 

Enumerations

enum  compressed_matrix_layout : std::uint8_t { LOWER_TRIANGULAR , UPPER_TRIANGULAR }
 

Functions

void check_overflow (index_t i)
 
coefficient_t get_modulo (const coefficient_t val, const coefficient_t modulus)
 
coefficient_t normalize (const coefficient_t n, const coefficient_t modulus)
 
std::vector< coefficient_tmultiplicative_inverse_vector (const coefficient_t m)
 
 PACK (struct entry_t { index_t index :8 *sizeof(index_t) - num_coefficient_bits;index_t coefficient :num_coefficient_bits;entry_t(index_t _index, coefficient_t _coefficient) :index(_index), coefficient(_coefficient) { } entry_t(index_t _index) :index(_index), coefficient(0) { } entry_t() :index(0), coefficient(0) { } })
 
entry_t make_entry (index_t i, coefficient_t c)
 
index_t get_index (const entry_t &e)
 
index_t get_coefficient (const entry_t &e)
 
void set_coefficient (entry_t &e, const coefficient_t c)
 
std::ostream & operator<< (std::ostream &stream, const entry_t &e)
 
const entry_t & get_entry (const entry_t &e)
 
value_t get_diameter (const diameter_index_t &i)
 
index_t get_index (const diameter_index_t &i)
 
index_t get_index (const index_diameter_t &i)
 
value_t get_diameter (const index_diameter_t &i)
 
const entry_t & get_entry (const diameter_entry_t &p)
 
entry_t & get_entry (diameter_entry_t &p)
 
index_t get_index (const diameter_entry_t &p)
 
coefficient_t get_coefficient (const diameter_entry_t &p)
 
const value_tget_diameter (const diameter_entry_t &p)
 
void set_coefficient (diameter_entry_t &p, const coefficient_t c)
 
template<typename T>
begin (std::pair< T, T > &p)
 
template<typename T>
end (std::pair< T, T > &p)
 

Macro Definition Documentation

◆ PACK

#define PACK ( ...)
Value:
__VA_ARGS__ __attribute__((__packed__))

Definition at line 193 of file ripser.cpp.

◆ USE_COEFFICIENTS

#define USE_COEFFICIENTS

Definition at line 73 of file ripser.cpp.

Typedef Documentation

◆ compressed_lower_distance_matrix

◆ compressed_upper_distance_matrix

◆ diameter_index_t

using diameter_index_t = std::pair<value_t, index_t>

Definition at line 262 of file ripser.cpp.

◆ hash

template<class Key>
using hash = std::hash<Key>

Definition at line 94 of file ripser.cpp.

◆ hash_map

template<class Key, class T, class H, class E>
using hash_map = std::unordered_map<Key, T, H, E>

Definition at line 92 of file ripser.cpp.

◆ index_diameter_t

using index_diameter_t = std::pair<index_t, value_t>

Definition at line 272 of file ripser.cpp.

Enumeration Type Documentation

◆ compressed_matrix_layout

enum compressed_matrix_layout : std::uint8_t
Enumerator
LOWER_TRIANGULAR 
UPPER_TRIANGULAR 

Definition at line 334 of file ripser.cpp.

Function Documentation

◆ begin()

template<typename T>
T begin ( std::pair< T, T > & p)

Definition at line 499 of file ripser.cpp.

◆ check_overflow()

void check_overflow ( index_t i)

Definition at line 126 of file ripser.cpp.

◆ end()

template<typename T>
T end ( std::pair< T, T > & p)

Definition at line 503 of file ripser.cpp.

◆ get_coefficient() [1/2]

coefficient_t get_coefficient ( const diameter_entry_t & p)

Definition at line 315 of file ripser.cpp.

◆ get_coefficient() [2/2]

index_t get_coefficient ( const entry_t & e)

Definition at line 223 of file ripser.cpp.

◆ get_diameter() [1/3]

const value_t & get_diameter ( const diameter_entry_t & p)

Definition at line 318 of file ripser.cpp.

◆ get_diameter() [2/3]

value_t get_diameter ( const diameter_index_t & i)

Definition at line 265 of file ripser.cpp.

◆ get_diameter() [3/3]

value_t get_diameter ( const index_diameter_t & i)

Definition at line 278 of file ripser.cpp.

◆ get_entry() [1/3]

const entry_t & get_entry ( const diameter_entry_t & p)

Definition at line 306 of file ripser.cpp.

◆ get_entry() [2/3]

const entry_t & get_entry ( const entry_t & e)

Definition at line 258 of file ripser.cpp.

◆ get_entry() [3/3]

entry_t & get_entry ( diameter_entry_t & p)

Definition at line 309 of file ripser.cpp.

◆ get_index() [1/4]

index_t get_index ( const diameter_entry_t & p)

Definition at line 312 of file ripser.cpp.

◆ get_index() [2/4]

index_t get_index ( const diameter_index_t & i)

Definition at line 268 of file ripser.cpp.

◆ get_index() [3/4]

index_t get_index ( const entry_t & e)

Definition at line 220 of file ripser.cpp.

◆ get_index() [4/4]

index_t get_index ( const index_diameter_t & i)

Definition at line 275 of file ripser.cpp.

◆ get_modulo()

coefficient_t get_modulo ( const coefficient_t val,
const coefficient_t modulus )

Definition at line 167 of file ripser.cpp.

◆ make_entry()

entry_t make_entry ( index_t i,
coefficient_t c )

Definition at line 217 of file ripser.cpp.

◆ multiplicative_inverse_vector()

std::vector< coefficient_t > multiplicative_inverse_vector ( const coefficient_t m)

Definition at line 176 of file ripser.cpp.

◆ normalize()

coefficient_t normalize ( const coefficient_t n,
const coefficient_t modulus )

Definition at line 171 of file ripser.cpp.

◆ operator<<()

std::ostream & operator<< ( std::ostream & stream,
const entry_t & e )

Definition at line 230 of file ripser.cpp.

◆ PACK()

PACK ( struct entry_t { index_t index :8 *sizeof(index_t) - num_coefficient_bits;index_t coefficient :num_coefficient_bits;entry_t(index_t _index, coefficient_t _coefficient) :index(_index), coefficient(_coefficient) { } entry_t(index_t _index) :index(_index), coefficient(0) { } entry_t() :index(0), coefficient(0) { } } )

◆ set_coefficient() [1/2]

void set_coefficient ( diameter_entry_t & p,
const coefficient_t c )

Definition at line 321 of file ripser.cpp.

◆ set_coefficient() [2/2]

void set_coefficient ( entry_t & e,
const coefficient_t c )

Definition at line 226 of file ripser.cpp.