void RCGStrategy::set_coordinates(common::PE::CommPattern& cp, const common::Table< Real >& coords, const common::List< Uint >& used_nodes, const std::vector< bool >& periodic_links_active) { math::LSS::CoordinatesStrategy::set_coordinates(cp, coords, used_nodes, periodic_links_active); m_implementation->m_dim = coords.row_size(); m_implementation->m_xcoords = m_x_coords.empty() ? 0 : &m_x_coords[0]; m_implementation->m_ycoords = m_y_coords.empty() ? 0 : &m_y_coords[0]; m_implementation->m_zcoords = m_z_coords.empty() ? 0 : &m_z_coords[0]; m_implementation->reset_solver(); }
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); } } }