13 #ifndef UG_SPARSEMATRIX_BOOST_H
14 #define UG_SPARSEMATRIX_BOOST_H
19 #include <boost/graph/properties.hpp>
20 #include <boost/iterator/counting_iterator.hpp>
32 SM_adjacency_iterator<T>,
33 typename ug::SparseMatrix<T>::const_row_iterator,
34 std::input_iterator_tag,
39 typedef typename M::const_row_iterator
iter_t;
40 typedef iterator_facade<
43 std::input_iterator_tag,
191 template<
class T,
class M>
197 template<
class T,
class M>
203 template<
class T,
bool out=true>
205 SM_out_edge_iterator<T, out>,
206 SM_adjacency_iterator<T>,
208 std::input_iterator_tag,
213 typedef iterator_facade<
216 std::input_iterator_tag,
260 return ret.base.first - other.base.first;
309 : adjacency_graph_tag, bidirectional_graph_tag, vertex_list_graph_tag {};
325 std::pair<typename graph_traits<ug::SparseMatrix<T>>::adjacency_iterator,
326 typename graph_traits<ug::SparseMatrix<T>>::adjacency_iterator>
330 typedef typename graph_traits<ug::SparseMatrix<T>>::adjacency_iterator a;
335 return std::make_pair(a(&b, &e), a(&e, &e));
339 inline std::pair<SM_out_edge_iterator<T>, SM_out_edge_iterator<T>>
345 return std::make_pair(Iter(a.first, v), Iter(a.second, v));
350 :
public put_get_helper<size_t, sparse_matrix_index_map<T> > {
382 typename property_map<ug::SparseMatrix<T>, vertex_index_t>::const_type
389 std::pair<counting_iterator<size_t>, counting_iterator<size_t> >
vertices(
392 counting_iterator<size_t> b(0);
393 counting_iterator<size_t> e(M.
num_rows());
395 return std::make_pair(b,e);
410 for(; i.first != i.second; ++i.first) {
422 template<
class T,
class M=ug::SparseMatrix<T>>
424 public put_get_helper< T , SM_edge_weight_map<T> > {
446 assert(&
s._g==&
_g); (void)
s;
454 template<
class T,
class Tag>
470 inline typename property_map<ug::SparseMatrix<T>, edge_all_t>::type
472 typedef typename property_map<ug::SparseMatrix<T>, edge_all_t>::type
474 return pmap_type(&g);
Definition: sparsematrix_interface.h:37
Definition: sparsematrix_boost.h:37
bool operator==(const SM_adjacency_iterator &other) const
Definition: sparsematrix_boost.h:106
friend class iterator_core_access
Definition: sparsematrix_boost.h:148
SM_adjacency_iterator & operator=(SM_adjacency_iterator &&other)=delete
~SM_adjacency_iterator()
Definition: sparsematrix_boost.h:67
intmax_t difference_type
Definition: sparsematrix_boost.h:50
SM_adjacency_iterator(SM_adjacency_iterator &&p)=delete
void skip_zeroes()
Definition: sparsematrix_boost.h:119
T const & value() const
Definition: sparsematrix_boost.h:90
SM_adjacency_iterator(value_type p, value_type e)
Definition: sparsematrix_boost.h:61
void decrement()
Definition: sparsematrix_boost.h:139
value_type _end
Definition: sparsematrix_boost.h:147
iter_t * value_type
Definition: sparsematrix_boost.h:49
SM_adjacency_iterator & operator=(const SM_adjacency_iterator &other)
Definition: sparsematrix_boost.h:74
value_type _base
Definition: sparsematrix_boost.h:146
SM_adjacency_iterator()
Definition: sparsematrix_boost.h:54
ug::SparseMatrix< T > M
Definition: sparsematrix_boost.h:38
iterator_facade< SM_adjacency_iterator< T >, typename ug::SparseMatrix< T >::const_row_iterator, std::input_iterator_tag, size_t, std::intmax_t > base_class
Definition: sparsematrix_boost.h:46
bool equal(SM_adjacency_iterator const &other) const
Definition: sparsematrix_boost.h:128
int row() const
Definition: sparsematrix_boost.h:94
void increment()
Definition: sparsematrix_boost.h:133
SM_adjacency_iterator(SM_adjacency_iterator const &p)
Definition: sparsematrix_boost.h:57
M::const_row_iterator iter_t
Definition: sparsematrix_boost.h:39
bool operator!=(const SM_adjacency_iterator &other) const
Definition: sparsematrix_boost.h:111
reference dereference() const
Definition: sparsematrix_boost.h:102
size_t idx() const
Definition: sparsematrix_boost.h:98
size_t reference
Definition: sparsematrix_boost.h:51
Definition: sparsematrix_boost.h:424
int vertex_descriptor
Definition: sparsematrix_boost.h:427
SM_edge_weight_map(ug::SparseMatrix< T >const &g, boost::edge_weight_t)
Definition: sparsematrix_boost.h:435
T & reference
Definition: sparsematrix_boost.h:430
SM_edge_weight_map(M const &g)
Definition: sparsematrix_boost.h:438
vertex_descriptor key_type
Definition: sparsematrix_boost.h:431
edge_weight_type value_type
Definition: sparsematrix_boost.h:429
SM_edge_weight_map & operator=(const SM_edge_weight_map &s)
Definition: sparsematrix_boost.h:445
SM_edge_weight_map(SM_edge_weight_map const &p)
Definition: sparsematrix_boost.h:433
value_type operator[](X const &x) const
Definition: sparsematrix_boost.h:441
T edge_weight_type
Definition: sparsematrix_boost.h:426
M const & _g
Definition: sparsematrix_boost.h:450
readable_property_map_tag category
Definition: sparsematrix_boost.h:428
Definition: sparsematrix_boost.h:152
SM_edge(SM_edge &&)=default
bool operator!=(const SM_edge &other) const
Definition: sparsematrix_boost.h:181
int target() const
Definition: sparsematrix_boost.h:169
SM_edge()
Definition: sparsematrix_boost.h:158
SM_edge & operator=(SM_edge const &)=default
SM_edge & operator=(SM_edge &&)=default
T _value
Definition: sparsematrix_boost.h:188
int _target
Definition: sparsematrix_boost.h:187
SM_edge(SM_edge const &)=default
int source() const
Definition: sparsematrix_boost.h:166
bool operator==(const SM_edge &other) const
Definition: sparsematrix_boost.h:178
SM_edge(int s, int t, T const &v)
Definition: sparsematrix_boost.h:160
T const & value(X const &) const
Definition: sparsematrix_boost.h:173
int _source
Definition: sparsematrix_boost.h:186
Definition: sparsematrix_boost.h:211
friend class iterator_core_access
Definition: sparsematrix_boost.h:305
reference dereference() const
Definition: sparsematrix_boost.h:264
void decrement()
Definition: sparsematrix_boost.h:278
SM_adjacency_iterator< T > value_type
Definition: sparsematrix_boost.h:221
ug::SparseMatrix< T > M
Definition: sparsematrix_boost.h:220
SM_out_edge_iterator & operator=(SM_out_edge_iterator const &other)=default
intmax_t difference_type
Definition: sparsematrix_boost.h:222
SM_out_edge_iterator(SM_out_edge_iterator const &p)
Definition: sparsematrix_boost.h:235
bool equal(SM_out_edge_iterator const &other) const
Definition: sparsematrix_boost.h:271
SM_out_edge_iterator & operator++()
Definition: sparsematrix_boost.h:286
value_type _base
Definition: sparsematrix_boost.h:303
bool operator==(const SM_out_edge_iterator &other) const
Definition: sparsematrix_boost.h:295
~SM_out_edge_iterator()
Definition: sparsematrix_boost.h:242
iterator_facade< SM_out_edge_iterator< T, out >, SM_adjacency_iterator< T >, std::input_iterator_tag, SM_edge< T >, std::intmax_t > base_class
Definition: sparsematrix_boost.h:219
void increment()
Definition: sparsematrix_boost.h:275
SM_out_edge_iterator()
Definition: sparsematrix_boost.h:227
bool operator!=(const SM_out_edge_iterator &other) const
Definition: sparsematrix_boost.h:298
SM_out_edge_iterator operator++(int)
Definition: sparsematrix_boost.h:290
SM_edge< T > edge_type
Definition: sparsematrix_boost.h:224
SM_edge< T > reference
Definition: sparsematrix_boost.h:223
SM_out_edge_iterator(SM_out_edge_iterator &&p)=delete
SM_out_edge_iterator & operator=(SM_out_edge_iterator &&other)=default
SM_out_edge_iterator(SM_adjacency_iterator< T > w, int src)
Definition: sparsematrix_boost.h:229
int _src
Definition: sparsematrix_boost.h:304
Definition: sparsematrix_boost.h:350
size_t vertex_index_type
Definition: sparsematrix_boost.h:352
vertex_descriptor key_type
Definition: sparsematrix_boost.h:357
vertex_index_type value_type
Definition: sparsematrix_boost.h:355
sparse_matrix_index_map(ug::SparseMatrix< T >const &, boost::vertex_index_t)
Definition: sparsematrix_boost.h:361
vertex_index_type reference
Definition: sparsematrix_boost.h:356
readable_property_map_tag category
Definition: sparsematrix_boost.h:354
size_t vertex_descriptor
Definition: sparsematrix_boost.h:353
sparse_matrix_index_map & operator=(const sparse_matrix_index_map &s)
Definition: sparsematrix_boost.h:370
value_type operator[](T_ x) const
Definition: sparsematrix_boost.h:367
sparse_matrix_index_map(sparse_matrix_index_map const &p)
Definition: sparsematrix_boost.h:359
sparse_matrix_index_map(X const &)
Definition: sparsematrix_boost.h:364
Definition: sparsematrix.h:421
size_t idx() const
Definition: sparsematrix.h:478
size_t index() const
Definition: sparsematrix.h:471
const value_type & value() const
Definition: sparsematrix.h:470
size_t num_rows() const
returns number of rows
Definition: sparsematrix.h:342
row_iterator end_row(size_t r)
Definition: sparsematrix.h:485
size_t num_cols() const
returns the number of cols
Definition: sparsematrix.h:345
row_iterator begin_row(size_t r)
Definition: sparsematrix.h:484
#define untested()
Definition: lua_table_handle.cpp:15
Definition: boost_serialization_routines.h:49
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
std::pair< counting_iterator< size_t >, counting_iterator< size_t > > vertices(ug::BidirectionalMatrix< T > const &M)
Definition: bidirectional_boost.h:60
SM_edge_weight_map< typename T::value_type, ug::BidirectionalMatrix< T > > get(edge_weight_t, ug::BidirectionalMatrix< T > const &g)
Definition: bidirectional_boost.h:157
int num_vertices(ug::BidirectionalMatrix< T > const &M)
Definition: bidirectional_boost.h:70
size_t target(SM_edge< typename T::value_type > const &e, ug::BidirectionalMatrix< T > const &m)
Definition: bidirectional_boost.h:100
size_t source(SM_edge< typename T::value_type > const &e, ug::BidirectionalMatrix< T > const &)
Definition: bidirectional_boost.h:94
bool iszero(__T __val)
Definition: sparsematrix_impl.h:53
AlphaMatVec_X_Expression< L, operation_sub, R > operator-(const TE_AMV_X< L > &l, const TE_AMV_X< R > &r)
create AlphaMatVec_X_Expression<L, operation_minus, R> by conjunction of TE_AMV_X<L> + TE_AMV_X<R>
Definition: template_expressions.h:215
AlphaMatVec_X_Expression< L, operation_add, R > operator+(const TE_AMV_X< L > &l, const TE_AMV_X< R > &r)
create AlphaMatVec_X_Expression<L, operation_add, R> by conjunction of TE_AMV_X<L> + TE_AMV_X<R>
Definition: template_expressions.h:208
Definition: sparsematrix_boost.h:309
SM_traversal_tag traversal_category
Definition: sparsematrix_boost.h:316
int degree_size_type
Definition: sparsematrix_boost.h:320
disallow_parallel_edge_tag edge_parallel_category
Definition: sparsematrix_boost.h:315
SM_adjacency_iterator< T > adjacency_iterator
Definition: sparsematrix_boost.h:319
int vertices_size_type
Definition: sparsematrix_boost.h:321
counting_iterator< size_t > vertex_iterator
Definition: sparsematrix_boost.h:317
int vertex_descriptor
Definition: sparsematrix_boost.h:312
SM_edge< T > edge_descriptor
Definition: sparsematrix_boost.h:313
directed_tag directed_category
Definition: sparsematrix_boost.h:314
SM_out_edge_iterator< T > out_edge_iterator
Definition: sparsematrix_boost.h:318
sparse_matrix_index_map< T > type
Definition: sparsematrix_boost.h:377
type const_type
Definition: sparsematrix_boost.h:378
#define incomplete()
Definition: trace.h:10
function ProblemDisc new(problemDesc, dom)