Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-comb.cc File Reference

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>
Include dependency graph for ah-comb.cc:

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)
 

Detailed Description

Tests for Ah Comb.

Definition in file ah-comb.cc.

Function Documentation

◆ TEST() [1/72]

TEST ( AhComb  ,
AllPermAllSatisfy   
)

◆ TEST() [2/72]

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() [3/72]

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() [4/72]

TEST ( AhComb  ,
BuildCombinationsArrayAndDynArray   
)

Definition at line 1025 of file ah-comb.cc.

References Aleph::build_combinations(), and Aleph::DynArray< T >::reserve().

◆ TEST() [5/72]

TEST ( AhComb  ,
BuildCombsAllSame   
)

Definition at line 666 of file ah-comb.cc.

References Aleph::build_combs(), l, l1, l2, and Aleph::sort().

◆ TEST() [6/72]

TEST ( AhComb  ,
BuildCombsDeduplicates   
)

Definition at line 209 of file ah-comb.cc.

References Aleph::build_combs(), l, l1, and l2.

◆ TEST() [7/72]

TEST ( AhComb  ,
BuildCombsEmptyInputReturnsOneEmptyCombination   
)

Definition at line 266 of file ah-comb.cc.

References Aleph::build_combs(), and l.

◆ TEST() [8/72]

TEST ( AhComb  ,
BuildCombsThreeLists   
)

Definition at line 679 of file ah-comb.cc.

References Aleph::build_combs(), l, l1, l2, and l3.

◆ TEST() [9/72]

TEST ( AhComb  ,
BuildGrayCode   
)

Definition at line 1103 of file ah-comb.cc.

References Aleph::build_gray_code(), and Aleph::diff().

◆ TEST() [10/72]

TEST ( AhComb  ,
BuildGrayCodeThrowsOnTooLarge   
)

Definition at line 1132 of file ah-comb.cc.

References Aleph::build_gray_code().

◆ TEST() [11/72]

TEST ( AhComb  ,
BuildPerms   
)

Definition at line 194 of file ah-comb.cc.

References Aleph::build_perms(), l, l1, and l2.

◆ TEST() [12/72]

TEST ( AhComb  ,
BuildPermsEmptyInputReturnsOneEmptyPermutation   
)

Definition at line 258 of file ah-comb.cc.

References Aleph::build_perms(), and l.

◆ TEST() [13/72]

TEST ( AhComb  ,
CombinationCountBasicCases   
)

Definition at line 932 of file ah-comb.cc.

References Aleph::combination_count().

◆ TEST() [14/72]

TEST ( AhComb  ,
CombinationCountOverflowThrows   
)

Definition at line 943 of file ah-comb.cc.

References Aleph::combination_count().

◆ TEST() [15/72]

TEST ( AhComb  ,
CombinationMaskEnumerationAndReset   
)

Definition at line 951 of file ah-comb.cc.

References Aleph::first_combination_mask(), and Aleph::next_combination_mask().

◆ TEST() [16/72]

TEST ( AhComb  ,
CombinationMaskValidation   
)

Definition at line 971 of file ah-comb.cc.

References Aleph::next_combination_mask().

◆ TEST() [17/72]

TEST ( AhComb  ,
ExistsPermFindsMatch   
)

◆ TEST() [18/72]

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() [19/72]

TEST ( AhComb  ,
ExistsPermStopsEarly   
)

◆ TEST() [20/72]

TEST ( AhComb  ,
FilterPermAll   
)

Definition at line 482 of file ah-comb.cc.

References Aleph::filter_perm(), l, l1, and l2.

◆ TEST() [21/72]

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() [22/72]

TEST ( AhComb  ,
FilterPermEmpty   
)

Definition at line 468 of file ah-comb.cc.

References Aleph::filter_perm(), l, l1, and l2.

◆ TEST() [23/72]

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() [24/72]

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() [25/72]

TEST ( AhComb  ,
ForEachCombinationArrayAndEarlyStop   
)

Definition at line 980 of file ah-comb.cc.

References Aleph::for_each_combination().

◆ TEST() [26/72]

TEST ( AhComb  ,
ForEachCombinationEdgeCases   
)

Definition at line 1007 of file ah-comb.cc.

References Aleph::for_each_combination(), and Aleph::Array< T >::size().

◆ TEST() [27/72]

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() [28/72]

TEST ( AhComb  ,
ForEachPermEmpty   
)

Definition at line 556 of file ah-comb.cc.

References Aleph::for_each_perm(), Aleph::HTList::is_empty(), and l.

◆ TEST() [29/72]

TEST ( AhComb  ,
GrayCodeConversion   
)

Definition at line 1088 of file ah-comb.cc.

References Aleph::bin_to_gray(), and Aleph::gray_to_bin().

◆ TEST() [30/72]

TEST ( AhComb  ,
GrayCodeLargeValue   
)

Definition at line 1125 of file ah-comb.cc.

References Aleph::bin_to_gray(), and Aleph::gray_to_bin().

◆ TEST() [31/72]

TEST ( AhComb  ,
InPlaceTransposeDynArray   
)

◆ TEST() [32/72]

◆ TEST() [33/72]

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() [34/72]

TEST ( AhComb  ,
MapPermToString   
)

Definition at line 520 of file ah-comb.cc.

References l, l1, and l2.

◆ TEST() [35/72]

TEST ( AhComb  ,
NextCombinationIndicesArrayEnumeratesAll   
)

Definition at line 870 of file ah-comb.cc.

References Aleph::next_combination_indices().

◆ TEST() [36/72]

TEST ( AhComb  ,
NextCombinationIndicesDynArray   
)

◆ TEST() [37/72]

TEST ( AhComb  ,
NextCombinationIndicesResetOnLastCanBeDisabled   
)

Definition at line 895 of file ah-comb.cc.

References Aleph::next_combination_indices().

◆ TEST() [38/72]

TEST ( AhComb  ,
NextCombinationIndicesValidation   
)

Definition at line 904 of file ah-comb.cc.

References Aleph::next_combination_indices().

◆ TEST() [39/72]

TEST ( AhComb  ,
NextPermutationArrayBasicLexicographicOrder   
)

Definition at line 794 of file ah-comb.cc.

References Aleph::next_permutation().

◆ TEST() [40/72]

TEST ( AhComb  ,
NextPermutationArrayHandlesDuplicatesWithoutRepeats   
)

Definition at line 812 of file ah-comb.cc.

References Aleph::next_permutation().

◆ TEST() [41/72]

TEST ( AhComb  ,
NextPermutationArrayMatchesStdWithCustomComparator   
)

Definition at line 828 of file ah-comb.cc.

References Aleph::next_permutation().

◆ TEST() [42/72]

TEST ( AhComb  ,
NextPermutationDynArray   
)

◆ TEST() [43/72]

TEST ( AhComb  ,
NextPermutationResetOnLastCanBeDisabled   
)

Definition at line 847 of file ah-comb.cc.

References Aleph::next_permutation().

◆ TEST() [44/72]

TEST ( AhComb  ,
NodiscardAllPerm   
)

Definition at line 1048 of file ah-comb.cc.

References Aleph::all(), Aleph::all_perm(), l, and l1.

◆ TEST() [45/72]

TEST ( AhComb  ,
NodiscardBuildCombs   
)

Definition at line 741 of file ah-comb.cc.

References Aleph::build_combs(), l, and l1.

◆ TEST() [46/72]

TEST ( AhComb  ,
NodiscardBuildPerms   
)

Definition at line 731 of file ah-comb.cc.

References Aleph::build_perms(), l, and l1.

◆ TEST() [47/72]

TEST ( AhComb  ,
NodiscardExistsPerm   
)

Definition at line 784 of file ah-comb.cc.

References Aleph::exists(), Aleph::exists_perm(), l, and l1.

◆ TEST() [48/72]

TEST ( AhComb  ,
NodiscardFilterPerm   
)

Definition at line 1068 of file ah-comb.cc.

References Aleph::filter_perm(), l, and l1.

◆ TEST() [49/72]

TEST ( AhComb  ,
NodiscardFoldPerm   
)

Definition at line 761 of file ah-comb.cc.

References Aleph::DynList< T >::get_first(), l, l1, and Aleph::sum().

◆ TEST() [50/72]

TEST ( AhComb  ,
NodiscardMapPerm   
)

Definition at line 1078 of file ah-comb.cc.

References Aleph::DynList< T >::get_first(), l, and l1.

◆ TEST() [51/72]

TEST ( AhComb  ,
NodiscardNonePerm   
)

Definition at line 1058 of file ah-comb.cc.

References l, l1, Aleph::none(), and Aleph::none_perm().

◆ TEST() [52/72]

TEST ( AhComb  ,
NodiscardPermCount   
)

Definition at line 774 of file ah-comb.cc.

References Aleph::count(), l, l1, and Aleph::perm_count().

◆ TEST() [53/72]

TEST ( AhComb  ,
NodiscardTranspose   
)

Definition at line 751 of file ah-comb.cc.

References m, and Aleph::transpose().

◆ TEST() [54/72]

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() [55/72]

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() [56/72]

TEST ( AhComb  ,
NonRectangularTransposeDies   
)

Definition at line 288 of file ah-comb.cc.

References Aleph::in_place_transpose(), m, and Aleph::transpose().

◆ TEST() [57/72]

TEST ( AhComb  ,
PermCountBasic   
)

Definition at line 303 of file ah-comb.cc.

References l, l1, l2, and Aleph::perm_count().

◆ TEST() [58/72]

TEST ( AhComb  ,
PermCountEmpty   
)

Definition at line 312 of file ah-comb.cc.

References l, and Aleph::perm_count().

◆ TEST() [59/72]

TEST ( AhComb  ,
PermCountSingleList   
)

Definition at line 327 of file ah-comb.cc.

References l, l1, and Aleph::perm_count().

◆ TEST() [60/72]

TEST ( AhComb  ,
PermCountWithEmptyList   
)

Definition at line 318 of file ah-comb.cc.

References l, l1, l2, and Aleph::perm_count().

◆ TEST() [61/72]

TEST ( AhComb  ,
StressTestManyPermutations   
)

◆ TEST() [62/72]

TEST ( AhComb  ,
TransposeEmpty   
)

◆ TEST() [63/72]

TEST ( AhComb  ,
TransposeRectangular   
)

Definition at line 102 of file ah-comb.cc.

References Aleph::in_place_transpose(), m, row, and Aleph::transpose().

◆ TEST() [64/72]

TEST ( AhComb  ,
TransposeSingleColumn   
)

Definition at line 619 of file ah-comb.cc.

References m, and Aleph::transpose().

◆ TEST() [65/72]

TEST ( AhComb  ,
TransposeSingleRow   
)

Definition at line 603 of file ah-comb.cc.

References m, and Aleph::transpose().

◆ TEST() [66/72]

TEST ( AhComb  ,
TransposeSquare   
)

Definition at line 651 of file ah-comb.cc.

References m, and Aleph::transpose().

◆ TEST() [67/72]

TEST ( AhComb  ,
TransposeWithZeroColumns   
)

Definition at line 274 of file ah-comb.cc.

References Aleph::in_place_transpose(), m, and Aleph::transpose().

◆ TEST() [68/72]

TEST ( AhComb  ,
TraversePermEarlyStop   
)

Definition at line 177 of file ah-comb.cc.

References l, l1, l2, and Aleph::traverse_perm().

◆ TEST() [69/72]

TEST ( AhComb  ,
TraversePermEmptyInputCallsOnce   
)

Definition at line 244 of file ah-comb.cc.

References Aleph::HTList::is_empty(), l, and Aleph::traverse_perm().

◆ TEST() [70/72]

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() [71/72]

TEST ( AhComb  ,
TraversePermSingleElement   
)

Definition at line 587 of file ah-comb.cc.

References Aleph::DynList< T >::insert(), l, l1, and Aleph::traverse_perm().

◆ TEST() [72/72]

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().