summaryrefslogtreecommitdiff
path: root/src/Bitmap_cubical_complex
diff options
context:
space:
mode:
authorpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-11-03 06:14:43 +0000
committerpdlotko <pdlotko@636b058d-ea47-450e-bf9e-a15bfbe3eedb>2017-11-03 06:14:43 +0000
commit5829f877dc427d773e3eb141532b27ccec5b27b0 (patch)
tree3e8542aa90e6b112477c9efceb9bbaacf756c75a /src/Bitmap_cubical_complex
parentb463ed7de51684f68494c163d798916384f5399d (diff)
remove trunk from branch
git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/periodic_cubical_complex_fix@2824 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 264cff4aa131c60b455e7d8bd468b001a703ece4
Diffstat (limited to 'src/Bitmap_cubical_complex')
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_base.h30
-rw-r--r--src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h25
2 files changed, 37 insertions, 18 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;
}
diff --git a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
index 176d64ad..4f015893 100644
--- a/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
+++ b/src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h
@@ -28,6 +28,7 @@
#include <cmath>
#include <limits> // for numeric_limits<>
#include <vector>
+#include <stdexcept>
namespace Gudhi {
@@ -89,7 +90,7 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c
* A version of a function that return boundary of a given cell for an object of
* Bitmap_cubical_complex_periodic_boundary_conditions_base class.
* The boundary elements are guaranteed to be returned so that the
- * incidence coeficcients are alternating.
+ * incidence coefficients are alternating.
*/
virtual std::vector< size_t > get_boundary_of_a_cell(size_t cell) const;
@@ -105,12 +106,20 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c
/**
- * 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 )
{
@@ -132,7 +141,7 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c
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.";
+ 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;
}