14 template <
class N,
class E>
179 bool replace(
const N & oldNode ,
const N & newNode );
182 bool replaceEdge(
const E & ldEdge,
const E &newEdge );
191 const_iterator
begin_iter()
const {
return const_iterator(*
this); }
193 const_iterator
end_iter()
const {
return const_iterator(*
this,
adjl_.size(),0); }
234 template<
class N,
class E>
238 std::pair<indexer_iterator,bool>
result
241 if ( result.second ) {
242 nodes_.push_back(node);
246 idx = result.first->second;
252 template<
class N,
class E>
255 typename indexer_type::const_iterator
result = indexer_.find(node);
258 if (result != indexer_.end()) {
260 idx = result->second;
266 template<
class N,
class E>
272 adjl_[iFrom].push_back(
edge_type(iTo,edges_.size()));
273 edges_.push_back(edge);
277 template<
class N,
class E>
281 return edge_range(edges.begin(), edges.end());
285 template<
class N,
class E>
293 template<
class N,
class E>
298 if (idxResult.second) {
305 template<
class N,
class E>
310 if (idxResult.second) {
317 template<
class N,
class E>
320 return nodes_[edge.first];
324 template<
class N,
class E>
331 template<
class N,
class E>
334 return nodes_[it-adjl_.begin()];
337 template<
class N,
class E>
344 std::vector<bool> rootCandidate(
size(),
true);
346 for (; it != ed; ++it) {
348 typename edge_list::const_iterator el_it = el.begin();
349 typename edge_list::const_iterator el_ed = el.end();
350 for (; el_it != el_ed; ++el_it) {
351 rootCandidate[el_it->first]=
false;
359 for (; v_sz < v_ed; ++v_sz) {
360 if (rootCandidate[v_sz]) {
367 template<
class N,
class E>
370 typename indexer_type::iterator it = indexer_.find(oldNode);
371 if (it != indexer_.end()) {
373 nodes_[oldIndex]=newNode;
374 indexer_[newNode]=oldIndex;
381 template<
class N,
class E>
388 for (; it < ed; ++it) {
390 if ( edges_[it] == oldEdge ) {
393 edges_[it] = newEdge;
401 template<
class N,
class E>
410 template<
class N,
class E>
424 template<
class N,
class E>
430 for (; it < ed; ++it) {
435 for (; eit < eed; ++eit) {
437 g.
addEdge(nodeData(e.first), nodeData(it), edgeData(e.second));
442 template<
class N,
class E>
451 template<
typename T> std::ostream & operator<<(std::ostream & o, const std::vector< std::vector<std::pair<T,T> > >
v)
453 typedef typename std::vector<std::vector<std::pair<T,T> > > v_t;
454 typedef typename std::vector<std::pair<T,T> > i_t;
456 typename v_t::const_iterator it(
v.begin()), ed(
v.end());
457 for (; it != ed; ++it) {
458 typename i_t::const_iterator iit(it->begin()), ied(it->end());
459 for(; iit != ied; ++iit) {
460 o << iit->first <<
':' << iit->second << std::endl;
const_iterator(const graph &g)
adj_list::size_type size() const
bool operator!=(const const_iterator &i) const
std::vector< N > node_list
std::pair< index_type, bool > index_result
std::pair< edge_iterator, edge_iterator > edge_range
std::pair< const_edge_iterator, const_edge_iterator > const_edge_range
indexer_type::iterator indexer_iterator
bool replaceEdge(const E &ldEdge, const E &newEdge)
adj_list::iterator adj_iterator
void clear()
it clear everything!
const N & nodeData(const edge_type &) const
const E & edgeData(index_type i) const
const_adj_iterator begin() const
const_adj_iterator end() const
indexer_type::const_iterator const_indexer_iterator
std::vector< double >::size_type index_type
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
std::pair< index_type, index_type > edge_type
std::vector< E > edge_store
std::vector< edge_type > edge_list
edge_range edges(index_type nodeIndex)
value_type(const N &n, const E &e)
graph::edge_list edge_list
graph::index_type index_type
const_iterator begin_iter() const
Container::value_type value_type
std::vector< edge_list > adj_list
static std::string from(" from ")
bool operator<(const const_iterator &i) const
edge_list::iterator edge_iterator
const_iterator(const graph &g, index_type ait, index_type eit)
bool replace(const N &oldNode, const N &newNode)
index_type addNode(const N &)
adj_list::const_iterator const_adj_iterator
edge_list::const_iterator const_edge_iterator
bool operator==(const const_iterator &i) const
bool operator>(const const_iterator &i) const
void findRoots(edge_list &) const
void invert(graph &g) const
const value_type * operator->() const
void addEdge(const N &from, const N &to, const E &edge)
const value_type & operator*() const
index_result nodeIndex(const N &) const
tuple size
Write out results.
const_iterator end_iter() const
void swap(graph< N, E > &)
std::map< N, index_type > indexer_type