93SCENARIO(
"GenericLatticeConvexHull< ConvexHullIntegralKernel< 2 > > unit tests",
"[genquickhull][integral_kernel][2d]" )
97 typedef Space::Point
Point;
100 GIVEN(
"Given a set { } " ) {
101 std::vector<Point> V = { };
103 bool ok = hull.compute( V );
104 std::cout << hull << std::endl;
105 THEN(
"Everything went fine and dim=-1." ) {
107 REQUIRE( hull.affine_dimension == -1 );
111 GIVEN(
"Given a set { (2,1), (2,1) } " ) {
115 bool ok = hull.compute( V );
116 std::cout << hull << std::endl;
117 THEN(
"Everything went fine and dim=0." ) {
119 REQUIRE( hull.affine_dimension == 0 );
123 GIVEN(
"Given a set { (0,0), (-4,-1), (8, 2), (16,4) } " ) {
127 bool ok = hull.compute( V );
128 std::cout << hull << std::endl;
129 THEN(
"Everything went fine and dim=1." ) {
131 REQUIRE( hull.affine_dimension == 1 );
135 GIVEN(
"Given a set { (0,0), (-4,-1), (-3,5), (7,3), (5, -2), (2, 2) } " ) {
137 = {
Point(0,0),
Point(-4,-1),
Point(-3,5),
Point(7,3),
Point(5, -2),
Point(2,2) };
139 bool ok = hull.compute( V );
140 std::cout << hull << std::endl;
141 THEN(
"Everything went fine and dim=2." ) {
143 REQUIRE( hull.affine_dimension == 2 );
144 REQUIRE( hull.count() > V.size() );
150SCENARIO(
"GenericLatticeConvexHull< ConvexHullIntegralKernel< 3 > > unit tests",
"[genquickhull][integral_kernel][3d]" )
154 typedef Space::Point
Point;
156 std::vector< Point > V1 = {
Point{ 5,-2, 1 } };
158 std::vector< Point > V2 = {
Point{ 5,-2, 1 },
Point{ -3, 4, 2 } };
160 std::vector< Point > V3 = {
Point{ 5,-2, 1 },
Point{ -3, 4, 2 },
Point{ 1, -7, 11 } };
163 GIVEN(
"Given a 1-d lattice set in Z3 " ) {
165 bool ok = hull.compute( X1 );
166 std::cout << hull << std::endl;
167 THEN(
"Everything went fine and dim=1." ) {
170 REQUIRE( hull.affine_dimension == 1 );
174 GIVEN(
"Given a 2-d lattice set in Z3 " ) {
176 bool ok = hull.compute( X2 );
177 std::cout << hull << std::endl;
178 THEN(
"Everything went fine and dim=2." ) {
180 REQUIRE( hull.affine_dimension == 2 );
184 GIVEN(
"Given a 3-d lattice set in Z3 " ) {
186 bool ok = hull.compute( X3 );
187 std::cout << hull << std::endl;
188 THEN(
"Everything went fine and dim=3." ) {
190 REQUIRE( hull.affine_dimension == 3 );