rose: more hash member funcs for rose types

This commit is contained in:
Justin Viiret 2017-07-31 16:22:08 +10:00 committed by Matthew Barr
parent 09938d532f
commit 4889a492e4
3 changed files with 11 additions and 2 deletions

View File

@ -576,6 +576,9 @@ bool RoseSuffixInfo::operator<(const RoseSuffixInfo &b) const {
return false;
}
size_t RoseSuffixInfo::hash() const {
return hash_all(top, graph, castle, rdfa, haig, tamarama);
}
void RoseSuffixInfo::reset(void) {
top = 0;
@ -691,7 +694,7 @@ set<u32> all_tops(const suffix_id &s) {
}
size_t suffix_id::hash() const {
return hash_all(g, c, d, h);
return hash_all(g, c, d, h, t);
}
bool isAnchored(const left_id &r) {
@ -769,6 +772,10 @@ u64a findMaxOffset(const set<ReportID> &reports, const ReportManager &rm) {
return maxOffset;
}
size_t LeftEngInfo::hash() const {
return hash_all(graph, castle, dfa, haig, tamarama, lag, leftfix_report);
}
void LeftEngInfo::reset(void) {
graph.reset();
castle.reset();

View File

@ -1468,7 +1468,7 @@ void splitByReportSuffixBehaviour(const RoseGraph &g,
vector<vector<RoseVertex>> &buckets) {
// Split by report set and suffix info.
auto make_split_key = [&g](RoseVertex v) {
return hash_all(g[v].reports, suffix_id(g[v].suffix));
return hash_all(g[v].reports, g[v].suffix);
};
splitAndFilterBuckets(buckets, make_split_key);
}

View File

@ -111,6 +111,7 @@ struct LeftEngInfo {
ORDER_CHECK(leftfix_report);
return false;
}
size_t hash() const;
void reset(void);
operator bool() const;
bool tracksSom() const { return !!haig; }
@ -131,6 +132,7 @@ struct RoseSuffixInfo {
bool operator==(const RoseSuffixInfo &b) const;
bool operator!=(const RoseSuffixInfo &b) const { return !(*this == b); }
bool operator<(const RoseSuffixInfo &b) const;
size_t hash() const;
void reset(void);
operator bool() const { return graph || castle || haig || rdfa || tamarama; }
};