|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests for Ah Comb. More...
#include <gtest/gtest.h>#include <ah-comb.H>#include <ahFunctional.H>#include <algorithm>#include <array>#include <set>#include <sstream>#include <vector>Go to the source code of this file.
Functions | |
| TEST (AhComb, TransposeEmpty) | |
| TEST (AhComb, TransposeRectangular) | |
| TEST (AhComb, InPlaceTransposeDynArray) | |
| TEST (AhComb, TraversePermEnumeratesAll) | |
| TEST (AhComb, TraversePermEarlyStop) | |
| TEST (AhComb, BuildPerms) | |
| TEST (AhComb, BuildCombsDeduplicates) | |
| TEST (AhComb, FoldPermAccumulates) | |
| TEST (AhComb, TraversePermEmptyInputCallsOnce) | |
| TEST (AhComb, BuildPermsEmptyInputReturnsOneEmptyPermutation) | |
| TEST (AhComb, BuildCombsEmptyInputReturnsOneEmptyCombination) | |
| TEST (AhComb, TransposeWithZeroColumns) | |
| TEST (AhComb, NonRectangularTransposeDies) | |
| TEST (AhComb, PermCountBasic) | |
| TEST (AhComb, PermCountEmpty) | |
| TEST (AhComb, PermCountWithEmptyList) | |
| TEST (AhComb, PermCountSingleList) | |
| TEST (AhComb, ExistsPermFindsMatch) | |
| TEST (AhComb, ExistsPermNoMatch) | |
| TEST (AhComb, ExistsPermStopsEarly) | |
| TEST (AhComb, AllPermAllSatisfy) | |
| TEST (AhComb, AllPermSomeFail) | |
| TEST (AhComb, AllPermStopsEarly) | |
| TEST (AhComb, NonePermNoneSatisfy) | |
| TEST (AhComb, NonePermSomeSatisfy) | |
| TEST (AhComb, FilterPermBasic) | |
| TEST (AhComb, FilterPermEmpty) | |
| TEST (AhComb, FilterPermAll) | |
| TEST (AhComb, MapPermBasic) | |
| TEST (AhComb, MapPermToString) | |
| TEST (AhComb, ForEachPermBasic) | |
| TEST (AhComb, ForEachPermEmpty) | |
| TEST (AhComb, TraversePermThreeLists) | |
| TEST (AhComb, TraversePermSingleElement) | |
| TEST (AhComb, TransposeSingleRow) | |
| TEST (AhComb, TransposeSingleColumn) | |
| TEST (AhComb, InPlaceTransposeSingleRow) | |
| TEST (AhComb, TransposeSquare) | |
| TEST (AhComb, BuildCombsAllSame) | |
| TEST (AhComb, BuildCombsThreeLists) | |
| TEST (AhComb, FoldPermMultiplyFirstElements) | |
| TEST (AhComb, StressTestManyPermutations) | |
| TEST (AhComb, NodiscardBuildPerms) | |
| TEST (AhComb, NodiscardBuildCombs) | |
| TEST (AhComb, NodiscardTranspose) | |
| TEST (AhComb, NodiscardFoldPerm) | |
| TEST (AhComb, NodiscardPermCount) | |
| TEST (AhComb, NodiscardExistsPerm) | |
| TEST (AhComb, NextPermutationArrayBasicLexicographicOrder) | |
| TEST (AhComb, NextPermutationArrayHandlesDuplicatesWithoutRepeats) | |
| TEST (AhComb, NextPermutationArrayMatchesStdWithCustomComparator) | |
| TEST (AhComb, NextPermutationResetOnLastCanBeDisabled) | |
| TEST (AhComb, NextPermutationDynArray) | |
| TEST (AhComb, NextCombinationIndicesArrayEnumeratesAll) | |
| TEST (AhComb, NextCombinationIndicesResetOnLastCanBeDisabled) | |
| TEST (AhComb, NextCombinationIndicesValidation) | |
| TEST (AhComb, NextCombinationIndicesDynArray) | |
| TEST (AhComb, CombinationCountBasicCases) | |
| TEST (AhComb, CombinationCountOverflowThrows) | |
| TEST (AhComb, CombinationMaskEnumerationAndReset) | |
| TEST (AhComb, CombinationMaskValidation) | |
| TEST (AhComb, ForEachCombinationArrayAndEarlyStop) | |
| TEST (AhComb, ForEachCombinationEdgeCases) | |
| TEST (AhComb, BuildCombinationsArrayAndDynArray) | |
| TEST (AhComb, NodiscardAllPerm) | |
| TEST (AhComb, NodiscardNonePerm) | |
| TEST (AhComb, NodiscardFilterPerm) | |
| TEST (AhComb, NodiscardMapPerm) | |
| TEST (AhComb, GrayCodeConversion) | |
| TEST (AhComb, BuildGrayCode) | |
| TEST (AhComb, GrayCodeLargeValue) | |
| TEST (AhComb, BuildGrayCodeThrowsOnTooLarge) | |
Tests for Ah Comb.
Definition in file ah-comb.cc.
| TEST | ( | AhComb | , |
| AllPermAllSatisfy | |||
| ) |
Definition at line 379 of file ah-comb.cc.
References Aleph::all(), Aleph::all_perm(), FunctionalMethods< Container, T >::for_each(), l, l1, l2, and Aleph::sum().
| TEST | ( | AhComb | , |
| AllPermSomeFail | |||
| ) |
Definition at line 396 of file ah-comb.cc.
References Aleph::all(), Aleph::all_perm(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| AllPermStopsEarly | |||
| ) |
Definition at line 410 of file ah-comb.cc.
References Aleph::all_perm(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| BuildCombinationsArrayAndDynArray | |||
| ) |
Definition at line 1025 of file ah-comb.cc.
References Aleph::build_combinations(), and Aleph::DynArray< T >::reserve().
| TEST | ( | AhComb | , |
| BuildCombsAllSame | |||
| ) |
Definition at line 666 of file ah-comb.cc.
References Aleph::build_combs(), l, l1, l2, and Aleph::sort().
| TEST | ( | AhComb | , |
| BuildCombsDeduplicates | |||
| ) |
Definition at line 209 of file ah-comb.cc.
References Aleph::build_combs(), l, l1, and l2.
| TEST | ( | AhComb | , |
| BuildCombsEmptyInputReturnsOneEmptyCombination | |||
| ) |
Definition at line 266 of file ah-comb.cc.
References Aleph::build_combs(), and l.
| TEST | ( | AhComb | , |
| BuildCombsThreeLists | |||
| ) |
Definition at line 679 of file ah-comb.cc.
References Aleph::build_combs(), l, l1, l2, and l3.
| TEST | ( | AhComb | , |
| BuildGrayCode | |||
| ) |
Definition at line 1103 of file ah-comb.cc.
References Aleph::build_gray_code(), and Aleph::diff().
| TEST | ( | AhComb | , |
| BuildGrayCodeThrowsOnTooLarge | |||
| ) |
Definition at line 1132 of file ah-comb.cc.
References Aleph::build_gray_code().
| TEST | ( | AhComb | , |
| BuildPerms | |||
| ) |
Definition at line 194 of file ah-comb.cc.
References Aleph::build_perms(), l, l1, and l2.
| TEST | ( | AhComb | , |
| BuildPermsEmptyInputReturnsOneEmptyPermutation | |||
| ) |
Definition at line 258 of file ah-comb.cc.
References Aleph::build_perms(), and l.
| TEST | ( | AhComb | , |
| CombinationCountBasicCases | |||
| ) |
Definition at line 932 of file ah-comb.cc.
References Aleph::combination_count().
| TEST | ( | AhComb | , |
| CombinationCountOverflowThrows | |||
| ) |
Definition at line 943 of file ah-comb.cc.
References Aleph::combination_count().
| TEST | ( | AhComb | , |
| CombinationMaskEnumerationAndReset | |||
| ) |
Definition at line 951 of file ah-comb.cc.
References Aleph::first_combination_mask(), and Aleph::next_combination_mask().
| TEST | ( | AhComb | , |
| CombinationMaskValidation | |||
| ) |
Definition at line 971 of file ah-comb.cc.
References Aleph::next_combination_mask().
| TEST | ( | AhComb | , |
| ExistsPermFindsMatch | |||
| ) |
Definition at line 335 of file ah-comb.cc.
References Aleph::exists_perm(), Aleph::DynList< T >::get_first(), Aleph::DynList< T >::get_last(), l, l1, and l2.
| TEST | ( | AhComb | , |
| ExistsPermNoMatch | |||
| ) |
Definition at line 349 of file ah-comb.cc.
References Aleph::exists_perm(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| ExistsPermStopsEarly | |||
| ) |
Definition at line 363 of file ah-comb.cc.
References Aleph::exists_perm(), Aleph::DynList< T >::get_first(), Aleph::DynList< T >::get_last(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FilterPermAll | |||
| ) |
Definition at line 482 of file ah-comb.cc.
References Aleph::filter_perm(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FilterPermBasic | |||
| ) |
Definition at line 454 of file ah-comb.cc.
References Aleph::filter_perm(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FilterPermEmpty | |||
| ) |
Definition at line 468 of file ah-comb.cc.
References Aleph::filter_perm(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FoldPermAccumulates | |||
| ) |
Definition at line 228 of file ah-comb.cc.
References Aleph::DynList< T >::get_first(), l, l1, l2, and Aleph::sum().
| TEST | ( | AhComb | , |
| FoldPermMultiplyFirstElements | |||
| ) |
Definition at line 693 of file ah-comb.cc.
References Aleph::DynList< T >::get_first(), l, l1, l2, and Aleph::product().
| TEST | ( | AhComb | , |
| ForEachCombinationArrayAndEarlyStop | |||
| ) |
Definition at line 980 of file ah-comb.cc.
References Aleph::for_each_combination().
| TEST | ( | AhComb | , |
| ForEachCombinationEdgeCases | |||
| ) |
Definition at line 1007 of file ah-comb.cc.
References Aleph::for_each_combination(), and Aleph::Array< T >::size().
| TEST | ( | AhComb | , |
| ForEachPermBasic | |||
| ) |
Definition at line 539 of file ah-comb.cc.
References Aleph::for_each_perm(), Aleph::DynList< T >::insert(), l, l1, and l2.
| TEST | ( | AhComb | , |
| ForEachPermEmpty | |||
| ) |
Definition at line 556 of file ah-comb.cc.
References Aleph::for_each_perm(), Aleph::HTList::is_empty(), and l.
| TEST | ( | AhComb | , |
| GrayCodeConversion | |||
| ) |
Definition at line 1088 of file ah-comb.cc.
References Aleph::bin_to_gray(), and Aleph::gray_to_bin().
| TEST | ( | AhComb | , |
| GrayCodeLargeValue | |||
| ) |
Definition at line 1125 of file ah-comb.cc.
References Aleph::bin_to_gray(), and Aleph::gray_to_bin().
| TEST | ( | AhComb | , |
| InPlaceTransposeDynArray | |||
| ) |
Definition at line 124 of file ah-comb.cc.
References Aleph::in_place_transpose(), m, Aleph::DynArray< T >::reserve(), OhashCommon< HashTbl, Key >::size(), and Aleph::size().
| TEST | ( | AhComb | , |
| InPlaceTransposeSingleRow | |||
| ) |
Definition at line 634 of file ah-comb.cc.
References FunctionalMethods< Container, T >::for_each(), LocateFunctions< Container, Type >::get_it(), Aleph::in_place_transpose(), m, row, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | AhComb | , |
| MapPermBasic | |||
| ) |
Definition at line 496 of file ah-comb.cc.
References FunctionalMethods< Container, T >::for_each(), l, l1, l2, and Aleph::sum().
| TEST | ( | AhComb | , |
| MapPermToString | |||
| ) |
Definition at line 520 of file ah-comb.cc.
| TEST | ( | AhComb | , |
| NextCombinationIndicesArrayEnumeratesAll | |||
| ) |
Definition at line 870 of file ah-comb.cc.
References Aleph::next_combination_indices().
| TEST | ( | AhComb | , |
| NextCombinationIndicesDynArray | |||
| ) |
Definition at line 916 of file ah-comb.cc.
References Aleph::count(), Aleph::next_combination_indices(), and Aleph::DynArray< T >::reserve().
| TEST | ( | AhComb | , |
| NextCombinationIndicesResetOnLastCanBeDisabled | |||
| ) |
Definition at line 895 of file ah-comb.cc.
References Aleph::next_combination_indices().
| TEST | ( | AhComb | , |
| NextCombinationIndicesValidation | |||
| ) |
Definition at line 904 of file ah-comb.cc.
References Aleph::next_combination_indices().
| TEST | ( | AhComb | , |
| NextPermutationArrayBasicLexicographicOrder | |||
| ) |
Definition at line 794 of file ah-comb.cc.
References Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NextPermutationArrayHandlesDuplicatesWithoutRepeats | |||
| ) |
Definition at line 812 of file ah-comb.cc.
References Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NextPermutationArrayMatchesStdWithCustomComparator | |||
| ) |
Definition at line 828 of file ah-comb.cc.
References Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NextPermutationDynArray | |||
| ) |
Definition at line 854 of file ah-comb.cc.
References Aleph::count(), Aleph::next_permutation(), and Aleph::DynArray< T >::reserve().
| TEST | ( | AhComb | , |
| NextPermutationResetOnLastCanBeDisabled | |||
| ) |
Definition at line 847 of file ah-comb.cc.
References Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NodiscardAllPerm | |||
| ) |
Definition at line 1048 of file ah-comb.cc.
References Aleph::all(), Aleph::all_perm(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardBuildCombs | |||
| ) |
Definition at line 741 of file ah-comb.cc.
References Aleph::build_combs(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardBuildPerms | |||
| ) |
Definition at line 731 of file ah-comb.cc.
References Aleph::build_perms(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardExistsPerm | |||
| ) |
Definition at line 784 of file ah-comb.cc.
References Aleph::exists(), Aleph::exists_perm(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardFilterPerm | |||
| ) |
Definition at line 1068 of file ah-comb.cc.
References Aleph::filter_perm(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardFoldPerm | |||
| ) |
Definition at line 761 of file ah-comb.cc.
References Aleph::DynList< T >::get_first(), l, l1, and Aleph::sum().
| TEST | ( | AhComb | , |
| NodiscardMapPerm | |||
| ) |
Definition at line 1078 of file ah-comb.cc.
References Aleph::DynList< T >::get_first(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardNonePerm | |||
| ) |
Definition at line 1058 of file ah-comb.cc.
References l, l1, Aleph::none(), and Aleph::none_perm().
| TEST | ( | AhComb | , |
| NodiscardPermCount | |||
| ) |
Definition at line 774 of file ah-comb.cc.
References Aleph::count(), l, l1, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| NodiscardTranspose | |||
| ) |
Definition at line 751 of file ah-comb.cc.
References m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| NonePermNoneSatisfy | |||
| ) |
Definition at line 426 of file ah-comb.cc.
References Aleph::DynList< T >::get_first(), l, l1, l2, Aleph::none(), and Aleph::none_perm().
| TEST | ( | AhComb | , |
| NonePermSomeSatisfy | |||
| ) |
Definition at line 440 of file ah-comb.cc.
References Aleph::DynList< T >::get_first(), l, l1, l2, Aleph::none(), and Aleph::none_perm().
| TEST | ( | AhComb | , |
| NonRectangularTransposeDies | |||
| ) |
Definition at line 288 of file ah-comb.cc.
References Aleph::in_place_transpose(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| PermCountBasic | |||
| ) |
Definition at line 303 of file ah-comb.cc.
References l, l1, l2, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| PermCountEmpty | |||
| ) |
Definition at line 312 of file ah-comb.cc.
References l, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| PermCountSingleList | |||
| ) |
Definition at line 327 of file ah-comb.cc.
References l, l1, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| PermCountWithEmptyList | |||
| ) |
Definition at line 318 of file ah-comb.cc.
References l, l1, l2, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| StressTestManyPermutations | |||
| ) |
Definition at line 708 of file ah-comb.cc.
References Aleph::count(), l, l1, l2, l3, l5, Aleph::perm_count(), Aleph::DynList< T >::size(), and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TransposeEmpty | |||
| ) |
Definition at line 93 of file ah-comb.cc.
References Aleph::in_place_transpose(), OhashCommon< HashTbl, Key >::is_empty(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeRectangular | |||
| ) |
Definition at line 102 of file ah-comb.cc.
References Aleph::in_place_transpose(), m, row, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeSingleColumn | |||
| ) |
Definition at line 619 of file ah-comb.cc.
References m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeSingleRow | |||
| ) |
Definition at line 603 of file ah-comb.cc.
References m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeSquare | |||
| ) |
Definition at line 651 of file ah-comb.cc.
References m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeWithZeroColumns | |||
| ) |
Definition at line 274 of file ah-comb.cc.
References Aleph::in_place_transpose(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TraversePermEarlyStop | |||
| ) |
Definition at line 177 of file ah-comb.cc.
References l, l1, l2, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermEmptyInputCallsOnce | |||
| ) |
Definition at line 244 of file ah-comb.cc.
References Aleph::HTList::is_empty(), l, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermEnumeratesAll | |||
| ) |
Definition at line 156 of file ah-comb.cc.
References Aleph::DynList< T >::insert(), l, l1, l2, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermSingleElement | |||
| ) |
Definition at line 587 of file ah-comb.cc.
References Aleph::DynList< T >::insert(), l, l1, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermThreeLists | |||
| ) |
Definition at line 570 of file ah-comb.cc.
References Aleph::DynList< T >::insert(), l, l1, l2, l3, and Aleph::traverse_perm().