possible bug in examples/BGL_triangulation_2/emst.cpp

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

possible bug in examples/BGL_triangulation_2/emst.cpp

Godmar Back

Hi,

I'm trying to run the example shown here:

http://www.cgal.org/Manual/3.3/examples/BGL_triangulation_2/emst.cpp
http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/BGL/Chapter_main.html#Subsection_56.5.1

I'm getting this output:

CGAL error: precondition violation!
Expr: ! is_infinite(e)
File: /usr/include/CGAL/Triangulation_2.h
Line: 825
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct NULL not valid
Aborted

This example uses a boost filtered graph to filter out infinite vertices and
edges.

However, this filter is only invoked for the vertices, it's not invoked for the
edges at all. I can verify this by placing a print statement in the ()
operator.

Therefore, the msp computation encounters an infinite edge and fails.

I'm using Ubuntu's cgal2 and boost pre-installed packages.

 - Godmar

ps: the input is here:
$ cat data/graph.cin
1 2
4 5
7 8
3 5
9 6
5 6
4 3
5 5
7 4
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
Reply | Threaded
Open this post in threaded view
|

Re: possible bug in examples/BGL_triangulation_2/emst.cpp

Godmar Back
ps. I found the bug in the example. The bug is that you pass the
actual triangulation, instead of the filtered triangulation, to
boost::kruskal_minimum_spanning_tree.

It should be:

   boost::kruskal_minimum_spanning_tree(ft,
                    std::back_inserter(mst),
                    vertex_index_map(vertex_index_pmap));

instead of

   boost::kruskal_minimum_spanning_tree(t,
                    std::back_inserter(mst),
                    vertex_index_map(vertex_index_pmap));


(note the "ft" instead of "t")

 - Godmar

On Fri, Jul 25, 2008 at 11:47 AM,  <[hidden email]> wrote:

>
> Hi,
>
> I'm trying to run the example shown here:
>
> http://www.cgal.org/Manual/3.3/examples/BGL_triangulation_2/emst.cpp
> http://www.cgal.org/Manual/3.3/doc_html/cgal_manual/BGL/Chapter_main.html#Subsection_56.5.1
>
> I'm getting this output:
>
> CGAL error: precondition violation!
> Expr: ! is_infinite(e)
> File: /usr/include/CGAL/Triangulation_2.h
> Line: 825
> terminate called after throwing an instance of 'std::logic_error'
>  what():  basic_string::_S_construct NULL not valid
> Aborted
>
> This example uses a boost filtered graph to filter out infinite vertices and
> edges.
>
> However, this filter is only invoked for the vertices, it's not invoked for the
> edges at all. I can verify this by placing a print statement in the ()
> operator.
>
> Therefore, the msp computation encounters an infinite edge and fails.
>
> I'm using Ubuntu's cgal2 and boost pre-installed packages.
>
>  - Godmar
>
> ps: the input is here:
> $ cat data/graph.cin
> 1 2
> 4 5
> 7 8
> 3 5
> 9 6
> 5 6
> 4 3
> 5 5
> 7 4
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss