|
REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
|
Tells when the anchored walks from candidates should give way to one forward pass and one reverse, from what the walks that found no match cost against the distance crossed. More...
#include <pike.hpp>
Public Member Functions | |
| constexpr bool | overspent (std::size_t length, std::size_t crossed) |
| Bills one walk that found no match, and tells whether the walks should give way. | |
Public Attributes | |
| std::size_t | walks {0} |
| Walks that found no match. | |
| std::size_t | read {0} |
| Bytes those walks read. | |
Tells when the anchored walks from candidates should give way to one forward pass and one reverse, from what the walks that found no match cost against the distance crossed.
A failing walk inside a run of candidate bytes rereads the run the previous one crossed. Score: 8 * failed walks + bytes read, per byte crossed. Over 20 pattern/subject pairs the walks won at <= 0.43 and lost (up to 6x) at >= 4.65, nothing between; the bound sits at 1.5. Namespace-scoped so its verdicts are tested without a search.
|
inlineconstexpr |
Bills one walk that found no match, and tells whether the walks should give way.
| [in] | length | Bytes the walk read. |
| [in] | crossed | Bytes from where the walks began to the walk's candidate. |