14 using number_t = cmb::permutation::number_t;
23 for(number_t m_th = 0; m_th < max_mth; ++m_th)
31 for(number_t m_th = 0; m_th < max_mth; ++m_th)
64 std::unique_lock<std::mutex> lock(
mutex);
78 using number_t = cmb::permutation::number_t;
107 for(number_t m_th = 0; m_th < max_mth; ++m_th)
118 std::thread::hardware_concurrency();
127 n = atoi(argv[2]); r = atoi(argv[3]);
136 catch(
const std::exception&)
142 stream <<
"Enumerating " << n <<
"_P_" <<r
143 <<
" = " <<
permu <<
" permutations with "
int main(int argc, char **argv)
void performance_test_for_permutations()
void performance_test_for_permutations_parallel(int factor, int n, int r)
std::string elapsed_time(bool bReset=true, TimeUnit dummy_time=TimeUnit{}) const
auto elapsed(bool bReset=true) const
Implements random number generator and stop watch.
range_vector_t split_range_count(CountType count, StartType st, EndType ed)
enable_if_all_in_list_t< types::type_list_t< Type1, Type2 >, integral_list_t, ReturnType > npr(Type1 nn, Type2 rr)
std::vector< T > enum_permutation(T n, T r, T m_th)
std::vector< NRType > enum_permutation_static(PType permu, NRType n, NRType r, MType m_th)
void parallel_visit_permutations(const std::pair< size_t, size_t > permutation_specification, CallbackType &&callback, ArgTypes &&... args)
void visit_permutations_parallel(TCType thread_count, NRType n, NRType r, CallbackType &&callback, ArgTypes &&... args)
Calls callback(enumerated_permutation, args...) in parallel.
std::atomic< int > thread_count
Stream output operators << are implemented.