mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-18 02:00:36 +03:00
findMinWidth, findMaxWidth: width for a given top
Currently only implemented for Castle suffixes.
This commit is contained in:
committed by
Matthew Barr
parent
03953f34b1
commit
8dac64d1dc
@@ -708,6 +708,22 @@ depth findMaxWidth(const CastleProto &proto) {
|
||||
return max_width;
|
||||
}
|
||||
|
||||
depth findMinWidth(const CastleProto &proto, u32 top) {
|
||||
if (!contains(proto.repeats, top)) {
|
||||
assert(0); // should not happen
|
||||
return depth::infinity();
|
||||
}
|
||||
return proto.repeats.at(top).bounds.min;
|
||||
}
|
||||
|
||||
depth findMaxWidth(const CastleProto &proto, u32 top) {
|
||||
if (!contains(proto.repeats, top)) {
|
||||
assert(0); // should not happen
|
||||
return depth(0);
|
||||
}
|
||||
return proto.repeats.at(top).bounds.max;
|
||||
}
|
||||
|
||||
CastleProto::CastleProto(const PureRepeat &pr) {
|
||||
assert(pr.reach.any());
|
||||
assert(pr.reports.size() == 1);
|
||||
|
||||
@@ -85,6 +85,8 @@ struct CastleProto {
|
||||
std::set<ReportID> all_reports(const CastleProto &proto);
|
||||
depth findMinWidth(const CastleProto &proto);
|
||||
depth findMaxWidth(const CastleProto &proto);
|
||||
depth findMinWidth(const CastleProto &proto, u32 top);
|
||||
depth findMaxWidth(const CastleProto &proto, u32 top);
|
||||
|
||||
/**
|
||||
* \brief Remap tops to be contiguous.
|
||||
|
||||
Reference in New Issue
Block a user