Boost logo

Boost Users :

From: Mojmir Svoboda (mojmir.svoboda_at_[hidden])
Date: 2008-09-01 10:47:42


hello,

i am using directed CSR from boost::graph and i have a small
problem with memory consumption, as each edge property is
duplicated.

i can of course make edge property to be some index and reduce
this, but i have an editor part of graph that is adjacency_list
and i'd like the properties to be the same.

my primary question is:
is there a way to implement an undirected csr graph?

anyway, when constructing directed graph from undirected there
is a slight bug in implementation, because it allocates space
for only N edges(properties) instead of 2N. or am i missing something?

another thing: perhaps i am doing something wrong, but this code
seems to go 'one field beyond' the allocated space.
can you confirm, please?

  edge_iterator& operator++() {
    ++current_edge.idx;
    while (current_edge.idx == end_of_this_vertex) {
      ++current_edge.src;
      end_of_this_vertex = rowstart_array[current_edge.src + 1];
                                          ^^^^^^^^^^^^^^^^^^^^
    }
    return *this;
  }

many thanks for your attention,
mojmir


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net