| 1 |
/* This file is part of the Gudhi Library - https://gudhi.inria.fr/ - which is released under MIT. |
| 2 |
* See file LICENSE or go to https://gudhi.inria.fr/licensing/ for full license details. |
| 3 |
* Author(s): Clément Maria |
| 4 |
* |
| 5 |
* Copyright (C) 2014 Inria |
| 6 |
* |
| 7 |
* Modification(s): |
| 8 |
* - YYYY/MM Author: Description of the modification |
| 9 |
*/ |
| 10 |
|
| 11 |
/** \brief The concept FilteredComplex describes the requirements |
| 12 |
* for a type to implement a filtered cell complex, from which |
| 13 |
* one can compute persistent homology via a model of the concept |
| 14 |
* PersistentHomology. |
| 15 |
*/ |
| 16 |
struct FilteredComplex |
| 17 |
{ |
| 18 |
/** \brief Handle to specify a simplex. */ |
| 19 |
typedef unspecified Simplex_handle; |
| 20 |
/** \brief Type for the value of the filtration function. |
| 21 |
* |
| 22 |
* Must be comparable with <. */ |
| 23 |
typedef unspecified Filtration_value; |
| 24 |
|
| 25 |
/** \brief Specifies the nature of the indexing scheme. |
| 26 |
* |
| 27 |
* is model of IndexingTag. */ |
| 28 |
typedef unspecified Indexing_tag; |
| 29 |
|
| 30 |
/** \brief Returns a Simplex_handle that is different from all simplex handles of the simplices. */ |
| 31 |
Simplex_handle null_simplex(); |
| 32 |
/** \brief Returns the number of simplices in the complex. |
| 33 |
* |
| 34 |
* Does not count the empty simplex. */ |
| 35 |
size_t num_simplices(); |
| 36 |
/** \brief Returns the dimension of a simplex. */ |
| 37 |
int dimension(Simplex_handle sh); |
| 38 |
/** \brief Returns the filtration value of a simplex. |
| 39 |
* |
| 40 |
* If sh is null_simplex(), returns the maximal value of the |
| 41 |
* filtration function on the complex. */ |
| 42 |
Filtration_value filtration(Simplex_handle sh); |
| 43 |
|
| 44 |
/** \brief Returns the simplex that has index idx in the filtration. |
| 45 |
* |
| 46 |
* This is only called on valid indices. */ |
| 47 |
Simplex_handle simplex ( size_t idx ); |
| 48 |
/** \brief Iterator on the simplices belonging to the boundary of a simplex. |
| 49 |
* |
| 50 |
* <CODE>value_type</CODE> must be 'Simplex_handle'. |
| 51 |
*/ |
| 52 |
typedef unspecified Boundary_simplex_iterator; |
| 53 |
/** \brief Range giving access to the simplices in the boundary of a simplex. |
| 54 |
* |
| 55 |
* .begin() and .end() return type Boundary_simplex_iterator. |
| 56 |
*/ |
| 57 |
typedef unspecified Boundary_simplex_range; |
| 58 |
|
| 59 |
/** \brief Returns a range giving access to all simplices of the boundary of a simplex, i.e. the set of codimension 1 |
| 60 |
* subsimplices of the Simplex. |
| 61 |
* |
| 62 |
* If the simplex is \f$[v_0, \cdots ,v_d]\f$, with canonical orientation |
| 63 |
* induced by \f$ v_0 < \cdots < v_d \f$, the iterator enumerates the |
| 64 |
* simplices of the boundary in the order: |
| 65 |
* \f$[v_0,\cdots,\widehat{v_i},\cdots,v_d]\f$ for \f$i\f$ from 0 to d |
| 66 |
* |
| 67 |
* We note that the alternate sum of the simplices given by the iterator |
| 68 |
* gives the chains corresponding to the boundary of the simplex.*/ |
| 69 |
Boundary_simplex_range boundary_simplex_range(Simplex_handle sh); |
| 70 |
|
| 71 |
/** \brief Iterator over all simplices of the complex in the order of the indexing scheme. |
| 72 |
* |
| 73 |
* 'value_type' must be 'Simplex_handle'. |
| 74 |
*/ |
| 75 |
typedef unspecified Filtration_simplex_iterator; |
| 76 |
/** \brief Range over the simplices of the complex in the order of the filtration. |
| 77 |
* |
| 78 |
* .begin() and .end() return type Filtration_simplex_iterator.*/ |
| 79 |
typedef unspecified Filtration_simplex_range; |
| 80 |
/** \brief Returns a range over the simplices of the complex in the order of the filtration. |
| 81 |
* |
| 82 |
* .begin() and .end() return type Filtration_simplex_iterator.*/ |
| 83 |
Filtration_simplex_range filtration_simplex_range(); |
| 84 |
|
| 85 |
/** \name Map interface |
| 86 |
* Conceptually a `std::unordered_map<Simplex_handle,std::size_t>`. |
| 87 |
* @{ */ |
| 88 |
/** \brief Data stored for each simplex. |
| 89 |
* |
| 90 |
* Must be an integer type. */ |
| 91 |
typedef unspecified Simplex_key; |
| 92 |
/** \brief Returns a constant dummy number that is either negative, |
| 93 |
* or at least as large as `num_simplices()`. Suggested value: -1. */ |
| 94 |
Simplex_key null_key (); |
| 95 |
/** \brief Returns the number stored for a simplex by `assign_key`. |
| 96 |
* |
| 97 |
* This is never called on null_simplex(). */ |
| 98 |
Simplex_key key ( Simplex_handle sh ); |
| 99 |
/** \brief Store a number for a simplex, which can later be retrieved with `key(sh)`. |
| 100 |
* |
| 101 |
* This is never called on null_simplex(). */ |
| 102 |
void assign_key(Simplex_handle sh, Simplex_key n); |
| 103 |
/** @} */ |
| 104 |
|
| 105 |
|
| 106 |
/** \brief Iterator over the simplices of the complex, |
| 107 |
* in an arbitrary order. |
| 108 |
* |
| 109 |
* 'value_type' must be 'Simplex_handle'.*/ |
| 110 |
//typedef unspecified Complex_simplex_iterator; |
| 111 |
//typedef unspecified Complex_simplex_range; |
| 112 |
|
| 113 |
/* |
| 114 |
* Returns a range over all the simplices of a |
| 115 |
* complex. |
| 116 |
*/ |
| 117 |
//Complex_simplex_range complex_simplex_range(); |
| 118 |
|
| 119 |
/*************************************************/ /** |
| 120 |
* @details Compares the filtration values of simplices s and t |
| 121 |
* |
| 122 |
* @return -1 if s comes before t in the filtration, +1 |
| 123 |
* if it comes later, and 0 if they come at the same time |
| 124 |
* |
| 125 |
* @note OPTIONAL |
| 126 |
* @todo use an enum? Just a bool? |
| 127 |
*/ |
| 128 |
//int is_before_in_filtration(Simplex_handle s, Simplex_handle t); |
| 129 |
/*************************************************/ |
| 130 |
|
| 131 |
}; |