fw4spl
fwTools::CartesianProduct Struct Reference

compute the cartesian product of many set More...

#include <Combinatory.hpp>

Classes

struct  apply
 

Detailed Description

compute the cartesian product of many set

Parameters
MultiSetmust be of the following form vector< vector< ElementaryType1, ElementaryType2,... > , vector< ...ElementaryTypes...> ... > where Elementary types are not boost::mpl::Container : i.e int, classes, std::vector<int> etc...

Example

using namespace boost::mpl;
typedef vector< vector<signed char, signed short, signed int>, vector< float, double > , vector< std::string,
unsigned char > > ::type MultiSet;
typedef apply< CartesianProduct, MultiSet>::type Result;
BOOST_MPL_ASSERT_RELATION( size< Result >::value , == , 12 );
BOOST_MPL_ASSERT(( equal< at_c<Result,0>::type, vector< signed char, float , std::string > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,1>::type, vector< signed char, float , unsigned char > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,2>::type, vector< signed char, double , std::string > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,3>::type, vector< signed char, double , unsigned char > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,4>::type, vector< signed short, float , std::string > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,5>::type, vector< signed short, float , unsigned char > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,6>::type, vector< signed short, double , std::string > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,7>::type, vector< signed short, double , unsigned char > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,8>::type, vector< signed int, float , std::string > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,9>::type, vector< signed int, float , unsigned char > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,10>::type, vector< signed int, double , std::string > > ));
BOOST_MPL_ASSERT(( equal< at_c<Result,11>::type, vector< signed int, double , unsigned char > > ));

Definition at line 183 of file Combinatory.hpp.


The documentation for this struct was generated from the following file: