Subject: CGAL users discussion list
List archive
- From: "Laurent Rineau (CGAL/GeometryFactory)" <>
- To:
- Subject: Re: [cgal-discuss] Cell_handle in std::map: Precondition violation
- Date: Wed, 04 Jan 2017 13:02:59 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:/Pib/Bw6w5T9qnvXCy+O+j09IxM/srCxBDY+r6Qd0eoTIJqq85mqBkHD//Il1AaPBtSHrasZwLGP++C4ACpbvsbH6ChDOLV3FDY7yuwu1zQ6B8CEDUCpZNXLVAcdWPp4aVl+4nugOlJUEsutL3fbo3m18CJAUk6nbVk9dazJHdvZgM2zkuyz4JbOeB5ghTynYLo0Ig/lgx/Ws5xcpYJ/MKs31lPzo31FcvkehUhHDHbUsBv748qs5o9N+i9MvOgwtoQIBaHzYr41S6AeFjUgPmkozMbkvB2FShGAsChPGl4KmwZFVlCWpCrxWY3853P3
- Organization: GeometryFactory
Le Wednesday, January 4, 2017 10:59:46 AM CET Thomas Holzmann a écrit :
> Hi,
>
> I'm having a (non-constrianed) triangulation and am dividing cells in
> several new ones. Therefore, I'm having a mapping from old to new cells:
>
> map<Cell_handle, vector<Cell_handle> > oldToNewCells;
>
> Now I want to check if a cell was already procesed:
>
> vector<Cell_handle> cellAlreadyProcessed;
> try{
> cellAlreadyProcessed = oldToNewCells.at(cell);
> }
> catch(out_of_range){}
>
> This generally works. However, when I compile with -O0, I get this error
> in case the cell is not in the mapping:
>
> CGAL ERROR: precondition violation!
> Expr: ( i >= 0 && i < 4 ) && ( j >= 0 && j < 4 ) && ( i != j )
> File: /home/holzi/tools/CGAL-4.9/include/CGAL/Triangulation_utils_3.h
> Line: 67
>
> Could someone explain to me, why this error happens and no out_of_range
> exception is thrown?
Why do you think that precondition violation is related to the small code
excerpt you show us?
That exception was triggered because there was a logic error in your code.
Those checks are only applied if the macros CGAL_NDEBUG and NDEBUG are not
defined. That is not related to the optimizations flags -O0, or -O3.
Probably, the way you created the triangulation, or the way your split those
cells invalidated invariant of the triangulation and make it invalid. You can
check the value of `tr.is_valid(true)`, to be sure.
--
Laurent Rineau, PhD
R&D Engineer at GeometryFactory http://www.geometryfactory.com/
Release Manager of the CGAL Project http://www.cgal.org/
- [cgal-discuss] Cell_handle in std::map: Precondition violation, Thomas Holzmann, 01/04/2017
- Re: [cgal-discuss] Cell_handle in std::map: Precondition violation, Laurent Rineau (CGAL/GeometryFactory), 01/04/2017
- Re: [cgal-discuss] Cell_handle in std::map: Precondition violation, Thomas Holzmann, 01/04/2017
- Re: [cgal-discuss] Cell_handle in std::map: Precondition violation, Laurent Rineau (CGAL/GeometryFactory), 01/04/2017
Archive powered by MHonArc 2.6.18.