mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
rose_build_groups: move getGroups, getSuccGroups
This commit is contained in:
parent
42419a26d2
commit
70ef229b2b
@ -87,30 +87,6 @@ namespace ue2 {
|
|||||||
#define ANCHORED_REHOME_DEEP 25
|
#define ANCHORED_REHOME_DEEP 25
|
||||||
#define ANCHORED_REHOME_SHORT_LEN 3
|
#define ANCHORED_REHOME_SHORT_LEN 3
|
||||||
|
|
||||||
rose_group RoseBuildImpl::getGroups(RoseVertex v) const {
|
|
||||||
rose_group groups = 0;
|
|
||||||
|
|
||||||
for (u32 id : g[v].literals) {
|
|
||||||
u32 lit_id = literal_info.at(id).undelayed_id;
|
|
||||||
|
|
||||||
rose_group mygroups = literal_info[lit_id].group_mask;
|
|
||||||
groups |= mygroups;
|
|
||||||
}
|
|
||||||
|
|
||||||
return groups;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Get the groups of the successor literals of a given vertex. */
|
|
||||||
rose_group RoseBuildImpl::getSuccGroups(RoseVertex start) const {
|
|
||||||
rose_group initialGroups = 0;
|
|
||||||
|
|
||||||
for (auto v : adjacent_vertices_range(start, g)) {
|
|
||||||
initialGroups |= getGroups(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
return initialGroups;
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
static UNUSED
|
static UNUSED
|
||||||
void printLitInfo(const rose_literal_info &li, u32 id) {
|
void printLitInfo(const rose_literal_info &li, u32 id) {
|
||||||
|
@ -335,6 +335,30 @@ void RoseBuildImpl::assignGroupsToLiterals() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rose_group RoseBuildImpl::getGroups(RoseVertex v) const {
|
||||||
|
rose_group groups = 0;
|
||||||
|
|
||||||
|
for (u32 id : g[v].literals) {
|
||||||
|
u32 lit_id = literal_info.at(id).undelayed_id;
|
||||||
|
|
||||||
|
rose_group mygroups = literal_info[lit_id].group_mask;
|
||||||
|
groups |= mygroups;
|
||||||
|
}
|
||||||
|
|
||||||
|
return groups;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** \brief Get the groups of the successor literals of a given vertex. */
|
||||||
|
rose_group RoseBuildImpl::getSuccGroups(RoseVertex start) const {
|
||||||
|
rose_group initialGroups = 0;
|
||||||
|
|
||||||
|
for (auto v : adjacent_vertices_range(start, g)) {
|
||||||
|
initialGroups |= getGroups(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
return initialGroups;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The groups that a role sets are determined by the union of its successor
|
* The groups that a role sets are determined by the union of its successor
|
||||||
* literals. Requires the literals already have had groups assigned.
|
* literals. Requires the literals already have had groups assigned.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user