C++ Library Extensions 2022.12.09
To help learn modern C++ programming
cpg::combinatorics Namespace Reference

Namespaces

namespace  hidden
 

Functions

template<typename ElementType , typename... VectorTypes>
requires requires { requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); }
auto product (std::vector< ElementType > const &A, std::vector< ElementType > const &B, VectorTypes... tails)
 
template<typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); }
auto product (SetWiseConstraintType &&set_wise_constraint, std::vector< ElementType > const &A, std::vector< ElementType > const &B, VectorTypes... tails)
 
template<typename TransformerType , typename ElementType , typename... VectorTypes>
requires requires(std::vector<ElementType> v) { { transformer(v) } -> std::same_as<std::vector<ElementType>>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); }
auto product (TransformerType &&transformer, std::vector< ElementType > const &A, std::vector< ElementType > const &B, VectorTypes... tails)
 
template<typename TranformerType , typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); } requires(std::vector<ElementType> v) { { transformer(v) } -> std::same_as<std::vector<ElementType>>; }
auto product (TranformerType &&transformer, SetWiseConstraintType &&set_wise_constraint, std::vector< ElementType > const &A, std::vector< ElementType > const &B, VectorTypes... tails)
 
template<typename TranformerType , typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); } requires(std::vector<ElementType> v) { { transformer(v) } -> std::same_as<std::vector<ElementType>>; }
auto product (SetWiseConstraintType &&set_wise_constraint, TranformerType &&transformer, std::vector< ElementType > const &A, std::vector< ElementType > const &B, VectorTypes... tails)
 
template<typename ElementType , typename AllocatorType , typename T1 , typename T2 >
std::vector< ElementType, AllocatorType > atomized_permutation (std::vector< ElementType, AllocatorType > S, T1 r, T2 m_th, bool RemoveTails=false)
 
template<std::size_t rr, bool RemoveTails = false, typename ElementType = int, std::size_t Size = 1, typename Type = int>
auto atomized_permutation (std::array< ElementType, Size > S, Type m_th)
 
template<typename BiDiIt , typename Compare >
bool next_k_permutation (BiDiIt first, BiDiIt mid, BiDiIt last, Compare comp)
 
template<typename BiDiIt , typename Compare >
bool next_combination (BiDiIt first, BiDiIt mid, BiDiIt last, Compare comp)
 
template<typename ElementType , typename AllocatorType , typename T1 , typename T2 , typename TailOperationType = hidden::st_tail_remove>
std::vector< ElementType, AllocatorType > atomized_combination (std::vector< ElementType, AllocatorType > S, T1 r, T2 m_th, TailOperationType const &tail_operation=TailOperationType{})
 

Variables

constexpr hidden::st_tail_no_op tail_no_op
 
constexpr hidden::st_tail_remove tail_remove
 
constexpr hidden::st_tail_sort tail_sort
 
constexpr hidden::st_tail_get tail_get
 

Function Documentation

◆ atomized_combination()

template<typename ElementType , typename AllocatorType , typename T1 , typename T2 , typename TailOperationType = hidden::st_tail_remove>
std::vector< ElementType, AllocatorType > cpg::combinatorics::atomized_combination ( std::vector< ElementType, AllocatorType >  S,
T1  r,
T2  m_th,
TailOperationType const &  tail_operation = TailOperationType{} 
)

Definition at line 431 of file cpg_combinatorics.hpp.

◆ atomized_permutation() [1/2]

template<std::size_t rr, bool RemoveTails = false, typename ElementType = int, std::size_t Size = 1, typename Type = int>
auto cpg::combinatorics::atomized_permutation ( std::array< ElementType, Size >  S,
Type  m_th 
)

Definition at line 282 of file cpg_combinatorics.hpp.

Here is the call graph for this function:

◆ atomized_permutation() [2/2]

template<typename ElementType , typename AllocatorType , typename T1 , typename T2 >
std::vector< ElementType, AllocatorType > cpg::combinatorics::atomized_permutation ( std::vector< ElementType, AllocatorType >  S,
T1  r,
T2  m_th,
bool  RemoveTails = false 
)

Definition at line 220 of file cpg_combinatorics.hpp.

Here is the call graph for this function:

◆ next_combination()

template<typename BiDiIt , typename Compare >
bool cpg::combinatorics::next_combination ( BiDiIt  first,
BiDiIt  mid,
BiDiIt  last,
Compare  comp 
)

Definition at line 359 of file cpg_combinatorics.hpp.

Here is the call graph for this function:

◆ next_k_permutation()

template<typename BiDiIt , typename Compare >
bool cpg::combinatorics::next_k_permutation ( BiDiIt  first,
BiDiIt  mid,
BiDiIt  last,
Compare  comp 
)

Definition at line 351 of file cpg_combinatorics.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ product() [1/5]

template<typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); }
auto cpg::combinatorics::product ( SetWiseConstraintType &&  set_wise_constraint,
std::vector< ElementType > const &  A,
std::vector< ElementType > const &  B,
VectorTypes...  tails 
)

Definition at line 167 of file cpg_combinatorics.hpp.

Here is the call graph for this function:

◆ product() [2/5]

template<typename TranformerType , typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); } requires(std::vector<ElementType> v) { { transformer(v) } -> std::same_as<std::vector<ElementType>>; }
auto cpg::combinatorics::product ( SetWiseConstraintType &&  set_wise_constraint,
TranformerType &&  transformer,
std::vector< ElementType > const &  A,
std::vector< ElementType > const &  B,
VectorTypes...  tails 
)

Definition at line 208 of file cpg_combinatorics.hpp.

◆ product() [3/5]

template<typename ElementType , typename... VectorTypes>
requires requires { requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); }
auto cpg::combinatorics::product ( std::vector< ElementType > const &  A,
std::vector< ElementType > const &  B,
VectorTypes...  tails 
)

Definition at line 156 of file cpg_combinatorics.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ product() [4/5]

template<typename TranformerType , typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); } requires(std::vector<ElementType> v) { { transformer(v) } -> std::same_as<std::vector<ElementType>>; }
auto cpg::combinatorics::product ( TranformerType &&  transformer,
SetWiseConstraintType &&  set_wise_constraint,
std::vector< ElementType > const &  A,
std::vector< ElementType > const &  B,
VectorTypes...  tails 
)

Definition at line 192 of file cpg_combinatorics.hpp.

◆ product() [5/5]

template<typename TransformerType , typename ElementType , typename... VectorTypes>
requires requires(std::vector<ElementType> v) { { transformer(v) } -> std::same_as<std::vector<ElementType>>; requires ( std::same_as<std::vector<ElementType>, std::remove_cvref_t<VectorTypes>> && ... ); }
auto cpg::combinatorics::product ( TransformerType &&  transformer,
std::vector< ElementType > const &  A,
std::vector< ElementType > const &  B,
VectorTypes...  tails 
)

Definition at line 174 of file cpg_combinatorics.hpp.

Variable Documentation

◆ tail_get

constexpr hidden::st_tail_get cpg::combinatorics::tail_get
constexpr

Definition at line 426 of file cpg_combinatorics.hpp.

◆ tail_no_op

constexpr hidden::st_tail_no_op cpg::combinatorics::tail_no_op
constexpr

Definition at line 423 of file cpg_combinatorics.hpp.

◆ tail_remove

constexpr hidden::st_tail_remove cpg::combinatorics::tail_remove
constexpr

Definition at line 424 of file cpg_combinatorics.hpp.

◆ tail_sort

constexpr hidden::st_tail_sort cpg::combinatorics::tail_sort
constexpr

Definition at line 425 of file cpg_combinatorics.hpp.