diff options
Diffstat (limited to 'src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h')
-rw-r--r-- | src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h index 6a1ff3ff..e8eee3d2 100644 --- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h +++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h @@ -32,7 +32,8 @@ #include <algorithm> #include <iterator> #include <limits> -#include <utility> // for pair<> +#include <utility> +#include <stdexcept> namespace Gudhi { @@ -120,14 +121,23 @@ class Bitmap_cubical_complex_base { **/ virtual inline std::vector< size_t > get_coboundary_of_a_cell(size_t cell)const; - /** - * This procedure compute incidence numbers between cells. For a cell A of - * dimension n and a cell B \subset A of dimension n-1, an incidence - * between A and B is the integer with which B appears in the boundary of A. - * Note that first parameter is a cell of dimension n, - * and the second parameter is an adjusted cell in dimension n-1. + /** + * This procedure compute incidence numbers between cubes. For a cube \f$A\f$ of + * dimension n and a cube \f$B \subset A\f$ of dimension n-1, an incidence + * between \f$A\f$ and \f$B\f$ is the integer with which \f$B\f$ appears in the boundary of \f$A\f$. + * Note that first parameter is a cube of dimension n, + * and the second parameter is an adjusted cube in dimension n-1. + * Given \f$A = [b_1,e_1] \times \ldots \ [b_{j-1},e_{j-1}] \times [b_{j},e_{j}] \times [b_{j+1},e_{j+1}] \times \ldots \times [b_{n},e_{n}] \f$ + * and \f$B = [b_1,e_1] \times \ldots \ [b_{j-1},e_{j-1}] \times [a,a] \times [b_{j+1},e_{j+1}] \times \ldots \times [b_{n},e_{n}] c + * where \f$ a = b_{j}\f$ or \f$ a = e_{j}\f$, the incidence between \f$A\f$ and \f$B\f$ + * computed by this procedure is given by formula: + * \f$ c\ (-1)^{\sum_{i=1}^{j-1}} dim [b_{i},e_{i}] \f$ + * Where \f$ dim [b_{i},e_{i}] = 0 \f$ if \f$ b_{i}=e_{i} \f$ and 1 in other case. + * c is -1 if \f$ a = b_{j}\f$ and 1 if \f$ a = e_{j}\f$. + * @exception std::logic_error In case when the cube \f$B\f$ is not n-1 + * dimensional face of a cube \f$A\f$. **/ - virtual int compute_incidence_between_cells( size_t coface , size_t face ) + virtual int compute_incidence_between_cells( size_t coface , size_t face )const { //first get the counters for coBoundary and boundary: @@ -147,8 +157,8 @@ class Bitmap_cubical_complex_base { { if ( number_of_position_in_which_counters_do_not_agree != -1 ) { - std::cout << "Cells given to compute_incidence_between_cells procedure do not form a pair of coboundary-boundary.\n"; - throw "Cells given to compute_incidence_between_cells procedure do not form a pair of coboundary-boundary."; + std::cout << "Cells given to compute_incidence_between_cells procedure do not form a pair of coboundary-boundary.\n"; + throw logic_error("Cells given to compute_incidence_between_cells procedure do not form a pair of coboundary-boundary."); } number_of_position_in_which_counters_do_not_agree = i; } |