Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Linear cell complex: Segmentation fault while accessing vertex of a 2-cell

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Linear cell complex: Segmentation fault while accessing vertex of a 2-cell


Chronological Thread 
  • From: Guillaume Damiand <>
  • To:
  • Subject: Re: [cgal-discuss] Linear cell complex: Segmentation fault while accessing vertex of a 2-cell
  • Date: Thu, 25 Jun 2015 15:48:46 +0200

Le 25/06/2015 15:19, Pranav a écrit :
Hi Guilliame,


Guillaume Damiand wrote
Hi pravav,

Without more code, it is impossible for me to suggest anything...
Specifically, the segmentation fault occurs at this line
<https://github.com/pranavkantgaur/CDTGenerator/blob/TDD/src/cdtGen.cpp#L1295>
, but the code is a mess so meanwhile, I am trying to create a minimal code
example demonstrating this problem.

It is once again the same problem:

in the loop line 1521, you iterate throu the lcc, and inside this loop removes a cell (line 1526) which invalidates the first loop.

Here the solution is, as previously, push in a container one dart per cell to remove, and in a second loop iterate through this container to apply remove_cell.




Guillaume Damiand wrote
A last remark: if you are in 3D and if you want to have one dart per
each vertex of a given face, a better possibility is to use:


for (LCC::Dart_of_orbit_range<1>::iterator pHandleBegin =
lcc.darts_of_orbit<1>(fHandle).begin(), pHandleEnd =
lcc.darts_of_orbit<1>(fHandle).end(); pHandleBegin !=
pHandleEnd; pHandleBegin++)
Segmentation fault disappeared using Dart_of_orbit_range as you suggested.

It is just lucky ;)

You can do the same optimisation line 1302.






--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Linear-cell-complex-Segmentation-fault-while-accessing-vertex-of-a-2-cell-tp4660939p4660941.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



--
===================================================================
Guillaume DAMIAND

CNRS - LIRIS UMR 5205
Université Claude Bernard
Bâtiment Nautibus (710)
43 Boulevard du 11 Novembre 1918
69622 Villeurbanne Cedex (France)
-------------------------------------------------------------------
Tél: +33 (0)4.72.43.14.34 Fax: +33 (0)4.72.43.15.36
Mail:

Web: http://liris.cnrs.fr/guillaume.damiand/
===================================================================


Attachment: smime.p7s
Description: Signature cryptographique S/MIME




Archive powered by MHonArc 2.6.18.

Top of Page