33 std::cout <<
"Combinations of " <<
v1 <<
" and " <<
v2 <<
":" << std::endl;
34 for(
size_t i=0; i<
v3.size(); i++) {
35 std::cout <<
c1[i] <<
" * " <<
c2[i] <<
" = " <<
v3[i] << std::endl;
37 std::cout << std::endl;
48 auto c4 =
Take(
v4, idx2[1]);
49 auto c5 =
Take(
v4, idx2[2]);
51 auto v5 =
c3 * c4 * c5;
53 std::cout <<
"Unique triples of " <<
v4 <<
":" << std::endl;
54 for(
size_t i=0; i<
v4.size(); i++) {
55 std::cout <<
c3[i] <<
" * " << c4[i] <<
" * " << c5[i] <<
" = " << v5[i] << std::endl;
57 std::cout << std::endl;
A "std::vector"-like collection of values implementing handy operation to analyse them.
RVec< T > Take(const RVec< T > &v, const RVec< typename RVec< T >::size_type > &i)
Return elements of a vector at given indices.
RVec< RVec< std::size_t > > Combinations(const std::size_t size1, const std::size_t size2)
Return the indices that represent all combinations of the elements of two RVecs.