8 #ifndef SRC_SPACE_SHAPE_POINT_UNIT_TEST_HPP_
9 #define SRC_SPACE_SHAPE_POINT_UNIT_TEST_HPP_
12 #include "Space/Shape/Point.hpp"
13 #include "Grid/comb.hpp"
14 #include "util/convert.hpp"
16 BOOST_AUTO_TEST_SUITE( Point_test_suite )
18 BOOST_AUTO_TEST_CASE( Point_use )
20 std::cout <<
"Point unit test start" <<
"\n";
32 BOOST_REQUIRE_EQUAL(p.get(0),2.0);
33 BOOST_REQUIRE_EQUAL(p.get(1),6.0);
34 BOOST_REQUIRE_EQUAL(p.get(2),12.0);
49 p = p + middle * (one + pc);
51 BOOST_REQUIRE_EQUAL(p.get(0),4.0);
52 BOOST_REQUIRE_EQUAL(p.get(1),12.0);
53 BOOST_REQUIRE_EQUAL(p.get(2),24.0);
61 BOOST_REQUIRE_CLOSE(pn.norm(),1.732050,0.0001);
65 std::cout <<
"Point unit test stop" <<
"\n";
68 BOOST_AUTO_TEST_SUITE_END()
Position of the element of dimension d in the hyper-cube of dimension dim.
static Point< dim, St > convert(const comb< dim > &c)
Return the combination converted to point.
This class implement the point shape in an N-dimensional space.
T get(int i) const
Get coordinate.
void one()
Set to one the point coordinate.
char c[dim]
Array that store the combination.