5 #ifndef DUNE_AMG_GRAPH_HH 6 #define DUNE_AMG_GRAPH_HH 13 #include <dune/common/typetraits.hh> 14 #include <dune/common/iteratorfacades.hh> 16 #include <dune/common/propertymap.hh> 66 typedef typename M::block_type
Weight;
86 mutableMatrix = std::is_same<M, typename std::remove_const<M>::type>::value
118 typedef typename std::conditional<
isMutable && C::mutableMatrix,
typename Matrix::row_type::Iterator,
119 typename Matrix::row_type::ConstIterator>::type
125 typedef typename std::conditional<
isMutable && C::mutableMatrix,
typename M::block_type,
126 const typename M::block_type>::type
154 typedef typename std::conditional<std::is_same<C, typename std::remove_const<C>::type>::value && C::mutableMatrix,
155 typename M::block_type,
const typename M::block_type>::type
264 typedef typename std::conditional<std::is_same<C, typename std::remove_const<C>::type>::value && C::mutableMatrix,
265 typename M::block_type,
const typename M::block_type>::type
441 template<
class G,
class T>
475 : firstEdge_(firstEdge)
480 : firstEdge_(emap.firstEdge_)
485 return edge-firstEdge_;
504 class EdgeIterator :
public RandomAccessIteratorFacade<EdgeIterator,const EdgeDescriptor>
559 :
public ForwardIteratorFacade<VertexIterator,const VertexDescriptor>
696 std::size_t noVertices_;
709 std::ptrdiff_t* start_;
711 std::ptrdiff_t* end_;
721 template<
class G,
class VP,
class VM=IdentityMap>
799 :
public std::conditional<std::is_same<typename std::remove_const<C>::type,
801 typename Graph::VertexIterator,
802 typename Graph::ConstVertexIterator>::type
810 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
812 typename Graph::VertexIterator,
813 typename Graph::ConstVertexIterator>::type
819 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
821 typename Graph::EdgeIterator,
822 typename Graph::ConstEdgeIterator>::type
853 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
855 const VertexProperties&>::type
969 std::vector<VertexProperties> vertexProperties_;
976 template<
class G,
class VP,
class EP,
class VM=IdentityMap,
class EM=IdentityMap>
1034 :
public std::conditional<std::is_same<typename std::remove_const<C>::type,
1036 typename Graph::EdgeIterator,
1037 typename Graph::ConstEdgeIterator>::type
1046 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
1048 typename Graph::EdgeIterator,
1049 typename Graph::ConstEdgeIterator>::type
1079 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
1081 const EdgeProperties&>::type
1136 :
public std::conditional<std::is_same<typename std::remove_const<C>::type,
1138 typename Graph::VertexIterator,
1139 typename Graph::ConstVertexIterator>::type
1147 typedef typename std::conditional<std::is_same<typename std::remove_const<C>::type,
1149 typename Graph::VertexIterator,
1150 typename Graph::ConstVertexIterator>::type
1181 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
1183 const VertexProperties&>::type
1266 const VertexDescriptor& target)
1268 return graph_.findEdge(source,target);
1335 const EdgeMap& emap=EdgeMap());
1346 std::vector<VertexProperties> vertexProperties_;
1350 std::vector<EdgeProperties> edgeProperties_;
1359 template<
typename G>
1397 return graph_->getVertexProperties(vertex);
1407 template<
typename G>
1422 typedef typename G::EdgeDescriptor
Edge;
1444 return graph_->getEdgeProperties(edge);
1461 template<
class G,
class V>
1471 if(matrix_.N()!=matrix_.M())
1472 DUNE_THROW(
ISTLError,
"Matrix has to have as many columns as rows!");
1474 start_ =
new EdgeDescriptor[matrix_.N()+1];
1476 typedef typename M::ConstIterator Iterator;
1477 start_[matrix_.begin().index()] = 0;
1479 for(Iterator row=matrix_.begin(); row != matrix_.end(); ++row)
1480 start_[row.index()+1] = start_[row.index()] + row->size();
1492 return start_[matrix_.N()];
1504 return matrix_.N()-1;
1510 const VertexDescriptor& target)
const 1512 typename M::ConstColIterator found =matrix_[source].find(target);
1513 if(found == matrix_[source].end())
1514 return std::numeric_limits<EdgeDescriptor>::max();
1515 std::size_t offset = found.offset();
1519 assert(offset<noEdges());
1521 return start_[source]+offset;
1540 const ColIterator& end,
const EdgeDescriptor& edge)
1541 : source_(source), block_(block), blockEnd_(end), edge_(edge)
1543 if(block_!=blockEnd_ && block_.index() == source_) {
1559 : source_(other.source_), block_(other.block_), blockEnd_(other.blockEnd_), edge_(other.edge_)
1565 inline typename MatrixGraph<M>::template EdgeIteratorT<C>::WeightType&
1578 if(block_!=blockEnd_ && block_.index() == source_) {
1590 return block_!=other.block_;
1597 return block_!=other.block_;
1604 return block_==other.block_;
1611 return block_==other.block_;
1618 return block_.index();
1645 const VertexDescriptor& current)
1646 : graph_(graph), current_(current)
1659 : graph_(other.graph_), current_(other.current_)
1666 return current_ != other.current_;
1673 return current_ != other.current_;
1681 return current_ == other.current_;
1688 return current_ == other.current_;
1701 inline typename MatrixGraph<M>::template VertexIteratorT<C>::WeightType&
1704 return graph_->matrix()[current_][current_];
1717 inline typename MatrixGraph<M>::template EdgeIteratorT<C>
1720 return graph_->beginEdges(current_);
1725 inline typename MatrixGraph<M>::template EdgeIteratorT<C>
1728 return graph_->endEdges(current_);
1732 inline typename MatrixGraph<M>::template VertexIteratorT<MatrixGraph<M> >
1735 return VertexIterator(
this,0);
1739 inline typename MatrixGraph<M>::template VertexIteratorT<MatrixGraph<M> >
1742 return VertexIterator(matrix_.N());
1747 inline typename MatrixGraph<M>::template VertexIteratorT<const MatrixGraph<M> >
1750 return ConstVertexIterator(
this, 0);
1754 inline typename MatrixGraph<M>::template VertexIteratorT<const MatrixGraph<M> >
1757 return ConstVertexIterator(matrix_.N());
1761 inline typename MatrixGraph<M>::template EdgeIteratorT<MatrixGraph<M> >
1764 return EdgeIterator(source, matrix_.operator[](source).begin(),
1765 matrix_.operator[](source).end(), start_[source]);
1769 inline typename MatrixGraph<M>::template EdgeIteratorT<MatrixGraph<M> >
1772 return EdgeIterator(matrix_.operator[](source).end());
1777 inline typename MatrixGraph<M>::template EdgeIteratorT<const MatrixGraph<M> >
1780 return ConstEdgeIterator(source, matrix_.operator[](source).begin(),
1781 matrix_.operator[](source).end(), start_[source]);
1785 inline typename MatrixGraph<M>::template EdgeIteratorT<const MatrixGraph<M> >
1788 return ConstEdgeIterator(matrix_.operator[](source).end());
1792 template<
class G,
class T>
1794 const EdgeDescriptor& edge)
1795 : source_(source), edge_(edge)
1799 template<
class G,
class T>
1804 template<
class G,
class T>
1807 return EdgeIndexMap(edges_);
1810 template<
class G,
class T>
1813 return other.edge_==edge_;
1816 template<
class G,
class T>
1823 template<
class G,
class T>
1830 template<
class G,
class T>
1836 template<
class G,
class T>
1842 template<
class G,
class T>
1849 template<
class G,
class T>
1855 template<
class G,
class T>
1858 return other.edge_-edge_;
1861 template<
class G,
class T>
1865 : graph_(graph), current_(current), end_(
end)
1868 typedef typename T::const_iterator Iterator;
1870 for(Iterator vertex = graph_->excluded_.begin();
1871 current_ != end_ && *vertex;
1874 assert(current_ == end_ || !graph_->excluded_[current_]);
1877 template<
class G,
class T>
1882 template<
class G,
class T>
1887 while(current_ != end_ && graph_->excluded_[current_])
1890 assert(current_ == end_ || !graph_->excluded_[current_]);
1894 template<
class G,
class T>
1897 return current_==other.current_;
1900 template<
class G,
class T>
1906 template<
class G,
class T>
1909 return graph_->beginEdges(current_);
1912 template<
class G,
class T>
1915 return graph_->endEdges(current_);
1918 template<
class G,
class T>
1921 return VertexIterator(
this, 0, endVertex_);
1925 template<
class G,
class T>
1928 return VertexIterator(endVertex_);
1932 template<
class G,
class T>
1935 return EdgeIterator(source, edges_+start_[source]);
1938 template<
class G,
class T>
1941 return EdgeIterator(edges_+end_[source]);
1944 template<
class G,
class T>
1950 template<
class G,
class T>
1956 template<
class G,
class T>
1962 template<
class G,
class T>
1966 const EdgeDescriptor edge = std::lower_bound(edges_+start_[source], edges_+end_[source], target);
1967 if(edge==edges_+end_[source] || *edge!=target)
1968 return std::numeric_limits<EdgeDescriptor>::max();
1973 template<
class G,
class T>
1981 template<
class G,
class T>
1983 : excluded_(excluded), noVertices_(0), endVertex_(0), maxVertex_(graph.
maxVertex())
1985 start_ =
new std::ptrdiff_t[graph.noVertices()];
1986 end_ =
new std::ptrdiff_t[graph.noVertices()];
1987 edges_ =
new VertexDescriptor[graph.noEdges()];
1989 VertexDescriptor* edge=edges_;
1993 if ( graph.noVertices() == 0)
1996 typedef typename Graph::ConstVertexIterator Iterator;
1997 Iterator endVertex=graph.end();
1999 for(Iterator vertex = graph.begin(); vertex != endVertex; ++vertex)
2000 if(excluded_[*vertex])
2001 start_[*vertex]=end_[*vertex]=-1;
2004 endVertex_ = std::max(*vertex, endVertex_);
2006 start_[*vertex] = edge-edges_;
2008 auto endEdge = vertex.end();
2010 for(
auto iter=vertex.begin(); iter!= endEdge; ++iter)
2011 if(!excluded[iter.target()]) {
2012 *edge = iter.target();
2016 end_[*vertex] = edge - edges_;
2019 std::sort(edges_+start_[*vertex], edge);
2021 noEdges_ = edge-edges_;
2025 template<
class G,
class V,
class VM>
2028 return graph_.noEdges();
2031 template<
class G,
class V,
class VM>
2035 return graph_.beginEdges(source);
2038 template<
class G,
class V,
class VM>
2042 return graph_.endEdges(source);
2045 template<
class G,
class V,
class VM>
2049 return graph_.beginEdges(source);
2052 template<
class G,
class V,
class VM>
2056 return graph_.endEdges(source);
2059 template<
class G,
class V,
class VM>
2064 : Father(iter), graph_(graph)
2067 template<
class G,
class V,
class VM>
2074 template<
class G,
class V,
class VM>
2079 : Father(other), graph_(other.graph_)
2082 template<
class G,
class V,
class VM>
2084 typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
2088 return graph_->getVertexProperties(Father::operator*());
2091 template<
class G,
class V,
class VM>
2093 typename std::conditional<std::is_same<typename std::remove_const<C>::type,
2095 typename G::EdgeIterator,
2096 typename G::ConstEdgeIterator>::type
2099 return graph_->beginEdges(Father::operator*());
2102 template<
class G,
class V,
class VM>
2104 typename std::conditional<std::is_same<typename std::remove_const<C>::type,
2106 typename G::EdgeIterator,
2107 typename G::ConstEdgeIterator>::type
2110 return graph_->endEdges(Father::operator*());
2113 template<
class G,
class V,
class VM>
2116 return VertexIterator(graph_.begin(),
this);
2119 template<
class G,
class V,
class VM>
2122 return VertexIterator(graph_.end());
2126 template<
class G,
class V,
class VM>
2129 return ConstVertexIterator(graph_.begin(),
this);
2132 template<
class G,
class V,
class VM>
2135 return ConstVertexIterator(graph_.end());
2138 template<
class G,
class V,
class VM>
2141 return vertexProperties_[vmap_[vertex]];
2144 template<
class G,
class V,
class VM>
2147 return vertexProperties_[vmap_[vertex]];
2150 template<
class G,
class V,
class VM>
2156 template<
class G,
class V,
class VM>
2159 return graph_.noVertices();
2163 template<
class G,
class V,
class VM>
2166 return graph_.maxVertex();
2169 template<
class G,
class V,
class VM>
2171 : graph_(graph), vmap_(vmap), vertexProperties_(vmap_[graph_.maxVertex()+1], V())
2174 template<
class G,
class V,
class E,
class VM,
class EM>
2178 : Father(iter), graph_(graph)
2181 template<
class G,
class V,
class E,
class VM,
class EM>
2187 template<
class G,
class V,
class E,
class VM,
class EM>
2191 : Father(other), graph_(other.graph_)
2195 template<
class G,
class V,
class E,
class VM,
class EM>
2198 return graph_.noEdges();
2201 template<
class G,
class V,
class E,
class VM,
class EM>
2203 inline typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,E&,
const E&>::type
2206 return graph_->getEdgeProperties(Father::operator*());
2209 template<
class G,
class V,
class E,
class VM,
class EM>
2213 return EdgeIterator(graph_.beginEdges(source),
this);
2216 template<
class G,
class V,
class E,
class VM,
class EM>
2220 return EdgeIterator(graph_.endEdges(source));
2223 template<
class G,
class V,
class E,
class VM,
class EM>
2227 return ConstEdgeIterator(graph_.beginEdges(source),
this);
2230 template<
class G,
class V,
class E,
class VM,
class EM>
2234 return ConstEdgeIterator(graph_.endEdges(source));
2237 template<
class G,
class V,
class E,
class VM,
class EM>
2242 : Father(iter), graph_(graph)
2245 template<
class G,
class V,
class E,
class VM,
class EM>
2252 template<
class G,
class V,
class E,
class VM,
class EM>
2257 : Father(other), graph_(other.graph_)
2260 template<
class G,
class V,
class E,
class VM,
class EM>
2262 inline typename std::conditional<std::is_same<C,typename std::remove_const<C>::type>::value,
2266 return graph_->getVertexProperties(Father::operator*());
2269 template<
class G,
class V,
class E,
class VM,
class EM>
2271 inline typename PropertiesGraph<G,V,E,VM,EM>::template EdgeIteratorT<C>
2274 return graph_->beginEdges(Father::operator*());
2277 template<
class G,
class V,
class E,
class VM,
class EM>
2279 inline typename PropertiesGraph<G,V,E,VM,EM>::template EdgeIteratorT<C>
2282 return graph_->endEdges(Father::operator*());
2285 template<
class G,
class V,
class E,
class VM,
class EM>
2288 return VertexIterator(graph_.begin(),
this);
2291 template<
class G,
class V,
class E,
class VM,
class EM>
2294 return VertexIterator(graph_.end());
2298 template<
class G,
class V,
class E,
class VM,
class EM>
2301 return ConstVertexIterator(graph_.begin(),
this);
2304 template<
class G,
class V,
class E,
class VM,
class EM>
2307 return ConstVertexIterator(graph_.end());
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 vertexProperties_[vmap_[vertex]];
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>
2331 return edgeProperties_[emap_[edge]];
2334 template<
class G,
class V,
class E,
class VM,
class EM>
2336 const VertexDescriptor& target)
2338 return getEdgeProperties(graph_.findEdge(source,target));
2341 template<
class G,
class V,
class E,
class VM,
class EM>
2343 const VertexDescriptor& target)
const 2345 return getEdgeProperties(graph_.findEdge(source,target));
2348 template<
class G,
class V,
class E,
class VM,
class EM>
2354 template<
class G,
class V,
class E,
class VM,
class EM>
2357 return graph_.noVertices();
2361 template<
class G,
class V,
class E,
class VM,
class EM>
2364 return graph_.maxVertex();
2367 template<
class G,
class V,
class E,
class VM,
class EM>
2369 : graph_(graph), vmap_(vmap), vertexProperties_(vmap_[graph_.maxVertex()+1], V()),
2370 emap_(emap), edgeProperties_(graph_.noEdges(), E())
2373 template<
class G,
class V>
2374 inline int visitNeighbours(
const G& graph,
const typename G::VertexDescriptor& vertex,
2377 typedef typename G::ConstEdgeIterator iterator;
2378 const iterator end = graph.endEdges(vertex);
2380 for(iterator edge = graph.beginEdges(vertex); edge != end; ++edge, ++noNeighbours)
2382 return noNeighbours;
VertexIterator end()
Get an iterator over the vertices.
EdgeIterator ConstEdgeIterator
The constant edge iterator type.
Definition: graph.hh:618
Attaches properties to the vertices of a graph.
Definition: graph.hh:722
VertexIterator end()
Get an iterator over the vertices.
Graph::EdgeDescriptor EdgeDescriptor
The edge descritor.
Definition: graph.hh:738
An index map for mapping the edges to indices.
Definition: graph.hh:469
VertexIterator begin()
Get an iterator over the vertices.
Wrapper to access the internal vertex properties of a graph via operator[]()
Definition: graph.hh:1408
EdgeProperties & operator[](const Edge &edge) const
Get the properties associated to a vertex.
Definition: graph.hh:1442
EdgeIteratorT< C > end() const
Get an iterator over all edges starting at the current vertex.
EP EdgeProperties
The type of the properties of the edges;.
Definition: graph.hh:1016
Definition: graph.hh:1033
VertexIteratorT< VertexPropertiesGraph< Graph, VertexProperties, VM > > VertexIterator
The type of the mutable Vertex iterator.
Definition: graph.hh:883
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:120
EdgeIteratorT< C > & operator++()
preincrement operator.
ConstVertexIterator begin() const
Get an iterator over the vertices.
G::VertexProperties VertexProperties
The type of the vertex properties.
Definition: graph.hh:1370
derive error class from the base class in common
Definition: istlexception.hh:19
VertexIteratorT< C > & operator++()
Move to the next vertex.
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:266
EdgeIterator & advance(std::ptrdiff_t n)
whether C is mutable.
Definition: graph.hh:225
EdgeIterator beginEdges(const VertexDescriptor &source)
Get an iterator over the edges starting at a vertex.
const VertexDescriptor & target() const
The index of the target vertex of the current edge.
EdgeIterator end() const
Get an iterator over all edges starting at the current vertex.
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
std::conditional< std::is_same< C, typename std::remove_const< C >::type >::value, VertexProperties &, const VertexProperties & >::type properties() const
Get the properties of the current Vertex.
VP VertexProperties
The type of the properties of the vertices.
Definition: graph.hh:998
EdgeIteratorT< const PropertiesGraph< Graph, VertexProperties, EdgeProperties, VM, EM > > ConstEdgeIterator
The type of the constant edge iterator.
Definition: graph.hh:1103
std::size_t operator[](const EdgeDescriptor &edge) const
Definition: graph.hh:483
GraphEdgePropertiesSelector()
Default constructor.
Definition: graph.hh:1434
const std::remove_const< C >::type ConstContainer
The constant type of the container type.
Definition: graph.hh:105
VertexProperties & operator[](const Vertex &vertex) const
Get the properties associated to a vertex.
Definition: graph.hh:1395
WeightType & weight() const
Access the edge weight.
Graph::EdgeDescriptor EdgeDescriptor
The edge descritor.
Definition: graph.hh:993
VertexPropertiesGraph(Graph &graph, const VertexMap vmap=VertexMap())
Constructor.
bool operator!=(const VertexIteratorT< ConstContainer > &other) const
Inequality operator.
Iterator over all edges starting from a vertex.
Definition: graph.hh:94
const VertexDescriptor & source() const
The index of the source vertex of the current edge.
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:156
M::block_type Weight
The type of the weights.
Definition: graph.hh:66
EdgeIterator beginEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
Class representing the properties of an edge in the matrix graph.
Definition: dependency.hh:38
G Graph
The type of the graph with internal properties.
Definition: graph.hh:1414
M Matrix
The type of the matrix we are a graph for.
Definition: graph.hh:56
EdgeIterator endEdges(const VertexDescriptor &source)
Get an iterator over the edges starting at a vertex.
M::size_type VertexDescriptor
The vertex descriptor.
Definition: graph.hh:73
std::remove_const< C >::type MutableContainer
The mutable type of the container type.
Definition: graph.hh:214
MatrixGraph(Matrix &matrix)
Constructor.
EdgeIterator end() const
Get an iterator over the edges starting from the current vertex.
bool equals(const EdgeIterator &other) const
Equality operator.
G::VertexDescriptor Vertex
The vertex descriptor.
Definition: graph.hh:1374
EdgeIterator endEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
The vertex iterator of the graph.
Definition: graph.hh:558
VertexIterator & increment()
Preincrement operator.
A subgraph of a graph.
Definition: graph.hh:442
EdgeIteratorT(const VertexDescriptor &source, const ColIterator &block, const ColIterator &end, const EdgeDescriptor &edge)
Constructor.
const EdgeDescriptor & operator*() const
Get the edge descriptor.
The (undirected) graph of a matrix.
Definition: graph.hh:50
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:127
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.
std::size_t noVertices() const
Get the number of vertices in the graph.
G Graph
The graph we attach properties to.
Definition: graph.hh:728
VM VertexMap
The type of the map for converting the VertexDescriptor to std::size_t.
Definition: graph.hh:1011
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:459
VertexProperties & getVertexProperties(const VertexDescriptor &vertex)
Get the properties associated with a vertex.
The edge iterator of the graph.
Definition: graph.hh:504
Matrix & matrix()
Get the underlying matrix.
std::remove_const< M >::type MutableMatrix
The mutable type of the matrix we are a graph for.
Definition: graph.hh:61
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:814
Graph::ConstEdgeIterator ConstEdgeIterator
The type of the constant edge iterator.
Definition: graph.hh:766
std::size_t noVertices() const
Get the number of vertices in the graph.
EdgeDescriptor findEdge(const VertexDescriptor &source, const VertexDescriptor &target) const
Find the descriptor of an edge.
std::ptrdiff_t distanceTo(const EdgeIterator &other) const
EM EdgeMap
The type of the map for converting the EdgeDescriptor to std::size_t.
Definition: graph.hh:1030
EdgeIterator(const VertexDescriptor &source, const EdgeDescriptor &edge)
Constructor.
G::EdgeProperties EdgeProperties
The type of the vertex properties.
Definition: graph.hh:1418
ConstEdgeIterator endEdges(const VertexDescriptor &source) const
Get an iterator over the edges starting at a vertex.
EdgeProperties & getEdgeProperties(const EdgeDescriptor &edge)
Get the properties associated with a edge.
EdgeIndexMap(const EdgeDescriptor &firstEdge)
Definition: graph.hh:474
VP VertexProperties
The type of the properties of the vertices.
Definition: graph.hh:743
~MatrixGraph()
Destructor.
ReadablePropertyMapTag Category
Definition: graph.hh:472
std::conditional< std::is_same< C, typename std::remove_const< C >::type >::value, VertexProperties &, const VertexProperties & >::type properties() const
Get the properties of the current Vertex.
VertexDescriptor target() const
The index of the target vertex of the current edge.
const Graph & graph() const
Get the graph the properties are attached to.
std::ptrdiff_t EdgeDescriptor
The edge descriptor.
Definition: graph.hh:80
EdgeIteratorT< PropertiesGraph< Graph, VertexProperties, EdgeProperties, VM, EM > > EdgeIterator
The type of the mutable edge iterator.
Definition: graph.hh:1096
bool operator==(const EdgeIteratorT< typename std::remove_const< C >::type > &other) const
Equality operator.
GraphEdgePropertiesSelector(G &g)
Constructor.
Definition: graph.hh:1428
int visitNeighbours(const G &graph, const typename G::VertexDescriptor &vertex, V &visitor)
Visit all neighbour vertices of a vertex in a graph.
Graph::EdgeIterator EdgeIterator
The type of the mutable edge iterator.
Definition: graph.hh:761
VertexProperties & getVertexProperties(const VertexDescriptor &vertex)
Get the properties associated with a vertex.
std::size_t noEdges() const
Get the number of edges in the graph.
VertexIterator end()
Get an iterator over the vertices.
VertexIterator ConstVertexIterator
The constant vertex iterator type.
Definition: graph.hh:623
EdgeIteratorT< const MatrixGraph< Matrix > > ConstEdgeIterator
The constant edge iterator type.
Definition: graph.hh:298
VM VertexMap
The type of the map for converting the VertexDescriptor to std::size_t.
Definition: graph.hh:756
VertexIteratorT< const MatrixGraph< Matrix > > ConstVertexIterator
The constant vertex iterator type.
Definition: graph.hh:308
ConstEdgeIterator beginEdges(const VertexDescriptor &source) const
Get an iterator over the edges starting at a vertex.
Wrapper to access the internal edge properties of a graph via operator[]()
Definition: graph.hh:1360
EdgeIndexMap(const EdgeIndexMap &emap)
Protect copy construction.
Definition: graph.hh:479
const VertexDescriptor & operator*() const
Get the descriptor of the current vertex.
const Graph & graph() const
Get the graph the properties are attached to.
Attaches properties to the edges and vertices of a graph.
Definition: graph.hh:977
std::size_t noEdges() const
Get the number of edges in the graph.
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:988
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
EdgeIterator begin() const
Get an iterator over the edges starting from the current vertex.
const VertexDescriptor & dereference() const
Get the descriptor of the current vertex.
EdgeIterator beginEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
T Excluded
Random access container providing information about which vertices are excluded.
Definition: graph.hh:454
VertexIterator begin()
Get an iterator over the vertices.
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
GraphVertexPropertiesSelector()
Default constructor.
Definition: graph.hh:1386
GraphVertexPropertiesSelector(G &g)
Constructor.
Definition: graph.hh:1380
const std::remove_const< C >::type ConstContainer
The constant type of the container type.
Definition: graph.hh:218
Graph::VertexDescriptor VertexDescriptor
The vertex descriptor.
Definition: graph.hh:733
VertexDescriptor maxVertex() const
Get the maximal vertex descriptor.
G Graph
The type of the graph with internal properties.
Definition: graph.hh:1366
EdgeIterator & decrement()
Preincrement operator.
G::EdgeDescriptor Edge
The edge descriptor.
Definition: graph.hh:1422
WeightType & weight() const
Access the weight of the vertex.
std::size_t noVertices() const
Get the number of vertices in the graph.
G Graph
The graph we attach properties to.
Definition: graph.hh:983
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:1151
EdgeDescriptor findEdge(const VertexDescriptor &source, const VertexDescriptor &target) const
Find the descriptor of an edge.
VertexIteratorT< const VertexPropertiesGraph< Graph, VertexProperties, VM > > ConstVertexIterator
The type of the constant Vertex iterator.
Definition: graph.hh:889
const EdgeDescriptor * operator->() const
Get the edge descriptor.
VertexIteratorT< const PropertiesGraph< Graph, VertexProperties, EdgeProperties, VM, EM > > ConstVertexIterator
The type of the constant Vertex iterator.
Definition: graph.hh:1219
G Graph
The type of the graph we are a sub graph for.
Definition: graph.hh:448
bool operator==(const VertexIteratorT< ConstContainer > &other) const
Equality operator.
SubGraph(const Graph &graph, const T &excluded)
Constructor.
whether C is mutable.
Definition: graph.hh:112
const EdgeDescriptor & dereference() const
The descriptor of the current edge.
VertexIterator(const SubGraph< G, T > *graph, const VertexDescriptor ¤t, const VertexDescriptor &end)
Constructor.
EdgeIteratorT(const Father &iter, C *graph)
Constructor.
EdgeIndexMap getEdgeIndexMap()
Get an edge index map for the graph.
std::conditional< std::is_same< typename std::remove_const< C >::type, C >::value, typename Graph::EdgeIterator, typename Graph::ConstEdgeIterator >::type EdgeIterator
The class of the edge iterator.
Definition: graph.hh:823
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:1050
VertexIteratorT(C *graph, const VertexDescriptor ¤t)
Constructor.
VertexIteratorT< PropertiesGraph< Graph, VertexProperties, EdgeProperties, VM, EM > > VertexIterator
The type of the mutable Vertex iterator.
Definition: graph.hh:1212
EdgeIteratorT< C > begin() const
Get an iterator over all edges starting at the current vertex.
std::size_t noEdges() const
Get the number of edges in the graph.
EdgeIterator endEdges(const VertexDescriptor &source)
Get the mutable edge iterator over edges starting at a vertex.
VertexIteratorT(const Father &iter, C *graph)
Constructor.
Definition: allocator.hh:11
std::size_t noEdges() const
Get the number of edges in the graph.
EdgeIterator & increment()
Preincrement operator.
std::size_t noVertices() const
Get the number of vertices in the graph.
The vertex iterator type of the graph.
Definition: graph.hh:208
ConstVertexIterator end() const
Get an iterator over the vertices.
VertexIteratorT< MatrixGraph< Matrix > > VertexIterator
The mutable vertex iterator type.
Definition: graph.hh:313
bool operator!=(const EdgeIteratorT< typename std::remove_const< C >::type > &other) const
Inequality operator.
Definition: graph.hh:1135
std::conditional< std::is_same< C, typename std::remove_const< C >::type >::value, EdgeProperties &, const EdgeProperties & >::type properties() const
Get the properties of the current edge.
EdgeIteratorT< MatrixGraph< Matrix > > EdgeIterator
The mutable edge iterator type.
Definition: graph.hh:303
EdgeIterator begin() const
Get an iterator over all edges starting at the current vertex.
bool equals(const VertexIterator &other) const
Equality iterator.
VertexDescriptor * EdgeDescriptor
Definition: graph.hh:461
std::remove_const< C >::type MutableContainer
The mutable type of the container type.
Definition: graph.hh:101
VertexIteratorT(const Father &iter, C *graph)
Constructor.
VertexIterator begin()
Get an iterator over the vertices.