Hi all,

I'm currently offloading construction of the uni-modal projection of a 
bipartite graph from Python to C++ (NB: I am not very familiar with C++ or BGL, 
_yet_).
Thanks to the docs on writing such extensions, I know roughly where I'm 
heading. 

This is the signature of the projection-function:

    template <class Graph, class ProjectedGraph>
    void projection(const Graph &g, ProjectedGraph &pg)

Here, g is the bipartite graph, and pg is constructed in Python as:
    pg = Graph(GraphView(g, vfilt=lambda v: g.vp.type == 0))

I am thus passing in the graph containing only the vertices I wish to project 
onto, and add the edges between them in C++.

In Python, pg.num_edges() correctly returns zero.
In C++, it returns the same number of edges as the base-graph it was 
constructed from, g.

How can I obtain the filtered view of pg in C++, which I expect to have no 
edges?

Kind regards, 
Oliver
_______________________________________________
graph-tool mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to