traversorCell.hpp 16.1 KB
Newer Older
1 2 3
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps  *
* version 0.1                                                                  *
4
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg           *
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
*                                                                              *
* This library is free software; 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 2.1 of the License, or (at your     *
* option) any later version.                                                   *
*                                                                              *
* This library is distributed in the hope that it will be useful, but WITHOUT  *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or        *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License  *
* for more details.                                                            *
*                                                                              *
* You should have received a copy of the GNU Lesser General Public License     *
* along with this library; if not, write to the Free Software Foundation,      *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.           *
*                                                                              *
20
* Web site: http://cgogn.unistra.fr/                                           *
21 22 23
* Contact information: cgogn@unistra.fr                                        *
*                                                                              *
*******************************************************************************/
Sylvain Thery's avatar
Sylvain Thery committed
24 25 26
#include <boost/thread.hpp>
#include <boost/thread/barrier.hpp>
#include <vector>
27 28 29 30

namespace CGoGN
{

31 32
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
TraversorCell<MAP, ORBIT,OPT>::TraversorCell(const MAP& map, bool forceDartMarker, unsigned int thread) :
33
	m(map), dmark(NULL), cmark(NULL), quickTraversal(NULL), current(NIL), firstTraversal(true)
34
{
Pierre Kraemer's avatar
Pierre Kraemer committed
35 36
	dimension = map.dimension();

37
	switch(OPT)
Pierre Kraemer's avatar
Pierre Kraemer committed
38
	{
39 40 41 42 43 44 45
	case FORCE_DART_MARKING:
		dmark = new DartMarker<MAP>(map, thread) ;
		break;
	case FORCE_CELL_MARKING:
		cmark = new CellMarker<MAP, ORBIT>(map, thread) ;
		break;
	case FORCE_QUICK_TRAVERSAL:
46
		quickTraversal = map.template getQuickTraversal<ORBIT>() ;
47 48 49 50 51 52
		assert(quickTraversal != NULL);
		cont = &(map.template getAttributeContainer<ORBIT>()) ;
		break;
	case AUTO:
		if(forceDartMarker)
			dmark = new DartMarker<MAP>(map, thread) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
53
		else
54
		{
55 56 57 58 59 60
			quickTraversal = map.template getQuickTraversal<ORBIT>() ;
			if(quickTraversal != NULL)
			{
				cont = &(map.template getAttributeContainer<ORBIT>()) ;

			}
61
			else
62 63 64 65 66 67
			{
				if(map.template isOrbitEmbedded<ORBIT>())
					cmark = new CellMarker<MAP, ORBIT>(map, thread) ;
				else
					dmark = new DartMarker<MAP>(map, thread) ;
			}
68
		}
69 70
	default:
		break;
Pierre Kraemer's avatar
Pierre Kraemer committed
71
	}
72 73
}

Sylvain Thery's avatar
Sylvain Thery committed
74

75 76
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
TraversorCell<MAP, ORBIT,OPT>::TraversorCell(const TraversorCell<MAP, ORBIT,OPT>& tc) :
Sylvain Thery's avatar
Sylvain Thery committed
77 78 79 80 81 82 83 84 85
	m(tc.m), dmark(tc.dmark), cmark(tc.cmark),
	quickTraversal(tc.quickTraversal), current(tc.current), firstTraversal(tc.firstTraversal),
	dimension(tc.dimension)
{
}




86 87
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
TraversorCell<MAP, ORBIT,OPT>::~TraversorCell()
88
{
89 90 91
	switch(OPT)
	{
	case FORCE_DART_MARKING:
92
		delete dmark ;
93 94
	break;
	case FORCE_CELL_MARKING:
95
		delete cmark ;
96 97 98 99 100 101 102 103 104
	break;
	case AUTO:
		if(dmark)
			delete dmark ;
		else if(cmark)
			delete cmark ;
	default:
		break;
	}
105 106
}

107 108
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
Cell<ORBIT> TraversorCell<MAP, ORBIT,OPT>::begin()
109
{
110 111

	switch(OPT)
112
	{
113 114 115 116 117 118 119 120 121 122 123 124 125
	case FORCE_DART_MARKING:
	{
		if(!firstTraversal)
			dmark->unmarkAll() ;

		current.dart = m.begin() ;
		while(current.dart != m.end() && (m.isBoundaryMarked(dimension, current.dart) ))
			m.next(current.dart) ;

		if(current.dart == m.end())
			current.dart = NIL ;
		else
			dmark->template markOrbit<ORBIT>(current.dart) ;
126
	}
127 128
	break;
	case FORCE_CELL_MARKING:
129
	{
Pierre Kraemer's avatar
Pierre Kraemer committed
130
		if(!firstTraversal)
131
			cmark->unmarkAll() ;
Pierre Kraemer's avatar
Pierre Kraemer committed
132

Pierre Kraemer's avatar
Pierre Kraemer committed
133 134 135
		current.dart = m.begin() ;
		while(current.dart != m.end() && (m.isBoundaryMarked(dimension, current.dart) ))
			m.next(current.dart) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
136

Pierre Kraemer's avatar
Pierre Kraemer committed
137 138
		if(current.dart == m.end())
			current.dart = NIL ;
139
		else
140 141 142 143 144 145 146 147 148 149
			cmark->mark(current) ;
	}
	break;
	case FORCE_QUICK_TRAVERSAL:
		qCurrent = cont->begin() ;
		current.dart = (*quickTraversal)[qCurrent] ;
	break;
	case AUTO:

		if(quickTraversal != NULL)
Pierre Kraemer's avatar
Pierre Kraemer committed
150
		{
151 152
			qCurrent = cont->begin() ;
			current.dart = (*quickTraversal)[qCurrent] ;
Pierre Kraemer's avatar
Pierre Kraemer committed
153
		}
154 155 156 157 158 159 160 161 162
		else
		{
			if(!firstTraversal)
			{
				if(dmark)
					dmark->unmarkAll() ;
				else
					cmark->unmarkAll() ;
			}
Pierre Kraemer's avatar
Pierre Kraemer committed
163

164 165 166
			current.dart = m.begin() ;
			while(current.dart != m.end() && (m.isBoundaryMarked(dimension, current.dart) ))
				m.next(current.dart) ;
167

168 169 170 171 172 173 174 175 176 177 178 179 180 181
			if(current.dart == m.end())
				current.dart = NIL ;
			else
			{
				if(dmark)
					dmark->template markOrbit<ORBIT>(current.dart) ;
				else
					cmark->mark(current) ;
			}
		}
	default:
	break;
	}
	firstTraversal = false ;
182 183 184
	return current ;
}

185 186
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
Cell<ORBIT> TraversorCell<MAP, ORBIT,OPT>::end()
Pierre Kraemer's avatar
Pierre Kraemer committed
187
{
Pierre Kraemer's avatar
Pierre Kraemer committed
188
	return Cell<ORBIT>(NIL) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
189
}
190

191 192
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
Cell<ORBIT> TraversorCell<MAP, ORBIT,OPT>::next()
193
{
Pierre Kraemer's avatar
Pierre Kraemer committed
194
	assert(current.dart != NIL);
195 196 197 198

	switch(OPT)
	{
	case FORCE_DART_MARKING:
199
	{
200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
		bool ismarked = dmark->isMarked(current.dart) ;
		while(current.dart != NIL && (ismarked || m.isBoundaryMarked(dimension, current.dart)))
		{
			m.next(current.dart) ;
			if(current.dart == m.end())
				current.dart = NIL ;
			else
				ismarked = dmark->isMarked(current.dart) ;
		}
		if(current.dart != NIL)
			dmark->template markOrbit<ORBIT>(current.dart) ;
	}
	break;
	case FORCE_CELL_MARKING:
	{
		bool ismarked = cmark->isMarked(current) ;
		while(current.dart != NIL && (ismarked || m.isBoundaryMarked(dimension, current.dart) ))
		{
			m.next(current.dart) ;
			if(current.dart == m.end())
				current.dart = NIL ;
			else
				ismarked = cmark->isMarked(current) ;
		}
		if(current.dart != NIL)
			cmark->mark(current) ;
	}
	break;
	case FORCE_QUICK_TRAVERSAL:
229 230
		cont->next(qCurrent) ;
		if (qCurrent != cont->end())
Pierre Kraemer's avatar
Pierre Kraemer committed
231 232
			current.dart = (*quickTraversal)[qCurrent] ;
		else current.dart = NIL;
233 234 235
	break;
	case AUTO:
		if(quickTraversal != NULL)
236
		{
237 238 239 240
			cont->next(qCurrent) ;
			if (qCurrent != cont->end())
				current.dart = (*quickTraversal)[qCurrent] ;
			else current.dart = NIL;
241 242 243
		}
		else
		{
244
			if(dmark)
Pierre Kraemer's avatar
Pierre Kraemer committed
245
			{
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270
				bool ismarked = dmark->isMarked(current.dart) ;
				while(current.dart != NIL && (ismarked || m.isBoundaryMarked(dimension, current.dart)))
				{
					m.next(current.dart) ;
					if(current.dart == m.end())
						current.dart = NIL ;
					else
						ismarked = dmark->isMarked(current.dart) ;
				}
				if(current.dart != NIL)
					dmark->template markOrbit<ORBIT>(current.dart) ;
			}
			else
			{
				bool ismarked = cmark->isMarked(current) ;
				while(current.dart != NIL && (ismarked || m.isBoundaryMarked(dimension, current.dart) ))
				{
					m.next(current.dart) ;
					if(current.dart == m.end())
						current.dart = NIL ;
					else
						ismarked = cmark->isMarked(current) ;
				}
				if(current.dart != NIL)
					cmark->mark(current) ;
Pierre Kraemer's avatar
Pierre Kraemer committed
271
			}
272
		}
273 274
	default:
		break;
275 276 277 278
	}
	return current ;
}

279 280
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
void TraversorCell<MAP, ORBIT,OPT>::skip(Cell<ORBIT> c)
281
{
282 283 284
	switch(OPT)
	{
	case FORCE_DART_MARKING:
Pierre Kraemer's avatar
Pierre Kraemer committed
285
		dmark->template markOrbit<ORBIT>(c.dart) ;
286 287
	break;
	case FORCE_CELL_MARKING:
Pierre Kraemer's avatar
Pierre Kraemer committed
288
		cmark->mark(c) ;
289 290 291 292 293 294 295 296 297 298 299 300 301
	break;
	case FORCE_QUICK_TRAVERSAL:
	break;
	case AUTO:
		if(dmark)
			dmark->template markOrbit<ORBIT>(c.dart) ;
		else
			cmark->mark(c) ;
	default:
		break;
	}


302 303
}

Sylvain Thery's avatar
Sylvain Thery committed
304 305


Sylvain Thery's avatar
Sylvain Thery committed
306

307 308
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
Cell<ORBIT> TraversorCellEven<MAP, ORBIT,OPT>::begin()
Sylvain Thery's avatar
Sylvain Thery committed
309
{
310
	Cell<ORBIT> c = TraversorCell<MAP, ORBIT,OPT>::begin();
Sylvain Thery's avatar
Sylvain Thery committed
311 312 313 314 315 316
	this->firstTraversal = true;
	return c;
}



317 318
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
Cell<ORBIT> TraversorCellOdd<MAP, ORBIT,OPT>::begin()
Sylvain Thery's avatar
Sylvain Thery committed
319
{
320
	switch(OPT)
Sylvain Thery's avatar
Sylvain Thery committed
321
	{
322
	case FORCE_DART_MARKING:
Sylvain Thery's avatar
Sylvain Thery committed
323 324 325 326 327 328
		this->current.dart = this->m.begin() ;
		while(this->current.dart != this->m.end() && (this->m.isBoundaryMarked(this->dimension, this->current.dart) ))
			this->m.next(this->current.dart) ;

		if(this->current.dart == this->m.end())
			this->current.dart = NIL ;
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
		else
			this->dmark->template unmarkOrbit<ORBIT>(this->current.dart) ;
	break;
	case FORCE_CELL_MARKING:
		this->current.dart = this->m.begin() ;
		while(this->current.dart != this->m.end() && (this->m.isBoundaryMarked(this->dimension, this->current.dart) ))
			this->m.next(this->current.dart) ;

		if(this->current.dart == this->m.end())
			this->current.dart = NIL ;
		else
			this->cmark->unmark(this->current) ;
	break;
	case FORCE_QUICK_TRAVERSAL:
		this->qCurrent = this->cont->begin() ;
		this->current.dart = this->quickTraversal->operator[](this->qCurrent);
	break;
	case AUTO:
		if(this->quickTraversal != NULL)
		{
			this->qCurrent = this->cont->begin() ;
			this->current.dart = this->quickTraversal->operator[](this->qCurrent);
		}
Sylvain Thery's avatar
Sylvain Thery committed
352 353
		else
		{
354 355 356 357 358 359
			this->current.dart = this->m.begin() ;
			while(this->current.dart != this->m.end() && (this->m.isBoundaryMarked(this->dimension, this->current.dart) ))
				this->m.next(this->current.dart) ;

			if(this->current.dart == this->m.end())
				this->current.dart = NIL ;
Sylvain Thery's avatar
Sylvain Thery committed
360
			else
361 362 363 364 365 366
			{
				if(this->dmark)
					this->dmark->template unmarkOrbit<ORBIT>(this->current.dart) ;
				else
					this->cmark->unmark(this->current) ;
			}
Sylvain Thery's avatar
Sylvain Thery committed
367
		}
368 369
	default:
	break;
Sylvain Thery's avatar
Sylvain Thery committed
370 371 372 373 374
	}
	return this->current ;
}


375 376
template <typename MAP, unsigned int ORBIT, TraversalOptim OPT>
Cell<ORBIT> TraversorCellOdd<MAP, ORBIT,OPT>::next()
Sylvain Thery's avatar
Sylvain Thery committed
377 378 379
{
	assert(this->current.dart != NIL);

380
	switch(OPT)
Sylvain Thery's avatar
Sylvain Thery committed
381
	{
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
	case FORCE_DART_MARKING:
	{
		bool ismarked = this->dmark->isMarked(this->current.dart) ;
		while(this->current.dart != NIL && (!ismarked || this->m.isBoundaryMarked(this->dimension,this->current.dart)))
		{
			this->m.next(this->current.dart) ;
			if(this->current.dart == this->m.end())
				this->current.dart = NIL ;
			else
				ismarked = this->dmark->isMarked(this->current.dart) ;
		}
		if(this->current.dart != NIL)
			this->dmark->template unmarkOrbit<ORBIT>(this->current.dart) ;
	}
	break;
	case FORCE_CELL_MARKING:
	{
		bool ismarked = this->cmark->isMarked(this->current) ;
		while(this->current.dart != NIL && (!ismarked || this->m.isBoundaryMarked(this->dimension, this->current.dart) ))
		{
			this->m.next(this->current.dart) ;
			if(this->current.dart == this->m.end())
				this->current.dart = NIL ;
			else
				ismarked = this->cmark->isMarked(this->current) ;
		}
		if(this->current.dart != NIL)
			this->cmark->unmark(this->current) ;
	}
	break;
	case FORCE_QUICK_TRAVERSAL:
Sylvain Thery's avatar
Sylvain Thery committed
413 414 415 416
		this->cont->next(this->qCurrent) ;
		if (this->qCurrent != this->cont->end())
			this->current.dart = this->quickTraversal->operator[](this->qCurrent) ;
		else this->current.dart = NIL;
417 418 419
	break;
	case AUTO:
		if(this->quickTraversal != NULL)
Sylvain Thery's avatar
Sylvain Thery committed
420
		{
421 422 423 424
			this->cont->next(this->qCurrent) ;
			if (this->qCurrent != this->cont->end())
				this->current.dart = this->quickTraversal->operator[](this->qCurrent) ;
			else this->current.dart = NIL;
Sylvain Thery's avatar
Sylvain Thery committed
425 426 427
		}
		else
		{
428
			if(this->dmark)
Sylvain Thery's avatar
Sylvain Thery committed
429
			{
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454
				bool ismarked = this->dmark->isMarked(this->current.dart) ;
				while(this->current.dart != NIL && (!ismarked || this->m.isBoundaryMarked(this->dimension,this->current.dart)))
				{
					this->m.next(this->current.dart) ;
					if(this->current.dart == this->m.end())
						this->current.dart = NIL ;
					else
						ismarked = this->dmark->isMarked(this->current.dart) ;
				}
				if(this->current.dart != NIL)
					this->dmark->template unmarkOrbit<ORBIT>(this->current.dart) ;
			}
			else
			{
				bool ismarked = this->cmark->isMarked(this->current) ;
				while(this->current.dart != NIL && (!ismarked || this->m.isBoundaryMarked(this->dimension, this->current.dart) ))
				{
					this->m.next(this->current.dart) ;
					if(this->current.dart == this->m.end())
						this->current.dart = NIL ;
					else
						ismarked = this->cmark->isMarked(this->current) ;
				}
				if(this->current.dart != NIL)
					this->cmark->unmark(this->current) ;
Sylvain Thery's avatar
Sylvain Thery committed
455 456
			}
		}
457 458
	default:
		break;
Sylvain Thery's avatar
Sylvain Thery committed
459
	}
460

Sylvain Thery's avatar
Sylvain Thery committed
461 462 463 464 465 466
	return this->current ;
}




Sylvain Thery's avatar
Sylvain Thery committed
467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503
namespace Parallel
{

/// internal functor for boost call
template <unsigned int ORBIT, typename FUNC>
class ThreadFunction
{
protected:
	typedef Cell<ORBIT> CELL;
	std::vector<CELL>& m_cells;
	boost::barrier& m_sync1;
	boost::barrier& m_sync2;
	bool& m_finished;
	unsigned int m_id;
	FUNC m_lambda;
public:
	ThreadFunction(FUNC func, std::vector<CELL>& vd, boost::barrier& s1, boost::barrier& s2, bool& finished, unsigned int id):
		m_cells(vd), m_sync1(s1), m_sync2(s2), m_finished(finished), m_id(id), m_lambda(func)
	{
	}

	ThreadFunction(const ThreadFunction<ORBIT, FUNC>& tf):
		m_cells(tf.m_cells), m_sync1(tf.m_sync1), m_sync2(tf.m_sync2), m_finished(tf.m_finished), m_id(tf.m_id), m_lambda(tf.m_lambda){}

	void operator()()
	{
		while (!m_finished)
		{
			for (typename std::vector<CELL>::const_iterator it = m_cells.begin(); it != m_cells.end(); ++it)
				m_lambda(*it,m_id);
			m_sync1.wait(); // wait every body has finished
			m_sync2.wait(); // wait vectors has been refilled
		}
	}
};


504 505
template <TraversalOptim OPT, unsigned int ORBIT, typename MAP, typename FUNC>
void foreach_cell_tmpl(MAP& map, FUNC func, unsigned int nbth, bool needMarkers)
Sylvain Thery's avatar
Sylvain Thery committed
506 507 508 509 510 511 512 513 514 515 516
{
	if (nbth==0)
		nbth = boost::thread::hardware_concurrency();

	std::vector< Cell<ORBIT> >* vd = new std::vector< Cell<ORBIT> >[nbth];

	for (unsigned int i = 0; i < nbth; ++i)
		vd[i].reserve(SIZE_BUFFER_THREAD);

	//    TraversorCell<MAP, ORBIT> trav(map,false,th_orig);
	unsigned int nb = 0;
517
	TraversorCell<MAP, ORBIT, OPT> trav(map);
Sylvain Thery's avatar
Sylvain Thery committed
518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586
	Cell<ORBIT> cell = trav.begin();
	Cell<ORBIT> c_end = trav.end();
	while ((cell.dart != c_end.dart) && (nb < nbth*SIZE_BUFFER_THREAD) )
	{
		vd[nb%nbth].push_back(cell);
		nb++;
		cell = trav.next();
	}
	boost::barrier sync1(nbth+1);
	boost::barrier sync2(nbth+1);
	bool finished=false;
	// lauch threads
	if (needMarkers)
	{
		unsigned int nbth_prec = map.getNbThreadMarkers();
		if (nbth_prec < nbth+1)
			map.addThreadMarker(nbth+1-nbth_prec);
	}

	boost::thread** threads = new boost::thread*[nbth];
	ThreadFunction<ORBIT,FUNC>** tfs = new ThreadFunction<ORBIT,FUNC>*[nbth];

	for (unsigned int i = 0; i < nbth; ++i)
	{
		tfs[i] = new ThreadFunction<ORBIT,FUNC>(func, vd[i],sync1,sync2, finished,1+i);
		threads[i] = new boost::thread( boost::ref( *(tfs[i]) ) );
	}

	// and continue to traverse the map
	std::vector< Cell<ORBIT> >* tempo = new std::vector< Cell<ORBIT> >[nbth];
	for (unsigned int i = 0; i < nbth; ++i)
		tempo[i].reserve(SIZE_BUFFER_THREAD);

	while (cell.dart != c_end.dart)
	{
		for (unsigned int i = 0; i < nbth; ++i)
			tempo[i].clear();
		unsigned int nb = 0;

		while ((cell.dart != c_end.dart) && (nb < nbth*SIZE_BUFFER_THREAD) )
		{
			tempo[nb%nbth].push_back(cell);
			nb++;
			cell = trav.next();
		}
		sync1.wait();// wait for all thread to finish its vector
		for (unsigned int i = 0; i < nbth; ++i)
			vd[i].swap(tempo[i]);
		sync2.wait();// everybody refilled then go
	}

	sync1.wait();// wait for all thread to finish its vector
	finished = true;// say finsih to everyone
	sync2.wait(); // just wait for last barrier wait !


	//wait for all theads to be finished
	for (unsigned int i = 0; i < nbth; ++i)
	{
		threads[i]->join();
		delete threads[i];
		delete tfs[i];
	}
	delete[] tfs;
	delete[] threads;
	delete[] vd;
	delete[] tempo;
}

587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
template <unsigned int ORBIT, typename MAP, typename FUNC>
void foreach_cell(MAP& map, FUNC func, unsigned int nbth, bool needMarkers, TraversalOptim opt)
{
	switch(opt)
	{
	case FORCE_DART_MARKING:
		foreach_cell_tmpl<FORCE_DART_MARKING,ORBIT,MAP,FUNC>(map,func,nbth,needMarkers);
	break;
	case FORCE_CELL_MARKING:
		foreach_cell_tmpl<FORCE_CELL_MARKING,ORBIT,MAP,FUNC>(map,func,nbth,needMarkers);
	break;
	case FORCE_QUICK_TRAVERSAL:
		foreach_cell_tmpl<FORCE_QUICK_TRAVERSAL,ORBIT,MAP,FUNC>(map,func,nbth,needMarkers);
	break;
	case AUTO:
	default:
		foreach_cell_tmpl<AUTO,ORBIT,MAP,FUNC>(map,func,nbth,needMarkers);
	break;

	}

Sylvain Thery's avatar
Sylvain Thery committed
608 609
}

610 611
}// namespace Parallel

Sylvain Thery's avatar
Sylvain Thery committed
612

Pierre Kraemer's avatar
Pierre Kraemer committed
613
} // namespace CGoGN