Introduce custom adjacency-list based graph

This commit is contained in:
Alex Coyte
2016-08-24 16:12:51 +10:00
committed by Matthew Barr
parent 05683655cb
commit e1e9010cac
92 changed files with 3730 additions and 1812 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, Intel Corporation
* Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -297,9 +297,8 @@ bool checkFwdCandidate(const NGHolder &g, NFAVertex fixed_src,
return false;
}
DEBUG_PRINTF("edge (%u, %u) killed by edge (%u, %u)\n",
g[w].index, g[v].index,
g[fixed_src].index, g[v].index);
DEBUG_PRINTF("edge (%zu, %zu) killed by edge (%zu, %zu)\n",
g[w].index, g[v].index, g[fixed_src].index, g[v].index);
return true;
}
@@ -415,7 +414,7 @@ bool removeEdgeRedundancyFwd(NGHolder &g, bool ignore_starts) {
pred(g, u, &parents_u);
done.clear();
if (hasGreaterOutDegree(1, u, g)) {
if (out_degree(u, g) > 1) {
checkLargeOutU(g, u, parents_u, possible_w, done, &dead);
} else {
checkSmallOutU(g, u, parents_u, done, &dead);
@@ -460,7 +459,7 @@ bool removeSiblingsOfStartDotStar(NGHolder &g) {
vector<NFAEdge> dead;
for (auto v : adjacent_vertices_range(g.startDs, g)) {
DEBUG_PRINTF("checking %u\n", g[v].index);
DEBUG_PRINTF("checking %zu\n", g[v].index);
if (is_special(v, g)) {
continue;
}
@@ -470,8 +469,7 @@ bool removeSiblingsOfStartDotStar(NGHolder &g) {
if (is_special(u, g)) {
continue;
}
DEBUG_PRINTF("removing %u->%u\n", g[u].index,
g[v].index);
DEBUG_PRINTF("removing %zu->%zu\n", g[u].index, g[v].index);
dead.push_back(e);
}
}