C++ Library Extensions
2022.12.09
To help learn modern C++ programming
080-next_permu.cpp
Go to the documentation of this file.
1
#include <
tpf_output.hpp
>
2
#include <
tpf_chrono_random.hpp
>
3
#include <
tpf_set.hpp
>
4
5
namespace
ncrnpr
=
tpf::ncrnpr
;
6
7
tpf::sstream
stream
;
8
auto
&
endl
=
tpf::endl
;
9
auto
nl
=
tpf::nl
;
10
11
void
test_permutation
()
12
{
13
auto
permutations =
tpf::set::build_permutations
(10, 3, 3);
14
15
for
(
auto
p: permutations)
16
{
17
stream
<< p <<
": "
<< tpf::set::hidden::inversion(p) <<
nl
;
18
}
19
20
stream
<<
endl
;
21
22
}
23
24
int
main
()
25
{
26
test_permutation
();
27
}
endl
auto & endl
Definition:
080-next_permu.cpp:8
stream
tpf::sstream stream
Definition:
080-next_permu.cpp:7
test_permutation
void test_permutation()
Definition:
080-next_permu.cpp:11
nl
auto nl
Definition:
080-next_permu.cpp:9
main
int main()
Definition:
080-next_permu.cpp:24
tpf::output::string_stream
Definition:
tpf_output.hpp:844
tpf::ncrnpr
Implements nCr, nPr.
Definition:
tpf_ncrnpr.hpp:64
tpf::set::build_permutations
auto build_permutations(ThreadCountType thread_count, NType n, RType r)
Definition:
tpf_set.hpp:1110
tpf::endl
constexpr auto endl
Definition:
tpf_output.hpp:973
tpf::nl
constexpr auto nl
Definition:
tpf_output.hpp:971
tpf_chrono_random.hpp
tpf_output.hpp
Stream output operators << are implemented.
tpf_set.hpp
Implements set operations.
CppExtension
examples
080-next_permu.cpp
Generated by
1.9.4