C++ Library Extensions 2022.12.09
To help learn modern C++ programming
cpg_combinatorics.hpp File Reference
#include "cpg_rational.hpp"
#include "cpg_iterator.hpp"
#include <functional>
Include dependency graph for cpg_combinatorics.hpp:

Go to the source code of this file.

Classes

struct  cpg::combinatorics::hidden::st_tail_no_op
 
struct  cpg::combinatorics::hidden::st_tail_remove
 
struct  cpg::combinatorics::hidden::st_tail_sort
 
struct  cpg::combinatorics::hidden::st_tail_get
 

Namespaces

namespace  cpg
 Includes subnamespace conversion.
 
namespace  cpg::combinatorics
 
namespace  cpg::combinatorics::hidden
 

Macros

#define NOMINMAX
 

Functions

template<typename ElementType >
auto cpg::combinatorics::hidden::product_base (std::vector< ElementType > const &A, std::vector< ElementType > const &B)
 
template<typename ElementType >
auto cpg::combinatorics::hidden::product_base (std::vector< std::vector< ElementType > > const &power_set, std::vector< ElementType > const &B)
 
template<typename ElementType , typename... VectorTypes>
auto cpg::combinatorics::hidden::product_base (std::vector< std::vector< ElementType > > const &power_set, std::vector< ElementType > const &A, std::vector< ElementType > const &B, VectorTypes &&... tails)
 
template<typename ElementType , typename... VectorTypes>
auto cpg::combinatorics::hidden::product_base (std::vector< ElementType > const &A, std::vector< ElementType > const &B, std::vector< ElementType > const &C, VectorTypes &&... tails)
 
template<typename SetWiseConstraintType , typename ElementType >
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; }
auto cpg::combinatorics::hidden::product_base (SetWiseConstraintType &&set_wise_constraint, std::vector< ElementType > const &A, std::vector< ElementType > const &B)
 
template<typename SetWiseConstraintType , typename ElementType >
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; }
auto cpg::combinatorics::hidden::product_base (SetWiseConstraintType &&set_wise_constraint, std::vector< std::vector< ElementType > > const &power_set, std::vector< ElementType > const &B)
 
template<typename SetWiseConstraintType , typename ElementType , typename... VectorTypes>
requires requires (SetWiseConstraintType constraint) { { constraint( std::vector<ElementType>{} ) } -> std::same_as<bool>; }
auto cpg::combinatorics::hidden::product_base (SetWiseConstraintType &&set_wise_constraint, std::vector< std::vector< ElementType > > const &power_set, 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>; }
auto cpg::combinatorics::hidden::product_base (SetWiseConstraintType &&set_wise_constraint, std::vector< ElementType > const &A, std::vector< ElementType > const &B, std::vector< ElementType > const &C, VectorTypes &&... tails)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
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)
 
template<typename BiDiIt , typename Compare >
bool cpg::combinatorics::next_k_permutation (BiDiIt first, BiDiIt mid, BiDiIt last, Compare comp)
 
template<typename BiDiIt , typename Compare >
bool cpg::combinatorics::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 > cpg::combinatorics::atomized_combination (std::vector< ElementType, AllocatorType > S, T1 r, T2 m_th, TailOperationType const &tail_operation=TailOperationType{})
 

Variables

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

Macro Definition Documentation

◆ NOMINMAX

#define NOMINMAX

Definition at line 10 of file cpg_combinatorics.hpp.