From b463ed7de51684f68494c163d798916384f5399d Mon Sep 17 00:00:00 2001 From: pdlotko Date: Wed, 1 Nov 2017 18:33:18 +0000 Subject: Fixing Marc's comments. git-svn-id: svn+ssh://scm.gforge.inria.fr/svnroot/gudhi/branches/periodic_cubical_complex_fix@2822 636b058d-ea47-450e-bf9e-a15bfbe3eedb Former-commit-id: 9349d7b76ee2301c2554480f33af0a395451a9a9 --- ...cal_complex_periodic_boundary_conditions_base.h | 28 ++++++++++++---------- 1 file changed, 15 insertions(+), 13 deletions(-) (limited to 'src/Bitmap_cubical_complex/include/gudhi/Bitmap_cubical_complex_periodic_boundary_conditions_base.h') 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 9411f4b2..176d64ad 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 @@ -105,27 +105,29 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c /** - * This procedure compute incidence numbers between cells. - * Note that first parameter is the address of a cell of dimension n, - * and the second parameter is the address of adjusted cell in dimension + * 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. **/ - virtual int compute_incidence_between_cells( size_t coBoundary , size_t boundary ) + virtual int compute_incidence_between_cells( size_t coface , size_t face ) { //first get the counters for coBoundary and boundary: - std::vector cbd_counter = this->compute_counter_for_given_cell( coBoundary ); - std::vector bd_counter = this->compute_counter_for_given_cell( boundary ); + std::vector coface_counter = this->compute_counter_for_given_cell( coface ); + std::vector face_counter = this->compute_counter_for_given_cell( face ); //cbd_counter and bd_counter should agree at all positions except from one: int number_of_position_in_which_counters_do_not_agree = -1; size_t number_of_full_faces_that_comes_before = 0; - for ( size_t i = 0 ; i != cbd_counter.size() ; ++i ) + for ( size_t i = 0 ; i != coface_counter.size() ; ++i ) { - if ( (cbd_counter[i]%2 == 1)&&(number_of_position_in_which_counters_do_not_agree==-1) ) + if ( (coface_counter[i]%2 == 1)&&(number_of_position_in_which_counters_do_not_agree==-1) ) { ++number_of_full_faces_that_comes_before; } - if ( cbd_counter[i] != bd_counter[i] ) + if ( coface_counter[i] != face_counter[i] ) { if ( number_of_position_in_which_counters_do_not_agree != -1 ) { @@ -139,13 +141,13 @@ class Bitmap_cubical_complex_periodic_boundary_conditions_base : public Bitmap_c int incidence = 1; if ( number_of_full_faces_that_comes_before%2 )incidence = -1; //if the boundary cell is on the right from coboundary cell: - if ( (cbd_counter[number_of_position_in_which_counters_do_not_agree]+1 == - bd_counter[number_of_position_in_which_counters_do_not_agree]) + if ( (coface_counter[number_of_position_in_which_counters_do_not_agree]+1 == + face_counter[number_of_position_in_which_counters_do_not_agree]) || ( - (cbd_counter[number_of_position_in_which_counters_do_not_agree] != 1) + (coface_counter[number_of_position_in_which_counters_do_not_agree] != 1) && - (bd_counter[number_of_position_in_which_counters_do_not_agree]==0) + (face_counter[number_of_position_in_which_counters_do_not_agree]==0) ) ) { -- cgit v1.2.3