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
116 typedef typename std::conditional<
isMutable && C::mutableMatrix,
typename Matrix::row_type::Iterator,
117 typename Matrix::row_type::ConstIterator>::type
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_;
1991 if ( graph.noVertices() == 0)
1994 typedef typename Graph::ConstVertexIterator Iterator;
1995 Iterator endVertex=graph.end();
1997 for(Iterator vertex = graph.begin(); vertex != endVertex; ++vertex)
1998 if(excluded_[*vertex])
1999 start_[*vertex]=end_[*vertex]=-1;
2002 endVertex_ = std::max(*vertex, endVertex_);
2004 start_[*vertex] = edge-edges_;
2006 typedef typename Graph::ConstEdgeIterator Iterator;
2007 Iterator endEdge = vertex.end();
2009 for(Iterator iter=vertex.begin(); iter!= endEdge; ++iter)
2010 if(!excluded[iter.target()]) {
2011 *edge = iter.target();
2015 end_[*vertex] = edge - edges_;
2018 std::sort(edges_+start_[*vertex], edge);
2020 noEdges_ = edge-edges_;
2024 template<
class G,
class V,
class VM>
2027 return graph_.noEdges();
2030 template<
class G,
class V,
class VM>
2034 return graph_.beginEdges(source);
2037 template<
class G,
class V,
class VM>
2041 return graph_.endEdges(source);
2044 template<
class G,
class V,
class VM>
2048 return graph_.beginEdges(source);
2051 template<
class G,
class V,
class VM>
2055 return graph_.endEdges(source);
2058 template<
class G,
class V,
class VM>
2063 : Father(iter), graph_(graph)
2066 template<
class G,
class V,
class VM>
2073 template<
class G,
class V,
class VM>
2078 : Father(other), graph_(other.graph_)
2081 template<
class G,
class V,
class VM>
2083 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
2090 template<
class G,
class V,
class VM>
2092 typename std::conditional<std::is_same<typename std::remove_const<C>::type,
2094 typename G::EdgeIterator,
2095 typename G::ConstEdgeIterator>::type
2098 return graph_->beginEdges(Father::operator*());
2101 template<
class G,
class V,
class VM>
2103 typename std::conditional<std::is_same<typename std::remove_const<C>::type,
2105 typename G::EdgeIterator,
2106 typename G::ConstEdgeIterator>::type
2109 return graph_->endEdges(Father::operator*());
2112 template<
class G,
class V,
class VM>
2118 template<
class G,
class V,
class VM>
2125 template<
class G,
class V,
class VM>
2131 template<
class G,
class V,
class VM>
2137 template<
class G,
class V,
class VM>
2140 return vertexProperties_[vmap_[vertex]];
2143 template<
class G,
class V,
class VM>
2146 return vertexProperties_[vmap_[vertex]];
2149 template<
class G,
class V,
class VM>
2155 template<
class G,
class V,
class VM>
2158 return graph_.noVertices();
2162 template<
class G,
class V,
class VM>
2165 return graph_.maxVertex();
2168 template<
class G,
class V,
class VM>
2170 : graph_(graph), vmap_(vmap), vertexProperties_(vmap_[graph_.maxVertex()+1], V())
2173 template<
class G,
class V,
class E,
class VM,
class EM>
2177 : Father(iter), graph_(graph)
2180 template<
class G,
class V,
class E,
class VM,
class EM>
2186 template<
class G,
class V,
class E,
class VM,
class EM>
2190 : Father(other), graph_(other.graph_)
2194 template<
class G,
class V,
class E,
class VM,
class EM>
2197 return graph_.noEdges();
2200 template<
class G,
class V,
class E,
class VM,
class EM>
2202 inline typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,E&,
const E&>::type
2208 template<
class G,
class V,
class E,
class VM,
class EM>
2215 template<
class G,
class V,
class E,
class VM,
class EM>
2222 template<
class G,
class V,
class E,
class VM,
class EM>
2229 template<
class G,
class V,
class E,
class VM,
class EM>
2236 template<
class G,
class V,
class E,
class VM,
class EM>
2241 : Father(iter), graph_(graph)
2244 template<
class G,
class V,
class E,
class VM,
class EM>
2251 template<
class G,
class V,
class E,
class VM,
class EM>
2256 : Father(other), graph_(other.graph_)
2259 template<
class G,
class V,
class E,
class VM,
class EM>
2261 inline typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
2268 template<
class G,
class V,
class E,
class VM,
class EM>
2273 return graph_->beginEdges(Father::operator*());
2276 template<
class G,
class V,
class E,
class VM,
class EM>
2281 return graph_->endEdges(Father::operator*());
2284 template<
class G,
class V,
class E,
class VM,
class EM>
2290 template<
class G,
class V,
class E,
class VM,
class EM>
2297 template<
class G,
class V,
class E,
class VM,
class EM>
2303 template<
class G,
class V,
class E,
class VM,
class EM>
2309 template<
class G,
class V,
class E,
class VM,
class EM>
2312 return vertexProperties_[vmap_[vertex]];
2315 template<
class G,
class V,
class E,
class VM,
class EM>
2318 return vertexProperties_[vmap_[vertex]];
2321 template<
class G,
class V,
class E,
class VM,
class EM>
2324 return edgeProperties_[emap_[edge]];
2327 template<
class G,
class V,
class E,
class VM,
class EM>
2330 return edgeProperties_[emap_[edge]];
2333 template<
class G,
class V,
class E,
class VM,
class EM>
2335 const VertexDescriptor& target)
2337 return getEdgeProperties(graph_.findEdge(source,target));
2340 template<
class G,
class V,
class E,
class VM,
class EM>
2342 const VertexDescriptor& target)
const 2344 return getEdgeProperties(graph_.findEdge(source,target));
2347 template<
class G,
class V,
class E,
class VM,
class EM>
2353 template<
class G,
class V,
class E,
class VM,
class EM>
2356 return graph_.noVertices();
2360 template<
class G,
class V,
class E,
class VM,
class EM>
2363 return graph_.maxVertex();
2366 template<
class G,
class V,
class E,
class VM,
class EM>
2368 : graph_(graph), vmap_(vmap), vertexProperties_(vmap_[graph_.maxVertex()+1], V()),
2369 emap_(emap), edgeProperties_(graph_.noEdges(), E())
2372 template<
class G,
class V>
2373 inline int visitNeighbours(
const G& graph,
const typename G::VertexDescriptor& vertex,
2376 typedef typename G::ConstEdgeIterator iterator;
2377 const iterator end = graph.endEdges(vertex);
2379 for(iterator edge = graph.beginEdges(vertex); edge !=
end; ++edge, ++noNeighbours)
2381 return noNeighbours;
G Graph
The type of the graph we are a sub graph for.
Definition: graph.hh:446
std::size_t noEdges() const
Get the number of edges in the graph.
EdgeIterator beginEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
const Graph & graph() const
Get the graph the properties are attached to.
G::VertexProperties VertexProperties
The type of the vertex properties.
Definition: graph.hh:1368
PropertiesGraph(Graph &graph, const VertexMap &vmap=VertexMap(), const EdgeMap &emap=EdgeMap())
Constructor.
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:457
Graph::EdgeDescriptor EdgeDescriptor
The edge descritor.
Definition: graph.hh:736
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
VertexIterator(const SubGraph< G, T > *graph, const VertexDescriptor ¤t, const VertexDescriptor &end)
Constructor.
ConstEdgeIterator endEdges(const VertexDescriptor &source) const
Get an iterator over the edges starting at a vertex.
VM VertexMap
The type of the map for converting the VertexDescriptor to std::size_t.
Definition: graph.hh:1009
VertexDescriptor source() const
The index of the source vertex of the current edge.
The edge iterator of the graph.
Definition: graph.hh:502
EdgeIterator endEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
Definition: allocator.hh:7
std::size_t noVertices() const
Get the number of vertices in the graph.
std::size_t noVertices() const
Get the number of vertices in the graph.
std::size_t noEdges() const
Get the number of edges in the graph.
ConstVertexIterator end() const
Get an iterator over the vertices.
bool operator==(const EdgeIteratorT< typename std::remove_const< C >::type > &other) const
Equality operator.
bool operator!=(const EdgeIteratorT< typename std::remove_const< C >::type > &other) const
Inequality operator.
G Graph
The type of the graph with internal properties.
Definition: graph.hh:1364
VertexPropertiesGraph(Graph &graph, const VertexMap vmap=VertexMap())
Constructor.
const EdgeDescriptor * operator->() const
Get the edge descriptor.
VertexProperties & getVertexProperties(const VertexDescriptor &vertex)
Get the properties associated with a vertex.
Definition: graph.hh:1031
VM VertexMap
The type of the map for converting the VertexDescriptor to std::size_t.
Definition: graph.hh:754
int visitNeighbours(const G &graph, const typename G::VertexDescriptor &vertex, V &visitor)
Visit all neighbour vertices of a vertex in a graph.
EdgeIteratorT< C > & operator++()
preincrement operator.
std::remove_const< M >::type MutableMatrix
The mutable type of the matrix we are a graph for.
Definition: graph.hh:59
EdgeIterator & decrement()
Preincrement operator.
VertexProperties & operator[](const Vertex &vertex) const
Get the properties associated to a vertex.
Definition: graph.hh:1393
Attaches properties to the vertices of a graph.
Definition: graph.hh:720
G Graph
The graph we attach properties to.
Definition: graph.hh:726
Matrix & matrix()
Get the underlying matrix.
M::size_type VertexDescriptor
The vertex descriptor.
Definition: graph.hh:71
std::size_t noVertices() const
Get the number of vertices in the graph.
VertexIteratorT< MatrixGraph< Matrix > > VertexIterator
The mutable vertex iterator type.
Definition: graph.hh:311
const VertexDescriptor & dereference() const
Get the descriptor of the current vertex.
EdgeIterator ConstEdgeIterator
The constant edge iterator type.
Definition: graph.hh:616
EP EdgeProperties
The type of the properties of the edges;.
Definition: graph.hh:1014
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
std::ptrdiff_t distanceTo(const EdgeIterator &other) const
Wrapper to access the internal edge properties of a graph via operator[]()
Definition: graph.hh:1358
EdgeIterator begin() const
Get an iterator over all edges starting at the current vertex.
EdgeProperties & getEdgeProperties(const EdgeDescriptor &edge)
Get the properties associated with a edge.
const std::remove_const< C >::type ConstContainer
The constant type of the container type.
Definition: graph.hh:216
VertexIterator end()
Get an iterator over the vertices.
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
T Excluded
Random access container providing information about which vertices are excluded.
Definition: graph.hh:452
EdgeIterator beginEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
std::size_t noEdges() const
Get the number of edges in the graph.
std::remove_const< C >::type MutableContainer
The mutable type of the container type.
Definition: graph.hh:99
GraphEdgePropertiesSelector()
Default constructor.
Definition: graph.hh:1432
M Matrix
The type of the matrix we are a graph for.
Definition: graph.hh:54
EdgeIterator endEdges(const VertexDescriptor &source)
Get an iterator over the edges starting at a vertex.
std::ptrdiff_t EdgeDescriptor
The edge descriptor.
Definition: graph.hh:78
const std::remove_const< C >::type ConstContainer
The constant type of the container type.
Definition: graph.hh:103
const EdgeDescriptor & dereference() const
The descriptor of the current edge.
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
Graph::ConstEdgeIterator ConstEdgeIterator
The type of the constant edge iterator.
Definition: graph.hh:764
VP VertexProperties
The type of the properties of the vertices.
Definition: graph.hh:996
whether C is mutable.
Definition: graph.hh:110
EdgeIterator & advance(std::ptrdiff_t n)
std::remove_const< C >::type MutableContainer
The mutable type of the container type.
Definition: graph.hh:212
~MatrixGraph()
Destructor.
MatrixGraph(Matrix &matrix)
Constructor.
EdgeIteratorT< const MatrixGraph< Matrix > > ConstEdgeIterator
The constant edge iterator type.
Definition: graph.hh:296
const VertexDescriptor & target() const
The index of the target vertex of the current edge.
VertexIterator end()
Get an iterator over the vertices.
The (undirected) graph of a matrix.
Definition: graph.hh:48
EdgeIndexMap getEdgeIndexMap()
Get an edge index map for the graph.
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.
EdgeIterator beginEdges(const VertexDescriptor &source)
Get an iterator over the edges starting at a vertex.
The vertex iterator of the graph.
Definition: graph.hh:556
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:731
const EdgeDescriptor & operator*() const
Get the edge descriptor.
VertexIterator begin()
Get an iterator over the vertices.
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
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
VertexIterator & increment()
Preincrement operator.
VertexDescriptor * EdgeDescriptor
Definition: graph.hh:459
EdgeDescriptor findEdge(const VertexDescriptor &source, const VertexDescriptor &target) const
Find the descriptor of an edge.
const Graph & graph() const
Get the graph the properties are attached to.
GraphEdgePropertiesSelector(G &g)
Constructor.
Definition: graph.hh:1426
derive error class from the base class in common
Definition: istlexception.hh:16
G Graph
The graph we attach properties to.
Definition: graph.hh:981
EdgeIterator(const VertexDescriptor &source, const EdgeDescriptor &edge)
Constructor.
The vertex iterator type of the graph.
Definition: graph.hh:206
bool equals(const VertexIterator &other) const
Equality iterator.
Definition: graph.hh:1133
WeightType & weight() const
Access the edge weight.
M::block_type Weight
The type of the weights.
Definition: graph.hh:64
GraphVertexPropertiesSelector()
Default constructor.
Definition: graph.hh:1384
G::VertexDescriptor Vertex
The vertex descriptor.
Definition: graph.hh:1372
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
ConstVertexIterator begin() const
Get an iterator over the vertices.
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
EM EdgeMap
The type of the map for converting the EdgeDescriptor to std::size_t.
Definition: graph.hh:1028
bool equals(const EdgeIterator &other) const
Equality operator.
VertexIterator end()
Get an iterator over the vertices.
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
VertexProperties & getVertexProperties(const VertexDescriptor &vertex)
Get the properties associated with a vertex.
Wrapper to access the internal vertex properties of a graph via operator[]()
Definition: graph.hh:1406
SubGraph(const Graph &graph, const T &excluded)
Constructor.
ConstEdgeIterator beginEdges(const VertexDescriptor &source) const
Get an iterator over the edges starting at a vertex.
EdgeIteratorT< MatrixGraph< Matrix > > EdgeIterator
The mutable edge iterator type.
Definition: graph.hh:301
VertexIteratorT< const MatrixGraph< Matrix > > ConstVertexIterator
The constant vertex iterator type.
Definition: graph.hh:306
EdgeIterator end() const
Get an iterator over all edges starting at the current vertex.
VertexIterator begin()
Get an iterator over the vertices.
G Graph
The type of the graph with internal properties.
Definition: graph.hh:1412
VertexIterator begin()
Get an iterator over the vertices.
VertexIterator ConstVertexIterator
The constant vertex iterator type.
Definition: graph.hh:621
ReadablePropertyMapTag Category
Definition: graph.hh:470
const VertexDescriptor & source() const
The index of the source vertex of the current edge.
EdgeIterator & increment()
Preincrement operator.
An index map for mapping the edges to indices.
Definition: graph.hh:467
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:986
Iterator over all edges starting from a vertex.
Definition: graph.hh:92
G::EdgeProperties EdgeProperties
The type of the vertex properties.
Definition: graph.hh:1416
std::size_t operator[](const EdgeDescriptor &edge) const
Definition: graph.hh:481
EdgeIterator endEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
VertexDescriptor target() const
The index of the target vertex of the current edge.
Graph::EdgeDescriptor EdgeDescriptor
The edge descritor.
Definition: graph.hh:991
GraphVertexPropertiesSelector(G &g)
Constructor.
Definition: graph.hh:1378
G::EdgeDescriptor Edge
The edge descriptor.
Definition: graph.hh:1420
std::size_t noVertices() const
Get the number of vertices in the graph.
EdgeIndexMap(const EdgeDescriptor &firstEdge)
Definition: graph.hh:472
std::size_t noEdges() const
Get the number of edges in the graph.
Graph::EdgeIterator EdgeIterator
The type of the mutable edge iterator.
Definition: graph.hh:759
EdgeIteratorT(const VertexDescriptor &source, const ColIterator &block, const ColIterator &end, const EdgeDescriptor &edge)
Constructor.
VP VertexProperties
The type of the properties of the vertices.
Definition: graph.hh:741
EdgeIndexMap(const EdgeIndexMap &emap)
Protect copy construction.
Definition: graph.hh:477
A subgraph of a graph.
Definition: graph.hh:440
EdgeProperties & operator[](const Edge &edge) const
Get the properties associated to a vertex.
Definition: graph.hh:1440