|
Aleph-w 3.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 375 of file ah-comb.cc.
References Aleph::all(), Aleph::all_perm(), Aleph::divide_and_conquer_partition_dp(), FunctionalMethods< Container, T >::for_each(), l, l1, l2, and Aleph::sum().
| TEST | ( | AhComb | , |
| AllPermSomeFail | |||
| ) |
Definition at line 392 of file ah-comb.cc.
References Aleph::all(), Aleph::all_perm(), Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| AllPermStopsEarly | |||
| ) |
Definition at line 406 of file ah-comb.cc.
References Aleph::all_perm(), Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| BuildCombinationsArrayAndDynArray | |||
| ) |
Definition at line 1020 of file ah-comb.cc.
References Aleph::build_combinations(), Aleph::divide_and_conquer_partition_dp(), and Aleph::DynArray< T >::reserve().
| TEST | ( | AhComb | , |
| BuildCombsAllSame | |||
| ) |
Definition at line 661 of file ah-comb.cc.
References Aleph::build_combs(), Aleph::divide_and_conquer_partition_dp(), l, l1, l2, and Aleph::sort().
| TEST | ( | AhComb | , |
| BuildCombsDeduplicates | |||
| ) |
Definition at line 205 of file ah-comb.cc.
References Aleph::build_combs(), Aleph::divide_and_conquer_partition_dp(), l, l1, and l2.
| TEST | ( | AhComb | , |
| BuildCombsEmptyInputReturnsOneEmptyCombination | |||
| ) |
Definition at line 262 of file ah-comb.cc.
References Aleph::build_combs(), Aleph::divide_and_conquer_partition_dp(), and l.
| TEST | ( | AhComb | , |
| BuildCombsThreeLists | |||
| ) |
Definition at line 674 of file ah-comb.cc.
References Aleph::build_combs(), Aleph::divide_and_conquer_partition_dp(), l, l1, l2, and l3.
| TEST | ( | AhComb | , |
| BuildGrayCode | |||
| ) |
Definition at line 1098 of file ah-comb.cc.
References Aleph::build_gray_code(), Aleph::diff(), and Aleph::divide_and_conquer_partition_dp().
| TEST | ( | AhComb | , |
| BuildGrayCodeThrowsOnTooLarge | |||
| ) |
Definition at line 1127 of file ah-comb.cc.
References Aleph::build_gray_code(), and Aleph::divide_and_conquer_partition_dp().
| TEST | ( | AhComb | , |
| BuildPerms | |||
| ) |
Definition at line 190 of file ah-comb.cc.
References Aleph::build_perms(), Aleph::divide_and_conquer_partition_dp(), l, l1, and l2.
| TEST | ( | AhComb | , |
| BuildPermsEmptyInputReturnsOneEmptyPermutation | |||
| ) |
Definition at line 254 of file ah-comb.cc.
References Aleph::build_perms(), Aleph::divide_and_conquer_partition_dp(), and l.
| TEST | ( | AhComb | , |
| CombinationCountBasicCases | |||
| ) |
Definition at line 927 of file ah-comb.cc.
References Aleph::combination_count(), and Aleph::divide_and_conquer_partition_dp().
| TEST | ( | AhComb | , |
| CombinationCountOverflowThrows | |||
| ) |
Definition at line 938 of file ah-comb.cc.
References Aleph::combination_count(), and Aleph::divide_and_conquer_partition_dp().
| TEST | ( | AhComb | , |
| CombinationMaskEnumerationAndReset | |||
| ) |
Definition at line 946 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::first_combination_mask(), and Aleph::next_combination_mask().
| TEST | ( | AhComb | , |
| CombinationMaskValidation | |||
| ) |
Definition at line 966 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_combination_mask().
| TEST | ( | AhComb | , |
| ExistsPermFindsMatch | |||
| ) |
Definition at line 331 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::exists_perm(), Aleph::DynList< T >::get_first(), Aleph::DynList< T >::get_last(), l, l1, and l2.
| TEST | ( | AhComb | , |
| ExistsPermNoMatch | |||
| ) |
Definition at line 345 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::exists_perm(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| ExistsPermStopsEarly | |||
| ) |
Definition at line 359 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::exists_perm(), Aleph::DynList< T >::get_first(), Aleph::DynList< T >::get_last(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FilterPermAll | |||
| ) |
Definition at line 478 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::filter_perm(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FilterPermBasic | |||
| ) |
Definition at line 450 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::filter_perm(), Aleph::DynList< T >::get_first(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FilterPermEmpty | |||
| ) |
Definition at line 464 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::filter_perm(), l, l1, and l2.
| TEST | ( | AhComb | , |
| FoldPermAccumulates | |||
| ) |
Definition at line 224 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, l2, and Aleph::sum().
| TEST | ( | AhComb | , |
| FoldPermMultiplyFirstElements | |||
| ) |
Definition at line 688 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, l2, and Aleph::product().
| TEST | ( | AhComb | , |
| ForEachCombinationArrayAndEarlyStop | |||
| ) |
Definition at line 975 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::for_each_combination().
| TEST | ( | AhComb | , |
| ForEachCombinationEdgeCases | |||
| ) |
Definition at line 1002 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::for_each_combination(), and Aleph::Array< T >::size().
| TEST | ( | AhComb | , |
| ForEachPermBasic | |||
| ) |
Definition at line 535 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::for_each_perm(), Aleph::DynList< T >::insert(), l, l1, and l2.
| TEST | ( | AhComb | , |
| ForEachPermEmpty | |||
| ) |
Definition at line 552 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::for_each_perm(), Aleph::HTList::is_empty(), and l.
| TEST | ( | AhComb | , |
| GrayCodeConversion | |||
| ) |
Definition at line 1083 of file ah-comb.cc.
References Aleph::bin_to_gray(), Aleph::divide_and_conquer_partition_dp(), and Aleph::gray_to_bin().
| TEST | ( | AhComb | , |
| GrayCodeLargeValue | |||
| ) |
Definition at line 1120 of file ah-comb.cc.
References Aleph::bin_to_gray(), Aleph::divide_and_conquer_partition_dp(), and Aleph::gray_to_bin().
| TEST | ( | AhComb | , |
| InPlaceTransposeDynArray | |||
| ) |
Definition at line 120 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::in_place_transpose(), m, Aleph::DynArray< T >::reserve(), OhashCommon< HashTbl, Key >::size(), and Aleph::size().
| TEST | ( | AhComb | , |
| InPlaceTransposeSingleRow | |||
| ) |
Definition at line 630 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), LocateFunctions< Container, Type >::get_it(), Aleph::in_place_transpose(), m, and OhashCommon< HashTbl, Key >::size().
| TEST | ( | AhComb | , |
| MapPermBasic | |||
| ) |
Definition at line 492 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), FunctionalMethods< Container, T >::for_each(), l, l1, l2, and Aleph::sum().
| TEST | ( | AhComb | , |
| MapPermToString | |||
| ) |
Definition at line 516 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, l1, and l2.
| TEST | ( | AhComb | , |
| NextCombinationIndicesArrayEnumeratesAll | |||
| ) |
Definition at line 865 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_combination_indices().
| TEST | ( | AhComb | , |
| NextCombinationIndicesDynArray | |||
| ) |
Definition at line 911 of file ah-comb.cc.
References Aleph::count(), Aleph::divide_and_conquer_partition_dp(), Aleph::next_combination_indices(), and Aleph::DynArray< T >::reserve().
| TEST | ( | AhComb | , |
| NextCombinationIndicesResetOnLastCanBeDisabled | |||
| ) |
Definition at line 890 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_combination_indices().
| TEST | ( | AhComb | , |
| NextCombinationIndicesValidation | |||
| ) |
Definition at line 899 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_combination_indices().
| TEST | ( | AhComb | , |
| NextPermutationArrayBasicLexicographicOrder | |||
| ) |
Definition at line 789 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NextPermutationArrayHandlesDuplicatesWithoutRepeats | |||
| ) |
Definition at line 807 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NextPermutationArrayMatchesStdWithCustomComparator | |||
| ) |
Definition at line 823 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NextPermutationDynArray | |||
| ) |
Definition at line 849 of file ah-comb.cc.
References Aleph::count(), Aleph::divide_and_conquer_partition_dp(), Aleph::next_permutation(), and Aleph::DynArray< T >::reserve().
| TEST | ( | AhComb | , |
| NextPermutationResetOnLastCanBeDisabled | |||
| ) |
Definition at line 842 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::next_permutation().
| TEST | ( | AhComb | , |
| NodiscardAllPerm | |||
| ) |
Definition at line 1043 of file ah-comb.cc.
References Aleph::all(), Aleph::all_perm(), Aleph::divide_and_conquer_partition_dp(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardBuildCombs | |||
| ) |
Definition at line 736 of file ah-comb.cc.
References Aleph::build_combs(), Aleph::divide_and_conquer_partition_dp(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardBuildPerms | |||
| ) |
Definition at line 726 of file ah-comb.cc.
References Aleph::build_perms(), Aleph::divide_and_conquer_partition_dp(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardExistsPerm | |||
| ) |
Definition at line 779 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::exists(), Aleph::exists_perm(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardFilterPerm | |||
| ) |
Definition at line 1063 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::filter_perm(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardFoldPerm | |||
| ) |
Definition at line 756 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, and Aleph::sum().
| TEST | ( | AhComb | , |
| NodiscardMapPerm | |||
| ) |
Definition at line 1073 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, and l1.
| TEST | ( | AhComb | , |
| NodiscardNonePerm | |||
| ) |
Definition at line 1053 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, l1, Aleph::none(), and Aleph::none_perm().
| TEST | ( | AhComb | , |
| NodiscardPermCount | |||
| ) |
Definition at line 769 of file ah-comb.cc.
References Aleph::count(), Aleph::divide_and_conquer_partition_dp(), l, l1, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| NodiscardTranspose | |||
| ) |
Definition at line 746 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| NonePermNoneSatisfy | |||
| ) |
Definition at line 422 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, l2, Aleph::none(), and Aleph::none_perm().
| TEST | ( | AhComb | , |
| NonePermSomeSatisfy | |||
| ) |
Definition at line 436 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::get_first(), l, l1, l2, Aleph::none(), and Aleph::none_perm().
| TEST | ( | AhComb | , |
| NonRectangularTransposeDies | |||
| ) |
Definition at line 284 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::in_place_transpose(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| PermCountBasic | |||
| ) |
Definition at line 299 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, l1, l2, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| PermCountEmpty | |||
| ) |
Definition at line 308 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| PermCountSingleList | |||
| ) |
Definition at line 323 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, l1, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| PermCountWithEmptyList | |||
| ) |
Definition at line 314 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, l1, l2, and Aleph::perm_count().
| TEST | ( | AhComb | , |
| StressTestManyPermutations | |||
| ) |
Definition at line 703 of file ah-comb.cc.
References Aleph::count(), Aleph::divide_and_conquer_partition_dp(), l, l1, l2, l3, l5, Aleph::perm_count(), Aleph::HTList::size(), and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TransposeEmpty | |||
| ) |
Definition at line 93 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), 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::divide_and_conquer_partition_dp(), Aleph::in_place_transpose(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeSingleColumn | |||
| ) |
Definition at line 615 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeSingleRow | |||
| ) |
Definition at line 599 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeSquare | |||
| ) |
Definition at line 646 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TransposeWithZeroColumns | |||
| ) |
Definition at line 270 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::in_place_transpose(), m, and Aleph::transpose().
| TEST | ( | AhComb | , |
| TraversePermEarlyStop | |||
| ) |
Definition at line 173 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), l, l1, l2, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermEmptyInputCallsOnce | |||
| ) |
Definition at line 240 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::HTList::is_empty(), l, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermEnumeratesAll | |||
| ) |
Definition at line 152 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::insert(), l, l1, l2, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermSingleElement | |||
| ) |
Definition at line 583 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::insert(), l, l1, and Aleph::traverse_perm().
| TEST | ( | AhComb | , |
| TraversePermThreeLists | |||
| ) |
Definition at line 566 of file ah-comb.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynList< T >::insert(), l, l1, l2, l3, and Aleph::traverse_perm().