[BGL] direct access to compressed_sparse_row vectors?

In the header file I find: // private: non-portable, requires friend templates --cut-- std::vector<EdgeIndex> m_rowstart; std::vector<Vertex> m_column; I already have a graph stored as a BGL adjacency_list and now I want to use a 3rd-party library (SCOTCH) which takes its input also in the CSR format. As I can see from the docs, there is no standardized interface to retrieve the raw CSR representation. This way, I either have to rely on the above members not being private, or myself effectively duplicating the already existing code for constructing the CSR representation. Am I overlooking something?

* Zeljko Vrba
std::vector<EdgeIndex> m_rowstart; std::vector<Vertex> m_column;
I already have a graph stored as a BGL adjacency_list and now I want to use a 3rd-party library (SCOTCH) which takes its input also in the CSR format. As I can see from the docs, there is no standardized interface to retrieve the raw CSR representation.
i second that! :) moreover i'd like to customize the underlying containers (std::vector) at least with my own allocator. best regards, mojmir

on Wed Jul 09 2008, Mojmir Svoboda
* Zeljko Vrba
[2008-07-08 10:02:27 +0200]: std::vector<EdgeIndex> m_rowstart; std::vector<Vertex> m_column;
I already have a graph stored as a BGL adjacency_list and now I want to use a 3rd-party library (SCOTCH) which takes its input also in the CSR format. As I can see from the docs, there is no standardized interface to retrieve the raw CSR representation.
i second that! :) moreover i'd like to customize the underlying containers (std::vector) at least with my own allocator.
If you have to deal with a non-generic 3rd party library, the solution is to build a CSR representation that's compatible with SCOTCH and then adapt it for use by BGL by defining the necessary things to make it conform to the necessary graph concepts. You could take a look at http://www.stanford.edu/~dgleich/programs/matlab_bgl/ for an example of exactly that approach. HTH, -- Dave Abrahams BoostPro Computing http://www.boostpro.com

On Wed, Jul 09, 2008 at 04:46:31AM -0400, David Abrahams wrote:
If you have to deal with a non-generic 3rd party library, the solution is to build a CSR representation that's compatible with SCOTCH and then
Yes, this is the approach that I've already decided to take.

hello - i have another question on CST:
on construction of CSR from another graph - what happens when you construct csr
directed graph from undirected adjacency_list? it doubles all edges? because
i'm getting some crashes that tries to write past container boundary:
in compressed_sparse_row_graph.hpp
template
participants (3)
-
David Abrahams
-
Mojmir Svoboda
-
Zeljko Vrba