8 #ifndef GRID_KEY_DX_EXPRESSION_UNIT_TESTS_HPP_ 9 #define GRID_KEY_DX_EXPRESSION_UNIT_TESTS_HPP_ 11 #include "Grid/grid_key.hpp" 13 BOOST_AUTO_TEST_SUITE( grid_expression_test )
16 BOOST_AUTO_TEST_CASE( grid_expression_use)
19 const comb<3> c({(char)1,0,(
char)-1});
25 BOOST_REQUIRE_EQUAL(res2.
get(0),16);
26 BOOST_REQUIRE_EQUAL(res2.
get(1),16);
27 BOOST_REQUIRE_EQUAL(res2.
get(2),16);
31 BOOST_REQUIRE_EQUAL(res.get(0),3);
32 BOOST_REQUIRE_EQUAL(res.get(1),6);
33 BOOST_REQUIRE_EQUAL(res.get(2),9);
37 BOOST_REQUIRE_EQUAL(res.get(0),0);
38 BOOST_REQUIRE_EQUAL(res.get(1),0);
39 BOOST_REQUIRE_EQUAL(res.get(2),0);
45 BOOST_REQUIRE_EQUAL(res.get(0),1);
46 BOOST_REQUIRE_EQUAL(res.get(1),2);
47 BOOST_REQUIRE_EQUAL(res.get(2),3);
50 BOOST_AUTO_TEST_SUITE_END()
grid_key_dx is the key to access any element in the grid
Position of the element of dimension d in the hyper-cube of dimension dim.
__device__ __host__ index_type get(index_type i) const
Get the i index.
This class implement the point shape in an N-dimensional space.