void fill_table(common::Table<T>& table) { typedef typename boost::mpl::if_< typename boost::is_integral<T>::type, boost::random::uniform_int_distribution<T>, boost::random::uniform_real_distribution<T> >::type distribution_type; distribution_type dist(0, 1); const Uint nb_rows = table.size(); const Uint nb_cols = table.row_size(); for(Uint i = 0; i != nb_rows; ++i) { for(Uint j = 0; j != nb_cols; ++j) { table[i][j] = dist(gen); } } }
View view(common::Table<Uint>::ConstRow& indices) { return array()[ boost::indices[range(indices[0],indices[0]+indices.size())][range()] ]; }