[prev in list] [next in list] [prev in thread] [next in thread] 

List:       boost-users
Subject:    [Boost-users] Boost Graph Library(biconnected_components) issue
From:       "Meghana.M Reddy via Boost-users" <boost-users () lists ! boost ! org>
Date:       2018-05-07 11:34:31
Message-ID: CAHt4GRiBRAC3z8J=_N3Wu2uXMpqY=ip-Sv+JaqxoxCukWZBWXA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

I am working on the Boost Graph Library, currently trying to create an
interface of the biconnected_components method to a Python code. I used the
example code available here
<https://www.boost.org/doc/libs/1_67_0/libs/graph/example/biconnected_components.cpp>
for the method and modified it for my purpose. The template of the method
is here
<https://www.boost.org/doc/libs/1_67_0/libs/graph/doc/biconnected_components.html>.
The final code seems fine but I get an error while compiling it. And the
errors are related to adjacency.hpp which I have not changed so I'm
confused as to what the exact problem is. Hoping someone can help me out.
My code:

class BoostGraph
{
private:
    typedef typename boost::adjacency_list<
      OutEdgeListS, VertexListS, DirectedS,
      boost::property<boost::vertex_index_t, v_index>,
      EdgeProperty, boost::no_property, EdgeListS> adjacency_list;
typedef typename boost::property_map<adjacency_list,
boost::edge_index_t>::type components;
public:
    adjacency_list graph;
    std::vector<v_index> bc_tree() {
        components components_bc = get(boost::edge_index, graph);
        std::size_t num_comps = biconnected_components(graph,
components_bc);
        std::cerr << "Found " << num_comps << " biconnected components.\n";

        std::vector<vertex_descriptor> art_points;
        articulation_points(graph, std::back_inserter(art_points));
        std::cerr << "Found " << art_points.size() << " articulation
points.\n";
        std::vector<v_index> to_return;
        return to_return;
    }



The error I'm getting:

build/cythonized/sage/graphs/base/boost_graph.cpp:3730:26:   required from
here
/home/meghana/Documents/sage_gsoc/sage_may/sage/local/
include/boost/graph/detail/adjacency_list.hpp:2696:29: error: forming
reference to void
         typedef value_type& reference;
                             ^
/home/meghana/Documents/sage_gsoc/sage_may/sage/local/
include/boost/graph/detail/adjacency_list.hpp:2697:35: error: forming
reference to void
         typedef const value_type& const_reference;
                                   ^
/home/meghana/Documents/sage_gsoc/sage_may/sage/local/
include/boost/graph/detail/adjacency_list.hpp:2701:61: error: forming
reference to void
             typename Graph::vertex_descriptor,Property,Tag> type;
                                                             ^
/home/meghana/Documents/sage_gsoc/sage_may/sage/local/
include/boost/graph/detail/adjacency_list.hpp:2704:68: error: forming
reference to void
             typename Graph::vertex_descriptor,const Property, Tag>
const_type;
                                                                    ^
error: command 'gcc' failed with exit status 1
Makefile:33: recipe for target 'sage' failed
make: *** [sage] Error 1

Thank you,
Meghana

[Attachment #5 (text/html)]

<div dir="ltr"><div><div><div><div><div>Hi,<br><br></div>I am working on the Boost \
Graph Library, currently trying to create an interface of the <span \
style="font-family:garamond,serif">biconnected_components</span> method to a Python \
code. I used the example code available <a \
href="https://www.boost.org/doc/libs/1_67_0/libs/graph/example/biconnected_components.cpp" \
target="_blank">here</a> for the method and modified it for my purpose. The template \
of the method is <a href="https://www.boost.org/doc/libs/1_67_0/libs/graph/doc/biconnected_components.html" \
target="_blank">here</a>. The final code seems fine but I get an error while \
compiling it. And the errors are related to <span \
style="font-family:garamond,serif">adjacency.hpp</span> which I have not changed so \
I&#39;m confused as to what the exact problem is. Hoping someone can help me out. \
<br></div>My code: <br><br><span style="font-family:garamond,serif">class \
BoostGraph<br>{<br>private:<br>       typedef typename boost::adjacency_list&lt; <br> \
OutEdgeListS, VertexListS, DirectedS,<br>           \
boost::property&lt;boost::vertex_<wbr>index_t, v_index&gt;,<br>           \
EdgeProperty, boost::no_property, EdgeListS&gt; adjacency_list;<br>typedef typename \
boost::property_map&lt;adjacency_<wbr>list, boost::edge_index_t&gt;::type \
components;<br>public:<br>       adjacency_list graph;<br>       \
std::vector&lt;v_index&gt; bc_tree() {<br>               components components_bc = \
get(boost::edge_index, graph);     <br>               std::size_t num_comps = \
biconnected_components(graph, components_bc);<br>               std::cerr &lt;&lt; \
&quot;Found &quot; &lt;&lt; num_comps &lt;&lt; &quot; biconnected \
components.\n&quot;;<br><br>               std::vector&lt;vertex_descriptor&gt; \
art_points;<br>               articulation_points(graph, \
std::back_inserter(art_points)<wbr>);<br>               std::cerr &lt;&lt; \
&quot;Found &quot; &lt;&lt; art_points.size() &lt;&lt; &quot; articulation \
points.\n&quot;;<br>               std::vector&lt;v_index&gt; to_return;<br>          \
return to_return;<br>       }<br><br><br><br></span></div><span \
style="font-family:garamond,serif"><font face="arial,helvetica,sans-serif">The error \
I&#39;m getting:<br><br><span \
style="font-family:garamond,serif">build/cythonized/sage/graphs/<wbr>base/boost_graph.cpp:3730:26: \
<wbr>   required from \
here<br>/home/meghana/Documents/sage_<wbr>gsoc/sage_may/sage/local/<wbr>include/boost/graph/detail/<wbr>adjacency_list.hpp:2696:29: \
error: forming reference to void<br>                 typedef value_type&amp; \
reference;<br>                                                         \
^<br>/home/meghana/Documents/sage_<wbr>gsoc/sage_may/sage/local/<wbr>include/boost/graph/detail/<wbr>adjacency_list.hpp:2697:35: \
error: forming reference to void<br>                 typedef const value_type&amp; \
const_reference;<br>                                                            <wbr> \
^<br>/home/meghana/Documents/sage_<wbr>gsoc/sage_may/sage/local/<wbr>include/boost/graph/detail/<wbr>adjacency_list.hpp:2701:61: \
error: forming reference to void<br>                         typename \
Graph::vertex_descriptor,<wbr>Property,Tag&gt; type;<br>                              \
<wbr>                                                             \
^<br>/home/meghana/Documents/sage_<wbr>gsoc/sage_may/sage/local/<wbr>include/boost/graph/detail/<wbr>adjacency_list.hpp:2704:68: \
error: forming reference to void<br>                         typename \
Graph::vertex_descriptor,const Property, Tag&gt; const_type;<br>                      \
<wbr>                                                            <wbr>               \
^<br>error: command &#39;gcc&#39; failed with exit status 1<br>Makefile:33: recipe \
for target &#39;sage&#39; failed<br>make: *** [sage] Error \
1</span><br><br></font></span></div><span style="font-family:garamond,serif"><font \
face="arial,helvetica,sans-serif">Thank you,<br></font></span></div><span \
style="font-family:garamond,serif"><font \
face="arial,helvetica,sans-serif">Meghana</font></span><br></div>



_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
https://lists.boost.org/mailman/listinfo.cgi/boost-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic