3 #ifndef DUNE_AMG_GRAPH_HH 4 #define DUNE_AMG_GRAPH_HH 11 #include <dune/common/typetraits.hh> 12 #include <dune/common/iteratorfacades.hh> 14 #include <dune/common/propertymap.hh> 64 typedef typename M::block_type
Weight;
84 mutableMatrix = std::is_same<M, typename std::remove_const<M>::type>::value
123 typedef typename std::conditional<
isMutable && C::mutableMatrix,
typename M::block_type,
124 const typename M::block_type>::type
152 typedef typename std::conditional<std::is_same<C, typename std::remove_const<C>::type>::value && C::mutableMatrix,
153 typename M::block_type,
const typename M::block_type>::type
177 VertexDescriptor
target()
const;
180 VertexDescriptor
source()
const;
190 VertexDescriptor source_;
199 EdgeDescriptor edge_;
262 typedef typename std::conditional<std::is_same<C, typename std::remove_const<C>::type>::value && C::mutableMatrix,
263 typename M::block_type,
const typename M::block_type>::type
272 const VertexDescriptor&
operator*()
const;
290 VertexDescriptor current_;
328 VertexIterator
begin();
334 VertexIterator
end();
340 ConstVertexIterator
begin()
const;
346 ConstVertexIterator
end()
const;
391 const Matrix&
matrix()
const;
418 const VertexDescriptor&
target)
const;
424 EdgeDescriptor* start_;
439 template<
class G,
class T>
473 : firstEdge_(firstEdge)
478 : firstEdge_(emap.firstEdge_)
483 return edge-firstEdge_;
487 EdgeDescriptor firstEdge_;
502 class EdgeIterator :
public RandomAccessIteratorFacade<EdgeIterator,const EdgeDescriptor>
533 const EdgeDescriptor& dereference()
const;
536 const VertexDescriptor&
target()
const;
539 const VertexDescriptor&
source()
const;
541 std::ptrdiff_t distanceTo(
const EdgeIterator& other)
const;
545 VertexDescriptor source_;
550 EdgeDescriptor edge_;
557 :
public ForwardIteratorFacade<VertexIterator,const VertexDescriptor>
567 const VertexDescriptor&
end);
588 const VertexDescriptor& dereference()
const;
608 VertexDescriptor current_;
610 VertexDescriptor end_;
627 ConstVertexIterator
begin()
const;
633 ConstVertexIterator
end()
const;
675 const VertexDescriptor&
target)
const;
683 SubGraph(
const Graph& graph,
const T& excluded);
694 std::size_t noVertices_;
696 VertexDescriptor endVertex_;
703 VertexDescriptor maxVertex_;
705 VertexDescriptor* edges_;
707 std::ptrdiff_t* start_;
709 std::ptrdiff_t* end_;
719 template<
class G,
class VP,
class VM=IdentityMap>
797 :
public std::conditional<std::is_same<typename std::remove_const<C>::type,
799 typename Graph::VertexIterator,
800 typename Graph::ConstVertexIterator>::type
808 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
810 typename Graph::VertexIterator,
811 typename Graph::ConstVertexIterator>::type
817 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
819 typename Graph::EdgeIterator,
820 typename Graph::ConstEdgeIterator>::type
851 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
853 const VertexProperties&>::type
861 EdgeIterator
begin() const;
868 EdgeIterator
end() const;
918 VertexProperties& getVertexProperties(const VertexDescriptor& vertex);
925 const VertexProperties& getVertexProperties(const VertexDescriptor& vertex) const;
931 const Graph& graph() const;
967 std::vector<VertexProperties> vertexProperties_;
974 template<
class G,
class VP,
class EP,
class VM=IdentityMap,
class EM=IdentityMap>
1032 :
public std::conditional<std::is_same<typename std::remove_const<C>::type,
1034 typename Graph::EdgeIterator,
1035 typename Graph::ConstEdgeIterator>::type
1044 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
1046 typename Graph::EdgeIterator,
1047 typename Graph::ConstEdgeIterator>::type
1077 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
1079 const EdgeProperties&>::type
1094 EdgeProperties,VM,EM> > EdgeIterator;
1101 EdgeProperties,VM,EM> > ConstEdgeIterator;
1108 EdgeIterator
beginEdges(const VertexDescriptor& source);
1115 EdgeIterator
endEdges(const VertexDescriptor& source);
1122 ConstEdgeIterator
beginEdges(const VertexDescriptor& source) const;
1129 ConstEdgeIterator
endEdges(const VertexDescriptor& source) const;
1134 :
public std::conditional<std::is_same<typename std::remove_const<C>::type,
1136 typename Graph::VertexIterator,
1137 typename Graph::ConstVertexIterator>::type
1145 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
1147 typename Graph::VertexIterator,
1148 typename Graph::ConstVertexIterator>::type
1179 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
1181 const VertexProperties&>::type
1248 VertexProperties& getVertexProperties(const VertexDescriptor& vertex);
1255 const VertexProperties& getVertexProperties(const VertexDescriptor& vertex) const;
1263 EdgeDescriptor
findEdge(const VertexDescriptor& source,
1264 const VertexDescriptor& target)
1274 EdgeProperties& getEdgeProperties(
const EdgeDescriptor& edge);
1282 const EdgeProperties& getEdgeProperties(
const EdgeDescriptor& edge)
const;
1290 EdgeProperties& getEdgeProperties(
const VertexDescriptor&
source,
1291 const VertexDescriptor&
target);
1299 const EdgeProperties& getEdgeProperties(
const VertexDescriptor& source,
1300 const VertexDescriptor& target)
const;
1306 const Graph& graph()
const;
1333 const EdgeMap& emap=EdgeMap());
1344 std::vector<VertexProperties> vertexProperties_;
1348 std::vector<EdgeProperties> edgeProperties_;
1357 template<
typename G>
1395 return graph_->getVertexProperties(vertex);
1405 template<
typename G>
1420 typedef typename G::EdgeDescriptor
Edge;
1442 return graph_->getEdgeProperties(edge);
1459 template<
class G,
class V>
1460 int visitNeighbours(
const G& graph,
const typename G::VertexDescriptor& vertex,
1469 if(matrix_.N()!=matrix_.M())
1470 DUNE_THROW(
ISTLError,
"Matrix has to have as many columns as rows!");
1472 start_ =
new EdgeDescriptor[matrix_.N()+1];
1474 typedef typename M::ConstIterator Iterator;
1475 start_[matrix_.begin().index()] = 0;
1477 for(Iterator row=matrix_.begin(); row != matrix_.end(); ++row)
1478 start_[row.index()+1] = start_[row.index()] + row->size();
1490 return start_[matrix_.N()];
1502 return matrix_.N()-1;
1508 const VertexDescriptor&
target)
const 1510 typename M::ConstColIterator found =matrix_[
source].find(target);
1511 if(found == matrix_[source].
end())
1512 return std::numeric_limits<EdgeDescriptor>::max();
1513 std::size_t offset = found.offset();
1519 return start_[
source]+offset;
1539 : source_(source), block_(block), blockEnd_(end), edge_(edge)
1541 if(block_!=blockEnd_ && block_.index() == source_) {
1557 : source_(other.source_), block_(other.block_), blockEnd_(other.blockEnd_), edge_(other.edge_)
1576 if(block_!=blockEnd_ && block_.index() == source_) {
1588 return block_!=other.block_;
1595 return block_!=other.block_;
1602 return block_==other.block_;
1609 return block_==other.block_;
1616 return block_.index();
1643 const VertexDescriptor& current)
1644 : graph_(graph), current_(current)
1657 : graph_(other.graph_), current_(other.current_)
1664 return current_ != other.current_;
1671 return current_ != other.current_;
1679 return current_ == other.current_;
1686 return current_ == other.current_;
1702 return graph_->
matrix()[current_][current_];
1718 return graph_->beginEdges(current_);
1726 return graph_->endEdges(current_);
1762 return EdgeIterator(source, matrix_.operator[](source).begin(),
1790 template<
class G,
class T>
1792 const EdgeDescriptor& edge)
1793 : source_(source), edge_(edge)
1797 template<
class G,
class T>
1802 template<
class G,
class T>
1805 return EdgeIndexMap(edges_);
1808 template<
class G,
class T>
1811 return other.edge_==edge_;
1814 template<
class G,
class T>
1821 template<
class G,
class T>
1828 template<
class G,
class T>
1834 template<
class G,
class T>
1840 template<
class G,
class T>
1847 template<
class G,
class T>
1853 template<
class G,
class T>
1856 return other.edge_-edge_;
1859 template<
class G,
class T>
1861 const VertexDescriptor& current,
1862 const VertexDescriptor& end)
1863 : graph_(graph), current_(current), end_(end)
1866 typedef typename T::const_iterator Iterator;
1868 for(Iterator vertex = graph_->excluded_.begin();
1869 current_ != end_ && *vertex;
1872 assert(current_ == end_ || !graph_->excluded_[current_]);
1875 template<
class G,
class T>
1880 template<
class G,
class T>
1885 while(current_ != end_ && graph_->excluded_[current_])
1888 assert(current_ == end_ || !graph_->excluded_[current_]);
1892 template<
class G,
class T>
1895 return current_==other.current_;
1898 template<
class G,
class T>
1904 template<
class G,
class T>
1907 return graph_->beginEdges(current_);
1910 template<
class G,
class T>
1913 return graph_->endEdges(current_);
1916 template<
class G,
class T>
1923 template<
class G,
class T>
1930 template<
class G,
class T>
1936 template<
class G,
class T>
1942 template<
class G,
class T>
1948 template<
class G,
class T>
1954 template<
class G,
class T>
1960 template<
class G,
class T>
1962 const VertexDescriptor& target)
const 1964 const EdgeDescriptor edge = std::lower_bound(edges_+start_[source], edges_+end_[source], target);
1965 if(edge==edges_+end_[source] || *edge!=target)
1966 return std::numeric_limits<EdgeDescriptor>::max();
1971 template<
class G,
class T>
1979 template<
class G,
class T>
1981 : excluded_(excluded), noVertices_(0), endVertex_(0), maxVertex_(graph.maxVertex())
1983 start_ =
new std::ptrdiff_t[graph.noVertices()];
1984 end_ =
new std::ptrdiff_t[graph.noVertices()];
1985 edges_ =
new VertexDescriptor[graph.noEdges()];
1987 VertexDescriptor* edge=edges_;
1989 typedef typename Graph::ConstVertexIterator Iterator;
1990 Iterator endVertex=graph.end();
1992 for(Iterator vertex = graph.begin(); vertex != endVertex; ++vertex)
1993 if(excluded_[*vertex])
1994 start_[*vertex]=end_[*vertex]=-1;
1997 endVertex_ = std::max(*vertex, endVertex_);
1999 start_[*vertex] = edge-edges_;
2001 typedef typename Graph::ConstEdgeIterator Iterator;
2002 Iterator endEdge = vertex.end();
2004 for(Iterator iter=vertex.begin(); iter!= endEdge; ++iter)
2005 if(!excluded[iter.target()]) {
2006 *edge = iter.target();
2010 end_[*vertex] = edge - edges_;
2013 std::sort(edges_+start_[*vertex], edge);
2015 noEdges_ = edge-edges_;
2019 template<
class G,
class V,
class VM>
2022 return graph_.noEdges();
2025 template<
class G,
class V,
class VM>
2029 return graph_.beginEdges(source);
2032 template<
class G,
class V,
class VM>
2036 return graph_.endEdges(source);
2039 template<
class G,
class V,
class VM>
2043 return graph_.beginEdges(source);
2046 template<
class G,
class V,
class VM>
2050 return graph_.endEdges(source);
2053 template<
class G,
class V,
class VM>
2058 : Father(iter), graph_(graph)
2061 template<
class G,
class V,
class VM>
2068 template<
class G,
class V,
class VM>
2073 : Father(other), graph_(other.graph_)
2076 template<
class G,
class V,
class VM>
2078 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
2085 template<
class G,
class V,
class VM>
2087 typename std::conditional<std::is_same<typename std::remove_const<C>::type,
2089 typename G::EdgeIterator,
2090 typename G::ConstEdgeIterator>::type
2093 return graph_->beginEdges(Father::operator*());
2096 template<
class G,
class V,
class VM>
2098 typename std::conditional<std::is_same<typename std::remove_const<C>::type,
2100 typename G::EdgeIterator,
2101 typename G::ConstEdgeIterator>::type
2104 return graph_->endEdges(Father::operator*());
2107 template<
class G,
class V,
class VM>
2113 template<
class G,
class V,
class VM>
2120 template<
class G,
class V,
class VM>
2126 template<
class G,
class V,
class VM>
2132 template<
class G,
class V,
class VM>
2135 return vertexProperties_[vmap_[vertex]];
2138 template<
class G,
class V,
class VM>
2141 return vertexProperties_[vmap_[vertex]];
2144 template<
class G,
class V,
class VM>
2150 template<
class G,
class V,
class VM>
2153 return graph_.noVertices();
2157 template<
class G,
class V,
class VM>
2160 return graph_.maxVertex();
2163 template<
class G,
class V,
class VM>
2165 : graph_(graph), vmap_(vmap), vertexProperties_(vmap_[graph_.maxVertex()+1], V())
2168 template<
class G,
class V,
class E,
class VM,
class EM>
2172 : Father(iter), graph_(graph)
2175 template<
class G,
class V,
class E,
class VM,
class EM>
2181 template<
class G,
class V,
class E,
class VM,
class EM>
2185 : Father(other), graph_(other.graph_)
2189 template<
class G,
class V,
class E,
class VM,
class EM>
2192 return graph_.noEdges();
2195 template<
class G,
class V,
class E,
class VM,
class EM>
2197 inline typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,E&,
const E&>::type
2203 template<
class G,
class V,
class E,
class VM,
class EM>
2210 template<
class G,
class V,
class E,
class VM,
class EM>
2217 template<
class G,
class V,
class E,
class VM,
class EM>
2224 template<
class G,
class V,
class E,
class VM,
class EM>
2231 template<
class G,
class V,
class E,
class VM,
class EM>
2236 : Father(iter), graph_(graph)
2239 template<
class G,
class V,
class E,
class VM,
class EM>
2246 template<
class G,
class V,
class E,
class VM,
class EM>
2251 : Father(other), graph_(other.graph_)
2254 template<
class G,
class V,
class E,
class VM,
class EM>
2256 inline typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
2263 template<
class G,
class V,
class E,
class VM,
class EM>
2268 return graph_->beginEdges(Father::operator*());
2271 template<
class G,
class V,
class E,
class VM,
class EM>
2276 return graph_->endEdges(Father::operator*());
2279 template<
class G,
class V,
class E,
class VM,
class EM>
2285 template<
class G,
class V,
class E,
class VM,
class EM>
2292 template<
class G,
class V,
class E,
class VM,
class EM>
2298 template<
class G,
class V,
class E,
class VM,
class EM>
2304 template<
class G,
class V,
class E,
class VM,
class EM>
2307 return vertexProperties_[vmap_[vertex]];
2310 template<
class G,
class V,
class E,
class VM,
class EM>
2313 return vertexProperties_[vmap_[vertex]];
2316 template<
class G,
class V,
class E,
class VM,
class EM>
2319 return edgeProperties_[emap_[edge]];
2322 template<
class G,
class V,
class E,
class VM,
class EM>
2325 return edgeProperties_[emap_[edge]];
2328 template<
class G,
class V,
class E,
class VM,
class EM>
2330 const VertexDescriptor& target)
2332 return getEdgeProperties(graph_.findEdge(source,target));
2335 template<
class G,
class V,
class E,
class VM,
class EM>
2337 const VertexDescriptor& target)
const 2339 return getEdgeProperties(graph_.findEdge(source,target));
2342 template<
class G,
class V,
class E,
class VM,
class EM>
2348 template<
class G,
class V,
class E,
class VM,
class EM>
2351 return graph_.noVertices();
2355 template<
class G,
class V,
class E,
class VM,
class EM>
2358 return graph_.maxVertex();
2361 template<
class G,
class V,
class E,
class VM,
class EM>
2363 : graph_(graph), vmap_(vmap), vertexProperties_(vmap_[graph_.maxVertex()+1], V()),
2364 emap_(emap), edgeProperties_(graph_.noEdges(), E())
2367 template<
class G,
class V>
2368 inline int visitNeighbours(
const G& graph,
const typename G::VertexDescriptor& vertex,
2371 typedef typename G::ConstEdgeIterator iterator;
2372 const iterator end = graph.endEdges(vertex);
2374 for(iterator edge = graph.beginEdges(vertex); edge !=
end; ++edge, ++noNeighbours)
2376 return noNeighbours;
Attaches properties to the edges and vertices of a graph.
Definition: graph.hh:975
EdgeDescriptor findEdge(const VertexDescriptor &source, const VertexDescriptor &target) const
Find the descriptor of an edge.
VP VertexProperties
The type of the properties of the vertices.
Definition: graph.hh:996
const std::remove_const< C >::type ConstContainer
The constant type of the container type.
Definition: graph.hh:103
The vertex iterator of the graph.
Definition: graph.hh:556
std::size_t noEdges() const
Get the number of edges in the graph.
WeightType & weight() const
Access the edge weight.
Wrapper to access the internal edge properties of a graph via operator[]()
Definition: graph.hh:1358
EP EdgeProperties
The type of the properties of the edges;.
Definition: graph.hh:1014
block_vector_unmanaged< B, A >::Iterator Iterator
make iterators available as types
Definition: bvector.hh:674
Graph::ConstEdgeIterator ConstEdgeIterator
The type of the constant edge iterator.
Definition: graph.hh:764
std::conditional< isMutable &&C::mutableMatrix, typename Matrix::row_type::Iterator, typename Matrix::row_type::ConstIterator >::type ColIterator
The column iterator of the matrix we use.
Definition: graph.hh:118
VertexIterator(const SubGraph< G, T > *graph, const VertexDescriptor ¤t, const VertexDescriptor &end)
Constructor.
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:731
std::size_t noVertices() const
Get the number of vertices in the graph.
const Graph & graph() const
Get the graph the properties are attached to.
EdgeIterator begin() const
Get an iterator over all edges starting at the current vertex.
GraphEdgePropertiesSelector(G &g)
Constructor.
Definition: graph.hh:1426
const EdgeDescriptor & dereference() const
The descriptor of the current edge.
bool operator==(const EdgeIteratorT< typename std::remove_const< C >::type > &other) const
Equality operator.
std::remove_const< C >::type MutableContainer
The mutable type of the container type.
Definition: graph.hh:212
bool operator!=(const EdgeIteratorT< typename std::remove_const< C >::type > &other) const
Inequality operator.
GraphVertexPropertiesSelector()
Default constructor.
Definition: graph.hh:1384
const EdgeDescriptor * operator->() const
Get the edge descriptor.
std::size_t noVertices() const
Get the number of vertices in the graph.
std::ptrdiff_t EdgeDescriptor
The edge descriptor.
Definition: graph.hh:78
ConstEdgeIterator endEdges(const VertexDescriptor &source) const
Get an iterator over the edges starting at a vertex.
std::ptrdiff_t distanceTo(const EdgeIterator &other) const
Graph::EdgeDescriptor EdgeDescriptor
The edge descritor.
Definition: graph.hh:736
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
EdgeIterator & advance(std::ptrdiff_t n)
Iterator implementation class.
Definition: basearray.hh:84
EdgeDescriptor findEdge(const VertexDescriptor &source, const VertexDescriptor &target) const
Find the descriptor of an edge.
A subgraph of a graph.
Definition: graph.hh:440
EdgeIteratorT< MatrixGraph< Matrix > > EdgeIterator
The mutable edge iterator type.
Definition: graph.hh:301
std::conditional< std::is_same< C, typename std::remove_const< C >::type >::value &&C::mutableMatrix, typename M::block_type, const typename M::block_type >::type WeightType
Definition: graph.hh:154
The (undirected) graph of a matrix.
Definition: graph.hh:48
std::conditional< std::is_same< C, typename std::remove_const< C >::type >::value &&C::mutableMatrix, typename M::block_type, const typename M::block_type >::type WeightType
Definition: graph.hh:264
VertexIterator end()
Get an iterator over the vertices.
EdgeProperties & operator[](const Edge &edge) const
Get the properties associated to a vertex.
Definition: graph.hh:1440
G Graph
The type of the graph with internal properties.
Definition: graph.hh:1364
Graph::EdgeIterator EdgeIterator
The type of the mutable edge iterator.
Definition: graph.hh:759
whether C is mutable.
Definition: graph.hh:110
std::remove_const< M >::type MutableMatrix
The mutable type of the matrix we are a graph for.
Definition: graph.hh:59
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:986
VertexIterator end()
Get an iterator over the vertices.
EdgeIndexMap getEdgeIndexMap()
Get an edge index map for the graph.
EdgeIterator & decrement()
Preincrement operator.
const VertexDescriptor & target() const
The index of the target vertex of the current edge.
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:457
The edge iterator of the graph.
Definition: graph.hh:502
EdgeIndexMap(const EdgeIndexMap &emap)
Protect copy construction.
Definition: graph.hh:477
EdgeProperties & getEdgeProperties(const EdgeDescriptor &edge)
Get the properties associated with a edge.
The vertex iterator type of the graph.
Definition: graph.hh:206
std::remove_const< C >::type MutableContainer
The mutable type of the container type.
Definition: graph.hh:99
VertexIterator & increment()
Preincrement operator.
MatrixGraph(Matrix &matrix)
Constructor.
EdgeIterator ConstEdgeIterator
The constant edge iterator type.
Definition: graph.hh:616
int visitNeighbours(const G &graph, const typename G::VertexDescriptor &vertex, V &visitor)
Visit all neighbour vertices of a vertex in a graph.
std::size_t noVertices() const
Get the number of vertices in the graph.
EdgeIteratorT(const VertexDescriptor &source, const ColIterator &block, const ColIterator &end, const EdgeDescriptor &edge)
Constructor.
ConstVertexIterator end() const
Get an iterator over the vertices.
Definition: graph.hh:1031
M::block_type Weight
The type of the weights.
Definition: graph.hh:64
std::conditional< std::is_same< typename std::remove_const< C >::type, C >::value, typename Graph::EdgeIterator, typename Graph::ConstEdgeIterator >::type Father
The father class.
Definition: graph.hh:1048
EdgeIterator endEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
Attaches properties to the vertices of a graph.
Definition: graph.hh:720
VertexIterator begin()
Get an iterator over the vertices.
G Graph
The graph we attach properties to.
Definition: graph.hh:981
VertexIterator begin()
Get an iterator over the vertices.
EdgeIterator(const VertexDescriptor &source, const EdgeDescriptor &edge)
Constructor.
std::conditional< std::is_same< typename std::remove_const< C >::type, C >::value, typename Graph::VertexIterator, typename Graph::ConstVertexIterator >::type Father
The father class.
Definition: graph.hh:812
std::conditional< isMutable &&C::mutableMatrix, typename M::block_type, const typename M::block_type >::type Weight
The matrix block type we use as weights.
Definition: graph.hh:125
ConstVertexIterator begin() const
Get an iterator over the vertices.
G::EdgeDescriptor Edge
The edge descriptor.
Definition: graph.hh:1420
std::size_t noEdges() const
Get the number of edges in the graph.
T Excluded
Random access container providing information about which vertices are excluded.
Definition: graph.hh:452
std::size_t noEdges() const
Get the number of edges in the graph.
GraphEdgePropertiesSelector()
Default constructor.
Definition: graph.hh:1432
EdgeIterator & increment()
Preincrement operator.
~MatrixGraph()
Destructor.
Definition: basearray.hh:19
M Matrix
The type of the matrix we are a graph for.
Definition: graph.hh:54
G::VertexProperties VertexProperties
The type of the vertex properties.
Definition: graph.hh:1368
VertexIteratorT< const MatrixGraph< Matrix > > ConstVertexIterator
The constant vertex iterator type.
Definition: graph.hh:306
Matrix & matrix()
Get the underlying matrix.
VertexProperties & getVertexProperties(const VertexDescriptor &vertex)
Get the properties associated with a vertex.
const VertexDescriptor & source() const
The index of the source vertex of the current edge.
ConstEdgeIterator beginEdges(const VertexDescriptor &source) const
Get an iterator over the edges starting at a vertex.
EdgeIterator beginEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
EdgeIteratorT< C > & operator++()
preincrement operator.
Definition: graph.hh:1133
VertexProperties & operator[](const Vertex &vertex) const
Get the properties associated to a vertex.
Definition: graph.hh:1393
G Graph
The graph we attach properties to.
Definition: graph.hh:726
EdgeIterator end() const
Get an iterator over all edges starting at the current vertex.
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
Graph::EdgeDescriptor EdgeDescriptor
The edge descritor.
Definition: graph.hh:991
G::EdgeProperties EdgeProperties
The type of the vertex properties.
Definition: graph.hh:1416
PropertiesGraph(Graph &graph, const VertexMap &vmap=VertexMap(), const EdgeMap &emap=EdgeMap())
Constructor.
VertexDescriptor source() const
The index of the source vertex of the current edge.
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
std::size_t noEdges() const
Get the number of edges in the graph.
bool equals(const EdgeIterator &other) const
Equality operator.
std::size_t noVertices() const
Get the number of vertices in the graph.
EdgeIndexMap(const EdgeDescriptor &firstEdge)
Definition: graph.hh:472
bool equals(const VertexIterator &other) const
Equality iterator.
VP VertexProperties
The type of the properties of the vertices.
Definition: graph.hh:741
G::VertexDescriptor Vertex
The vertex descriptor.
Definition: graph.hh:1372
const std::remove_const< C >::type ConstContainer
The constant type of the container type.
Definition: graph.hh:216
std::conditional< std::is_same< typename std::remove_const< C >::type, C >::value, typename Graph::VertexIterator, typename Graph::ConstVertexIterator >::type Father
The father class.
Definition: graph.hh:1149
VertexIteratorT< MatrixGraph< Matrix > > VertexIterator
The mutable vertex iterator type.
Definition: graph.hh:311
VertexPropertiesGraph(Graph &graph, const VertexMap vmap=VertexMap())
Constructor.
GraphVertexPropertiesSelector(G &g)
Constructor.
Definition: graph.hh:1378
ReadablePropertyMapTag Category
Definition: graph.hh:470
SubGraph(const Graph &graph, const T &excluded)
Constructor.
VertexIterator begin()
Get an iterator over the vertices.
VertexIterator end()
Get an iterator over the vertices.
EdgeIterator beginEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
VertexProperties & getVertexProperties(const VertexDescriptor &vertex)
Get the properties associated with a vertex.
M::size_type VertexDescriptor
The vertex descriptor.
Definition: graph.hh:71
VertexDescriptor target() const
The index of the target vertex of the current edge.
const EdgeDescriptor & operator*() const
Get the edge descriptor.
derive error class from the base class in common
Definition: istlexception.hh:16
VM VertexMap
The type of the map for converting the VertexDescriptor to std::size_t.
Definition: graph.hh:1009
G Graph
The type of the graph we are a sub graph for.
Definition: graph.hh:446
VertexIterator ConstVertexIterator
The constant vertex iterator type.
Definition: graph.hh:621
EdgeIteratorT< const MatrixGraph< Matrix > > ConstEdgeIterator
The constant edge iterator type.
Definition: graph.hh:296
An index map for mapping the edges to indices.
Definition: graph.hh:467
VM VertexMap
The type of the map for converting the VertexDescriptor to std::size_t.
Definition: graph.hh:754
Wrapper to access the internal vertex properties of a graph via operator[]()
Definition: graph.hh:1406
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
Iterator over all edges starting from a vertex.
Definition: graph.hh:92
EM EdgeMap
The type of the map for converting the EdgeDescriptor to std::size_t.
Definition: graph.hh:1028
const VertexDescriptor & dereference() const
Get the descriptor of the current vertex.
EdgeIterator endEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
EdgeIterator beginEdges(const VertexDescriptor &source)
Get an iterator over the edges starting at a vertex.
const Graph & graph() const
Get the graph the properties are attached to.
G Graph
The type of the graph with internal properties.
Definition: graph.hh:1412
std::size_t operator[](const EdgeDescriptor &edge) const
Definition: graph.hh:481
VertexDescriptor * EdgeDescriptor
Definition: graph.hh:459
EdgeIterator endEdges(const VertexDescriptor &source)
Get an iterator over the edges starting at a vertex.