mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-10-09 07:42:21 +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);
|
||||
|
Reference in New Issue
Block a user