33 #ifndef UG_GRAPH_INTERFACE_UNDIRECTED_H
34 #define UG_GRAPH_INTERFACE_UNDIRECTED_H
38 #include <boost/geometry/iterators/concatenate_iterator.hpp>
39 #include <boost/graph/adjacency_list.hpp>
54 typedef boost::adjacency_list<boost::vecS, boost::vecS>
G;
55 typedef typename boost::graph_traits<T>::adjacency_iterator
T_adj_it;
56 typedef typename boost::graph_traits<G>::adjacency_iterator
G_adj_it;
57 class edge :
public std::pair<int, int>{
61 edge(
int a,
int b) :
std::pair<int, int>(a, b) {
70 typedef boost::geometry::concatenate_iterator<
119 return edge_iterator(r1.first, r1.second, r2.first, r2.second);
125 return edge_iterator(r1.second, r1.second, r2.second, r2.second);
170 size_t N = _matrix->num_rows();
171 assert(N == _matrix->num_cols());
172 assert(!_matrix->iters());
177 map_type, boost::identity_property_map > container_type;
179 std::vector<T_adj_it> c(N);
180 std::vector<T_adj_it> e(N);
183 container_type bs(N, N, M);
185 for(
size_t k=0; k<N; ++k){
197 for(
size_t j=0; j<N; ++j){
198 std::cerr <<
"bs init " << j <<
"... ";
200 std::cerr <<
" " << t;
206 for(
size_t j=0; j<N; ++j){
223 for(; c[j] != e[j];){
229 boost::add_edge(k, j, _extra_fill);
234 boost::add_edge(k, j, _extra_fill);
235 }
else if(*c[k] == j){
257 for(
auto t=bj.begin(); t!=bj.end(); ){
262 boost::add_edge(j, i, _extra_fill);
269 }
else if(
int(*c[i]) < i){
itested();
283 assert(!_matrix->iters());
Definition: sparsematrix_boost.h:37
Definition: sparsematrix_boost.h:152
Definition: bucket_sorter.hpp:47
Definition: undirected.h:57
edge(int a, int b)
Definition: undirected.h:61
edge(boost::graph_traits< G >::edge_descriptor)
Definition: undirected.h:66
edge()
Definition: undirected.h:59
edge(boost::SM_edge< value_type >)
Definition: undirected.h:63
Definition: undirected.h:146
int operator[](int i) const
Definition: undirected.h:150
T_adj_it const * _end
Definition: undirected.h:157
map_type(T_adj_it const *i, T_adj_it const *e)
Definition: undirected.h:148
T_adj_it const * _it
Definition: undirected.h:156
Definition: undirected.h:50
boost::graph_traits< T >::adjacency_iterator T_adj_it
Definition: undirected.h:55
void refresh()
Definition: undirected.h:163
boost::adjacency_list< boost::vecS, boost::vecS > G
Definition: undirected.h:54
UndirectedMatrix(T const *m=nullptr)
Definition: undirected.h:76
int num_rows() const
Definition: undirected.h:96
G _extra_fill
Definition: undirected.h:143
UndirectedMatrix(UndirectedMatrix &&o)=delete
int degree(int v) const
Definition: undirected.h:110
UndirectedMatrix & operator=(UndirectedMatrix const &o)
Definition: undirected.h:87
T::const_row_iterator const_row_iterator
Definition: undirected.h:51
T::value_type value_type
Definition: undirected.h:53
T const * _matrix
Definition: undirected.h:142
int out_degree(int v) const
Definition: undirected.h:102
UndirectedMatrix(UndirectedMatrix const &o)
Definition: undirected.h:84
boost::graph_traits< G >::adjacency_iterator G_adj_it
Definition: undirected.h:56
boost::geometry::concatenate_iterator< boost::SM_adjacency_iterator< value_type >, G_adj_it, int, int > adjacency_iterator
Definition: undirected.h:73
int num_cols() const
Definition: undirected.h:99
int in_degree(int v) const
Definition: undirected.h:106
adjacency_iterator begin_row(int row) const
Definition: undirected.h:128
adjacency_iterator end_row(int row) const
Definition: undirected.h:134
#define UG_LOG(msg)
Definition: log.h:367
#define untested()
Definition: lua_table_handle.cpp:15
std::pair< typename graph_traits< T >::adjacency_iterator, typename graph_traits< T >::adjacency_iterator > adjacent_vertices(size_t v, ug::BidirectionalMatrix< T > const &M)
Definition: bidirectional_boost.h:108
std::pair< SM_out_edge_iterator< typename T::value_type >, SM_out_edge_iterator< typename T::value_type > > out_edges(size_t v, ug::BidirectionalMatrix< T > const &g)
Definition: bidirectional_boost.h:136
int out_degree(int v, ug::BidirectionalMatrix< T > const &M)
Definition: bidirectional_boost.h:76
Definition: smart_pointer.h:814
double get_clock_s()
Definition: stopwatch.h:103
T value_type
Definition: sparsematrix_interface.h:2
stopwatch class for quickly taking times
#define incomplete()
Definition: trace.h:10
#define itested()
Definition: trace.h:9