#include "util/container.h"
#include "util/ue2_containers.h"
#include "util/graph_range.h"
+#include "util/graph_small_color_map.h"
#include <set>
#include <utility>
}
}
+using ColorMap = decltype(make_small_color_map(NGHolder()));
+
/** Build a reverse topo ordering (with only the specials that are in use). We
* also want to ensure vertices which only lead to back edges are placed near
* their parents. */
static
vector<NFAVertex> buildTopoOrder(const NGHolder &w,
const AcyclicGraph &acyclic_g,
- vector<boost::default_color_type> &colours) {
+ ColorMap &colours) {
vector<NFAVertex> topoOrder;
topoOrder.reserve(num_vertices(w));
topological_sort(acyclic_g, back_inserter(topoOrder),
- color_map(make_iterator_property_map(colours.begin(),
- get(vertex_index, acyclic_g))));
+ color_map(colours));
reorderSpecials(w, acyclic_g, topoOrder);
const u32 numVertices = num_vertices(g);
DEBUG_PRINTF("assigning regions for %u vertices in holder\n", numVertices);
- vector<boost::default_color_type> colours(numVertices);
+ auto colours = make_small_color_map(g);
// Build an acyclic graph for this NGHolder.
BackEdgeSet deadEdges;
depth_first_search(g,
visitor(BackEdges<BackEdgeSet>(deadEdges))
.root_vertex(g.start)
- .color_map(make_iterator_property_map(colours.begin(),
- get(vertex_index, g))));
+ .color_map(colours));
auto af = make_bad_edge_filter(&deadEdges);
AcyclicGraph acyclic_g(g, af);