5#ifndef DUNE_AMG_RENUMBERER_HH
6#define DUNE_AMG_RENUMBERER_HH
15 class AggregateRenumberer
19 typedef typename G::VertexDescriptor Vertex;
25 AggregateRenumberer(AggregatesMap<Vertex>& aggregates);
28 operator Vertex()
const;
30 void operator()(
const typename G::ConstEdgeIterator& edge);
36 AggregatesMap<Vertex>& aggregates_;
40 AggregateRenumberer<G>::AggregateRenumberer(AggregatesMap<Vertex>& aggregates)
41 : number_(0), aggregates_(aggregates)
45 AggregateRenumberer<G>::operator Vertex()
const
51 void AggregateRenumberer<G>::operator()(
const typename G::ConstEdgeIterator& edge)
53 aggregates_[edge.target()]=number_;
57 void AggregateRenumberer<G>::operator++()
62 template<
class G,
class I,
class V>
63 void renumberAggregates(
const G& graph, I index, I endIndex, V& visitedMap,
64 AggregatesMap<typename G::VertexDescriptor>& aggregates)
66 AggregateRenumberer<G> renumberer(aggregates);
68 for(I index1=index; index1 != endIndex; ++index1)
69 if(aggregates[index1.index()]!=AggregatesMap<typename G::VertexDescriptor>::ISOLATED &&
70 !
get(visitedMap, index1.index())) {
72 aggregates.template breadthFirstSearch<false>(index1.index(), aggregates[index1.index()],
73 graph, renumberer, visitedMap);
74 aggregates[index1.index()] = renumberer;
77 for(; index != endIndex; ++index)
78 put(visitedMap, index.index(),
false);
Provides classes for the Coloring process of AMG.
Dune namespace.
Definition: alignedallocator.hh:13
constexpr auto get(std::integer_sequence< T, II... >, std::integral_constant< std::size_t, pos >={})
Return the entry at position pos of the given sequence.
Definition: integersequence.hh:22