Aleph-w 3.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   
)

◆ TEST() [3/72]

TEST ( AhComb  ,
AllPermStopsEarly   
)

◆ TEST() [4/72]

TEST ( AhComb  ,
BuildCombinationsArrayAndDynArray   
)

◆ TEST() [5/72]

TEST ( AhComb  ,
BuildCombsAllSame   
)

◆ TEST() [6/72]

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

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

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

TEST ( AhComb  ,
BuildGrayCode   
)

◆ TEST() [10/72]

TEST ( AhComb  ,
BuildGrayCodeThrowsOnTooLarge   
)

◆ TEST() [11/72]

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

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

TEST ( AhComb  ,
CombinationCountBasicCases   
)

◆ TEST() [14/72]

TEST ( AhComb  ,
CombinationCountOverflowThrows   
)

◆ TEST() [15/72]

TEST ( AhComb  ,
CombinationMaskEnumerationAndReset   
)

◆ TEST() [16/72]

TEST ( AhComb  ,
CombinationMaskValidation   
)

◆ TEST() [17/72]

TEST ( AhComb  ,
ExistsPermFindsMatch   
)

◆ TEST() [18/72]

TEST ( AhComb  ,
ExistsPermNoMatch   
)

◆ TEST() [19/72]

TEST ( AhComb  ,
ExistsPermStopsEarly   
)

◆ TEST() [20/72]

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

TEST ( AhComb  ,
FilterPermBasic   
)

◆ TEST() [22/72]

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

TEST ( AhComb  ,
FoldPermAccumulates   
)

◆ TEST() [24/72]

TEST ( AhComb  ,
FoldPermMultiplyFirstElements   
)

◆ TEST() [25/72]

TEST ( AhComb  ,
ForEachCombinationArrayAndEarlyStop   
)

◆ TEST() [26/72]

TEST ( AhComb  ,
ForEachCombinationEdgeCases   
)

◆ TEST() [27/72]

TEST ( AhComb  ,
ForEachPermBasic   
)

◆ TEST() [28/72]

TEST ( AhComb  ,
ForEachPermEmpty   
)

◆ TEST() [29/72]

TEST ( AhComb  ,
GrayCodeConversion   
)

◆ TEST() [30/72]

TEST ( AhComb  ,
GrayCodeLargeValue   
)

◆ TEST() [31/72]

TEST ( AhComb  ,
InPlaceTransposeDynArray   
)

◆ TEST() [32/72]

TEST ( AhComb  ,
InPlaceTransposeSingleRow   
)

◆ TEST() [33/72]

TEST ( AhComb  ,
MapPermBasic   
)

◆ TEST() [34/72]

TEST ( AhComb  ,
MapPermToString   
)

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

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

◆ TEST() [35/72]

TEST ( AhComb  ,
NextCombinationIndicesArrayEnumeratesAll   
)

◆ TEST() [36/72]

TEST ( AhComb  ,
NextCombinationIndicesDynArray   
)

◆ TEST() [37/72]

TEST ( AhComb  ,
NextCombinationIndicesResetOnLastCanBeDisabled   
)

◆ TEST() [38/72]

TEST ( AhComb  ,
NextCombinationIndicesValidation   
)

◆ TEST() [39/72]

TEST ( AhComb  ,
NextPermutationArrayBasicLexicographicOrder   
)

◆ TEST() [40/72]

TEST ( AhComb  ,
NextPermutationArrayHandlesDuplicatesWithoutRepeats   
)

◆ TEST() [41/72]

TEST ( AhComb  ,
NextPermutationArrayMatchesStdWithCustomComparator   
)

◆ TEST() [42/72]

TEST ( AhComb  ,
NextPermutationDynArray   
)

◆ TEST() [43/72]

TEST ( AhComb  ,
NextPermutationResetOnLastCanBeDisabled   
)

◆ TEST() [44/72]

TEST ( AhComb  ,
NodiscardAllPerm   
)

◆ TEST() [45/72]

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

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

TEST ( AhComb  ,
NodiscardExistsPerm   
)

◆ TEST() [48/72]

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

TEST ( AhComb  ,
NodiscardFoldPerm   
)

◆ TEST() [50/72]

TEST ( AhComb  ,
NodiscardMapPerm   
)

◆ TEST() [51/72]

TEST ( AhComb  ,
NodiscardNonePerm   
)

◆ TEST() [52/72]

TEST ( AhComb  ,
NodiscardPermCount   
)

◆ TEST() [53/72]

TEST ( AhComb  ,
NodiscardTranspose   
)

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

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

◆ TEST() [54/72]

TEST ( AhComb  ,
NonePermNoneSatisfy   
)

◆ TEST() [55/72]

TEST ( AhComb  ,
NonePermSomeSatisfy   
)

◆ TEST() [56/72]

TEST ( AhComb  ,
NonRectangularTransposeDies   
)

◆ TEST() [57/72]

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

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

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

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

TEST ( AhComb  ,
StressTestManyPermutations   
)

◆ TEST() [62/72]

TEST ( AhComb  ,
TransposeEmpty   
)

◆ TEST() [63/72]

TEST ( AhComb  ,
TransposeRectangular   
)

◆ TEST() [64/72]

TEST ( AhComb  ,
TransposeSingleColumn   
)

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

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

◆ TEST() [65/72]

TEST ( AhComb  ,
TransposeSingleRow   
)

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

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

◆ TEST() [66/72]

TEST ( AhComb  ,
TransposeSquare   
)

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

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

◆ TEST() [67/72]

TEST ( AhComb  ,
TransposeWithZeroColumns   
)

◆ TEST() [68/72]

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

TEST ( AhComb  ,
TraversePermEmptyInputCallsOnce   
)

◆ TEST() [70/72]

TEST ( AhComb  ,
TraversePermEnumeratesAll   
)

◆ TEST() [71/72]

TEST ( AhComb  ,
TraversePermSingleElement   
)

◆ TEST() [72/72]

TEST ( AhComb  ,
TraversePermThreeLists   
)