Bug fix in dart iterator with two beta

This commit is contained in:
Guillaume Damiand 2016-01-08 06:33:36 +01:00
parent edfe7f4d10
commit 60d44ab38b
3 changed files with 32 additions and 10 deletions

View File

@ -513,7 +513,7 @@ namespace CGAL {
CGAL_assertion(!this->mmap->is_free(*this, Bi)); CGAL_assertion(!this->mmap->is_free(*this, Bi));
this->set_current_dart(this->mmap->beta(*this, Bi)); this->set_current_dart(this->mmap->beta(*this, Bi));
this->mprev_op = OP_BETAI; this->mprev_op = OP_BETAI;
mcurdart=1; mcurdart=3;
} }
else else
{ {

View File

@ -22,6 +22,7 @@
#include <CGAL/Combinatorial_map_constructors.h> #include <CGAL/Combinatorial_map_constructors.h>
#include <CGAL/Combinatorial_map_operations.h> #include <CGAL/Combinatorial_map_operations.h>
#include "Combinatorial_map_test_iterators.h"
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
@ -150,6 +151,9 @@ bool test2D()
map.template sew<2> ( map.beta(d1, 1), map.beta (d3, 1) ); map.template sew<2> ( map.beta(d1, 1), map.beta (d3, 1) );
} }
if ( !test_iterators_2(map) )
{ assert(false); return false; }
// Two nested iterators // Two nested iterators
cout << "Nombre de brins : " << map.number_of_darts() << ", " cout << "Nombre de brins : " << map.number_of_darts() << ", "
<< "Nombre de CC : " << flush; << "Nombre de CC : " << flush;

View File

@ -1,3 +1,25 @@
// Copyright (c) 2010-2011 CNRS and LIRIS' Establishments (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
//
#ifndef COMBINATORIAL_MAP_TEST_ITERATORS_H
#define COMBINATORIAL_MAP_TEST_ITERATORS_H
// This function allows to test if the iterators iterate through the dart exactly once. // This function allows to test if the iterators iterate through the dart exactly once.
template<typename CMap> template<typename CMap>
@ -48,7 +70,7 @@ bool test_iterators_2(CMap & cm)
for (int i=0; i<NBTESTS; ++i) for (int i=0; i<NBTESTS; ++i)
{ {
if(nbdarts[i]!=cm.number_of_darts()) res=false; if(nbdarts[i]!=cm.number_of_darts()) res=false;
cm.free_mark( marks[i]); cm.free_mark( marks[i] );
} }
return res; return res;
} }
@ -115,15 +137,12 @@ bool test_iterators_3(CMap & cm)
} }
} }
// std::cout<<"Number of marked darts: ";
bool res = true; bool res = true;
for (int i=0; i<NBTESTS; ++i) for (int i=0; i<NBTESTS; ++i)
{ {
if(nbdarts[i]!=cm.number_of_darts()) res=false; if(nbdarts[i]!=cm.number_of_darts()) res=false;
cm.free_mark( marks[i]); cm.free_mark( marks[i] );
// std::cout<<nbdarts[i]<<" ";
} }
// std::cout<<"number of darts="<<cm.number_of_darts()<<std::endl;
return res; return res;
} }
@ -214,14 +233,13 @@ bool test_iterators_4(CMap & cm)
} }
} }
// std::cout<<"Number of marked darts: ";
bool res = true; bool res = true;
for (int i=0; i<NBTESTS; ++i) for (int i=0; i<NBTESTS; ++i)
{ {
if(nbdarts[i]!=cm.number_of_darts()) res=false; if(nbdarts[i]!=cm.number_of_darts()) res=false;
cm.free_mark( marks[i]); cm.free_mark( marks[i] );
// std::cout<<nbdarts[i]<<" ";
} }
// std::cout<<"number of darts="<<cm.number_of_darts()<<std::endl;
return res; return res;
} }
#endif // COMBINATORIAL_MAP_TEST_ITERATORS_H