|
ADS
Algorithms and Data Structures
|
The checks of the contracts of the sorts. More...
Files | |
| file | ADS/sort/Sorted.h |
| The checks of the contracts of the sorts [see Contract.h]: a copy of the input kept only when the audits are on (ADS_CONTRACTS at least 3), and the check that the output is sorted and holds the same items as the input, which sorts a copy of the input with std::sort and compares the two item by item through the equivalence of the order, in \( O( n \log n ) \) time instead of the \( O( n^2 ) \) of std::is_permutation with a predicate; and the check that a sequence is sorted. | |
Concepts | |
| concept | ADS::SortRange |
| a range that the sorts take beside std::vector and std::span: random access, sized, its items movable in and out of it [see above] | |
| concept | ADS::SortStore |
| the storage on which the sorts work in place, by reference: a std::vector or a std::span of its items, read by their addresses | |
| concept | ADS::RankStore |
| the storage on which the sorts of the book work in place, which read the items by their ranks only: a SortStore, or the view of a random-access range that is not contiguous | |
| concept | ADS::StringStore |
| a SortStore of strings | |
Functions | |
| bool | ADS::checkingContract (void) |
| true while a contract of ADS is evaluated: a comparator that counts its calls skips those made by the contracts | |
The checks of the contracts of the sorts.
The definitions, the invariants and the costs of the area are in Theory of sorting.
|
nodiscard |
true while a contract of ADS is evaluated: a comparator that counts its calls skips those made by the contracts