25 #include <boost/test/minimal.hpp>
26 #include <boost/shared_ptr.hpp>
27 #include <boost/timer.hpp>
40 cout <<
"####################" << endl;
41 cout <<
"# VORONOI DIAGRAMS #" << endl;
42 cout <<
"####################" << endl;
45 boost::shared_ptr<Polytope_Rn> inputSpace(
new Polytope_Rn());
46 inputSpace->createBoundingBox(10);
47 Point_Rn P1(2), P2(2), P3(2), P4(2), P5(2);
48 P1.setCoordinate(0,1);
49 P1.setCoordinate(1,1);
50 P2.setCoordinate(0,8);
51 P2.setCoordinate(1,4);
52 P3.setCoordinate(0,-7);
53 P3.setCoordinate(1,7);
54 P4.setCoordinate(0,-4);
55 P4.setCoordinate(1,-2);
58 std::vector<Point_Rn> listOfPoints;
59 listOfPoints.push_back(P1);listOfPoints.push_back(P2);listOfPoints.push_back(P3);listOfPoints.push_back(P4);listOfPoints.push_back(P5);
60 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells;
62 string vorPath = string(
"./test/VORONOI/2D/");
63 boost::shared_ptr<Polytope_Rn> Vor_Test(
new Polytope_Rn());
82 boost::shared_ptr<Polytope_Rn> inputSpaceAngers(
new Polytope_Rn());
83 inputSpaceAngers->createBoundingBox(0.5);
85 string vorPath3DAngers = string(
"./test/VORONOI/3D/Angers/");
87 boost::shared_ptr<Polytope_Rn> listOfPointsAsVDesc(
new Polytope_Rn());
89 std::vector<Point_Rn> listOfPoints3DAngers;
91 {
for (iteGN.begin(); iteGN.end()!=
true; iteGN.next()) {
92 listOfPoints3DAngers.push_back(
93 Point_Rn(iteGN.current()->getCoordinate(0), iteGN.current()->getCoordinate(1), iteGN.current()->getCoordinate(2)) );
96 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells_Angers0;
99 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells_Angers1;
102 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells_Angers2;
105 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells_Angers3;
108 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells_Angers4;
111 std::vector< boost::shared_ptr<Polytope_Rn> > allVoronoiCells_Angers5;
113 BOOST_CHECK( allVoronoiCells_Angers0.size() == allVoronoiCells_Angers1.size() );
114 BOOST_CHECK( allVoronoiCells_Angers1.size() == allVoronoiCells_Angers2.size() );
115 BOOST_CHECK( allVoronoiCells_Angers2.size() == allVoronoiCells_Angers3.size() );
116 BOOST_CHECK( allVoronoiCells_Angers3.size() == allVoronoiCells_Angers4.size() );
117 BOOST_CHECK( allVoronoiCells_Angers4.size() == allVoronoiCells_Angers5.size() );
118 for (
unsigned int cellCounter=0; cellCounter<allVoronoiCells_Angers0.size(); ++cellCounter)
120 for (
unsigned int cellCounter=0; cellCounter<allVoronoiCells_Angers1.size(); ++cellCounter)
122 for (
unsigned int cellCounter=0; cellCounter<allVoronoiCells_Angers2.size(); ++cellCounter)
124 for (
unsigned int cellCounter=0; cellCounter<allVoronoiCells_Angers3.size(); ++cellCounter)
126 for (
unsigned int cellCounter=0; cellCounter<allVoronoiCells_Angers4.size(); ++cellCounter)
128 std::cout <<
"allVoronoiCells_Angers0.size() = " << allVoronoiCells_Angers0.size() << std::endl;
129 std::cout <<
"allVoronoiCells_Angers1.size() = " << allVoronoiCells_Angers1.size() << std::endl;
130 std::cout <<
"allVoronoiCells_Angers2.size() = " << allVoronoiCells_Angers2.size() << std::endl;
131 std::cout <<
"allVoronoiCells_Angers3.size() = " << allVoronoiCells_Angers3.size() << std::endl;
132 std::cout <<
"allVoronoiCells_Angers4.size() = " << allVoronoiCells_Angers4.size() << std::endl;
133 std::cout <<
"allVoronoiCells_Angers5.size() = " << allVoronoiCells_Angers5.size() << std::endl;
139 cout <<
"////////////" << endl;
140 cout <<
"// DATA1 //" << endl;
141 cout <<
"//////////" << endl;
142 string path_test1(
"test/DATA1/");
143 boost::shared_ptr<Polytope_Rn> _polytopeTest(
new Polytope_Rn());
144 cout <<
"######################" << endl;
145 cout <<
"# DATA1: truncations #" << endl;
146 cout <<
"######################" << endl;
151 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 6 );
155 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 6 );
159 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 12 );
163 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 8 );
167 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 4 );
171 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 6 );
176 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 8 );
180 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 8 );
184 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 6 );
188 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 7 );
192 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 7 );
196 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 600 );
200 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 32 );
203 boost::shared_ptr<Polytope_Rn> _polytope2(
new Polytope_Rn());
224 cout <<
"########################" << endl;
225 cout <<
"# DATA1: intersections #" << endl;
226 cout <<
"########################" << endl;
233 BOOST_REQUIRE( _polytopeTest->numberOfGenerators() == 8 );
234 cout <<
"###############" << endl;
235 cout <<
"# DATA1: sums #" << endl;
236 cout <<
"###############" << endl;
239 boost::shared_ptr<Polytope_Rn> _sum;
246 BOOST_REQUIRE( _sum->numberOfGenerators() == 24 );
247 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 26 );
250 BOOST_REQUIRE( _sum->numberOfGenerators() == 24 );
251 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 26 );
273 BOOST_REQUIRE( _sum->numberOfGenerators() == 9 );
274 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 7 );
277 BOOST_REQUIRE( _sum->numberOfGenerators() == 9 );
278 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 7 );
285 BOOST_REQUIRE( _sum->numberOfGenerators() == 17 );
286 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 17 );
289 BOOST_REQUIRE( _sum->numberOfGenerators() == 17 );
290 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 17 );
299 BOOST_REQUIRE( _sum->numberOfGenerators() == 25 );
300 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 33 );
303 BOOST_REQUIRE( _sum->numberOfGenerators() == 25 );
304 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 33 );
312 BOOST_REQUIRE( _sum->numberOfGenerators() == 34 );
313 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 40 );
316 BOOST_REQUIRE( _sum->numberOfGenerators() == 34 );
317 BOOST_REQUIRE( _sum->numberOfHalfSpaces() == 40 );
323 boost::shared_ptr<Polytope_Rn> _pol2compare;
330 std::cout <<
"* Extrusions *" << std::endl;
331 boost::shared_ptr<Polytope_Rn> polytope2extrude(
new Polytope_Rn());
334 std::set< unsigned int > originalSpaceDirections;
335 originalSpaceDirections.insert(1);originalSpaceDirections.insert(2);originalSpaceDirections.insert(6);
340 for (iteHS1.begin(),iteHS2.begin(); iteHS1.end()!=
true&&iteHS2.end()!=
true; iteHS1.next(),iteHS2.next()) {
341 for (
unsigned int i=0; i<6; ++i)
342 BOOST_REQUIRE( iteHS1.current()->getCoefficient(i) == iteHS2.current()->getCoefficient(i) );
348 originalSpaceDirections.clear();
349 originalSpaceDirections.insert(1);originalSpaceDirections.insert(2);
355 for (iteHS1_2D.begin(),iteHS2_2D.begin(); iteHS1_2D.end()!=
true&&iteHS2_2D.end()!=
true; iteHS1_2D.next(),iteHS2_2D.next()) {
356 for (
unsigned int i=0; i<6; ++i)
357 BOOST_REQUIRE( iteHS1_2D.current()->getCoefficient(i) == iteHS2_2D.current()->getCoefficient(i) );
359 std::cout <<
"* Box *" << std::endl;
361 Point_Rn Pmin(1., 2., 3.), Pmax(4., 5., 6.);
364 box3D->dump(std::cout);
367 std::cout <<
"* Scaling factor *" << std::endl;
369 box3D->checkTopologyAndGeometry();
375 box3D->checkTopologyAndGeometry();
382 cout <<
"/////////////" << endl;
383 cout <<
"// DATA 2 //" << endl;
384 cout <<
"///////////" << endl;
387 path_test1 = string(
"test/DATA2/");
406 std::vector< boost::shared_ptr<Polytope_Rn> > arrayOfPolytopes;
407 arrayOfPolytopes.resize(7);
408 path_test1 = string(
"test/DATA2/T1/");
409 string path_test2(
"test/DATA2/T2/");
410 string path_test3(
"test/DATA2/T3/");
411 string path_test4(
"test/DATA2/T4/");
412 string path_test5(
"test/DATA2/T5/");
413 std::vector< string > Ppath1;
414 std::vector< string > Ppath2;
415 std::vector< string > Ppath3;
416 std::vector< string > Ppath4;
417 std::vector< string > Ppath5;
419 Ppath1.push_back(
string(
"outputcthp_0_1-ctl_848_0.ptop") );
420 Ppath1.push_back(
string(
"outputcthp_10_0-ctl_524_1.ptop") );
421 Ppath1.push_back(
string(
"outputcthp_102_1-ctl_221_0.ptop") );
422 Ppath1.push_back(
string(
"outputcthp_103_0-ctl_122_2.ptop") );
423 Ppath1.push_back(
string(
"outputcthp_107_3-ctl_145_1.ptop") );
424 Ppath1.push_back(
string(
"outputcthp_109_2-ctl_452_2.ptop") );
425 Ppath1.push_back(
string(
"outputcthp_113_0-ctl_989_2.ptop") );
426 Ppath2.push_back(
string(
"outputcthp_0_2-ctl_82_2.ptop") );
427 Ppath2.push_back(
string(
"outputcthp_10_3-ctl_99_3.ptop") );
428 Ppath2.push_back(
string(
"outputcthp_100_0-ctl_914_1.ptop") );
429 Ppath2.push_back(
string(
"outputcthp_104_2-ctl_857_3.ptop") );
430 Ppath2.push_back(
string(
"outputcthp_108_3-ctl_196_1.ptop") );
431 Ppath2.push_back(
string(
"outputcthp_109_2-ctl_452_2.ptop") );
432 Ppath2.push_back(
string(
"outputcthp_110_1-ctl_697_0.ptop") );
433 Ppath3.push_back(
string(
"outputcthp_111_1-ctl_111_1.ptop") );
434 Ppath3.push_back(
string(
"outputcthp_162_0-ctl_42_1.ptop") );
435 Ppath3.push_back(
string(
"outputcthp_366_1-ctl_201_0.ptop") );
436 Ppath3.push_back(
string(
"outputcthp_57_3-ctl_330_2.ptop") );
437 Ppath3.push_back(
string(
"outputcthp_586_0-ctl_932_2.ptop") );
438 Ppath3.push_back(
string(
"outputcthp_741_3-ctl_568_0.ptop") );
439 Ppath3.push_back(
string(
"outputcthp_915_3-ctl_803_1.ptop") );
440 Ppath4.push_back(
string(
"outputcthp_177_1-ctl_83_2.ptop") );
441 Ppath4.push_back(
string(
"outputcthp_231_1-ctl_830_2.ptop") );
442 Ppath4.push_back(
string(
"outputcthp_361_1-ctl_578_2.ptop") );
443 Ppath4.push_back(
string(
"outputcthp_44_1-ctl_51_2.ptop") );
444 Ppath4.push_back(
string(
"outputcthp_482_2-ctl_880_0.ptop") );
445 Ppath4.push_back(
string(
"outputcthp_712_1-ctl_693_1.ptop") );
446 Ppath4.push_back(
string(
"outputcthp_899_3-ctl_233_3.ptop") );
447 Ppath5.push_back(
string(
"outputcthp_0_2-ctl_82_2.ptop") );
448 Ppath5.push_back(
string(
"outputcthp_10_0-ctl_524_1.ptop") );
449 Ppath5.push_back(
string(
"outputcthp_101_0-ctl_74_0.ptop") );
450 Ppath5.push_back(
string(
"outputcthp_104_1-ctl_357_2.ptop") );
451 Ppath5.push_back(
string(
"outputcthp_107_2-ctl_186_0.ptop") );
452 Ppath5.push_back(
string(
"outputcthp_112_2-ctl_527_3.ptop") );
453 Ppath5.push_back(
string(
"outputcthp_113_2-ctl_424_1.ptop") );
455 {
for (
unsigned int i=0; i<7; ++i) {
457 boost::shared_ptr<Polytope_Rn> T1(
new Polytope_Rn());
458 boost::shared_ptr<Polytope_Rn> T2(
new Polytope_Rn());
459 boost::shared_ptr<Polytope_Rn> T3(
new Polytope_Rn());
460 boost::shared_ptr<Polytope_Rn> T4(
new Polytope_Rn());
461 boost::shared_ptr<Polytope_Rn> T5(
new Polytope_Rn());
467 cout <<
"##################" << endl;
468 cout <<
"# DATA 2: sums ";
469 cout << i+1 <<
" #" << endl;
470 cout <<
"##################" << endl;
471 boost::shared_ptr<Polytope_Rn> T12(
new Polytope_Rn());
472 boost::shared_ptr<Polytope_Rn> T123(
new Polytope_Rn());
473 boost::shared_ptr<Polytope_Rn> T1234(
new Polytope_Rn());
474 boost::shared_ptr<Polytope_Rn> T12345(
new Polytope_Rn());
479 boost::shared_ptr<Polytope_Rn> T54(
new Polytope_Rn());
480 boost::shared_ptr<Polytope_Rn> T543(
new Polytope_Rn());
481 boost::shared_ptr<Polytope_Rn> T5432(
new Polytope_Rn());
482 boost::shared_ptr<Polytope_Rn> T54321(
new Polytope_Rn());
488 arrayOfPolytopes[i] = T12345;
494 cout <<
"////////////////" << endl;
495 cout <<
"// SSS DISC1 //" << endl;
496 cout <<
"//////////////" << endl;
497 path_test1 = string(
"test/TM/Sss1_disc6/");
498 arrayOfPolytopes.clear();
499 arrayOfPolytopes.resize(12);
500 cout <<
"##########################" << endl;
501 cout <<
"# SSS DISC1: truncations #" << endl;
502 cout <<
"##########################" << endl;
503 {
for (
unsigned int i=0; i<12; ++i) {
506 string p_name = string(
"Polytope_") + ss.str() + string(
".ptop");
511 cout <<
"############################" << endl;
512 cout <<
"# SSS DISC1: intersections #" << endl;
513 cout <<
"############################" << endl;
514 {
for (
unsigned int i=1; i<5 ; ++i) {
517 {
for (
unsigned int i=6; i<10; ++i) {
520 cout <<
"# intersections 11 & 12 #" << endl;
523 cout <<
"###################" << endl;
524 cout <<
"# SSS DISC1: sums #" << endl;
525 cout <<
"###################" << endl;
526 boost::shared_ptr<Polytope_Rn> C05(
new Polytope_Rn());
527 boost::shared_ptr<Polytope_Rn> C50(
new Polytope_Rn());
536 cout <<
"//////////////////" << endl;
537 cout <<
"// BBB_D_5.966 //" << endl;
538 cout <<
"////////////////" << endl;
539 path_test2 = string(
"test/TM/Interference_Bbb/BBB_D_5.966/");
540 arrayOfPolytopes.clear();
541 arrayOfPolytopes.resize(13);
542 {
for (
unsigned int i=1; i<=13; ++i) {
543 cout <<
"############################" << endl;
544 cout <<
"# BBB_D_5.966: truncations #" << endl;
545 cout <<
"############################" << endl;
548 std::vector< boost::shared_ptr<Polytope_Rn> > tmpArrayOfPtop(5);
549 {
for (
unsigned int j=1; j<=5; ++j) {
552 string p_name = string(
"ctl_") + ss1.str();
553 p_name += string(
"_") + ss2.str() + string(
".ptop");
558 cout <<
"##############################" << endl;
559 cout <<
"# BBB_D_5.966: intersections #" << endl;
560 cout <<
"##############################" << endl;
561 {
for (
unsigned int j=1; j<=4; ++j) {
564 arrayOfPolytopes.push_back( tmpArrayOfPtop[0] );
566 checkPtop += path_test2 + string(
"qhull_ctl_");
567 checkPtop += ss1.str() + string(
"_x.ptop");
568 boost::shared_ptr<Polytope_Rn> CP(
new Polytope_Rn());
575 cout <<
"//////////////////" << endl;
576 cout <<
"// BBB_D_5.976 //" << endl;
577 cout <<
"////////////////" << endl;
578 path_test2 = string(
"test/TM/Interference_Bbb/BBB_D_5.976/");
579 arrayOfPolytopes.clear();
580 arrayOfPolytopes.resize(13);
581 {
for (
unsigned int i=1; i<=13; ++i) {
582 cout <<
"############################" << endl;
583 cout <<
"# BBB_D_5.976: truncations #" << endl;
584 cout <<
"############################" << endl;
587 std::vector< boost::shared_ptr<Polytope_Rn> > tmpArrayOfPtop(5);
588 {
for (
unsigned int j=1; j<=5; ++j) {
591 string p_name = string(
"ctl_") + ss1.str();
592 p_name += string(
"_") + ss2.str() + string(
".ptop");
597 cout <<
"##############################" << endl;
598 cout <<
"# BBB_D_5.976: intersections #" << endl;
599 cout <<
"##############################" << endl;
600 {
for (
unsigned int j=1; j<=4; ++j) {
603 arrayOfPolytopes.push_back( tmpArrayOfPtop[0] );
606 checkPtop += path_test2 + string(
"qhull_ctl_");
607 checkPtop += ss1.str() + string(
"_x.ptop");
608 boost::shared_ptr<Polytope_Rn> CP(
new Polytope_Rn());
616 cout <<
"/////////////////////" << endl;
617 cout <<
"// DTL_BPTL/D3-R6 //" << endl;
618 cout <<
"///////////////////" << endl;
619 path_test3 = string(
"test/TM/Interference_Bbb/DTL_BPTL/D3-R6/");
620 arrayOfPolytopes.resize(4);
623 cout <<
"###############################" << endl;
624 cout <<
"# DTL_BPTL/D3-R6: truncations #" << endl;
625 cout <<
"###############################" << endl;
634 boost::shared_ptr<Polytope_Rn> BPHP_BPTL_v(
new Polytope_Rn());
635 boost::shared_ptr<Polytope_Rn> SPAR_BPHP_v(
new Polytope_Rn());
636 boost::shared_ptr<Polytope_Rn> CCCTL_CCCTHP_SPAR_v(
new Polytope_Rn());
637 boost::shared_ptr<Polytope_Rn> DTL2_CCCTL_v(
new Polytope_Rn());
646 cout <<
"#####################################" << endl;
647 cout <<
"# DTL_BPTL/D3-R6: polar truncations #" << endl;
648 cout <<
"#####################################" << endl;
653 {
for (
unsigned int i=0; i<4; ++i) {
654 boost::shared_ptr<Polytope_Rn> thisVPol(
new Polytope_Rn());
657 {
for (iteGN1.
begin(); iteGN1.
end()!=
true; iteGN1.
next()) {
658 thisVPol->addGenerator(iteGN1.
current());
661 arrayOfPolytopes[i] = thisVPol;
667 cout <<
"########################" << endl;
668 cout <<
"# DTL_BPTL/D3-R6: sums #" << endl;
669 cout <<
"########################" << endl;
670 boost::shared_ptr<Polytope_Rn> BPTL_SPAR12(
new Polytope_Rn());
671 boost::shared_ptr<Polytope_Rn> BPTL_SPAR21(
new Polytope_Rn());
672 boost::shared_ptr<Polytope_Rn> BPTL_CCCTL12(
new Polytope_Rn());
673 boost::shared_ptr<Polytope_Rn> BPTL_CCCTL21(
new Polytope_Rn());
674 boost::shared_ptr<Polytope_Rn> BPTL_DTL212(
new Polytope_Rn());
675 boost::shared_ptr<Polytope_Rn> BPTL_DTL221(
new Polytope_Rn());
682 boost::shared_ptr<Polytope_Rn> sumOfArray(
new Polytope_Rn());
685 boost::shared_ptr<Polytope_Rn> qhl_BPTL_SPAR12(
new Polytope_Rn());
686 boost::shared_ptr<Polytope_Rn> qhl_BPTL_CCCTL21(
new Polytope_Rn());
687 boost::shared_ptr<Polytope_Rn> qhl_BPTL_DTL221(
new Polytope_Rn());
707 cout <<
"//////////////////" << endl;
708 cout <<
"// SPECTOMETER //" << endl;
709 cout <<
"////////////////" << endl;
710 cout <<
"#########" << endl;
711 cout <<
"# SUM 1 #" << endl;
712 cout <<
"#########" << endl;
713 string SPEC_path_test = string(
"test/SPECTRO/");
716 boost::shared_ptr<Polytope_Rn> SPEC_sum12(
new Polytope_Rn());
717 boost::shared_ptr<Polytope_Rn> SPEC_sum21(
new Polytope_Rn());
718 boost::shared_ptr<Polytope_Rn> SPEC_polytope1(
new Polytope_Rn());
719 boost::shared_ptr<Polytope_Rn> SPEC_polytope2(
new Polytope_Rn());
720 boost::shared_ptr<Polytope_Rn> SPEC_polytope2test(
new Polytope_Rn());
730 cout <<
"//////////////////////" << endl;
731 cout <<
"// COMPUTE VOLUMES //" << endl;
732 cout <<
"////////////////////" << endl;
733 string Pvol_path_test = string(
"test/VOL/");
736 boost::shared_ptr<Polytope_Rn> Pvol1(
new Polytope_Rn());
737 boost::shared_ptr<Polytope_Rn> Pvol2(
new Polytope_Rn());
738 boost::shared_ptr<Polytope_Rn> Pvol3(
new Polytope_Rn());
739 boost::shared_ptr<Polytope_Rn> Pvol4(
new Polytope_Rn());
740 boost::shared_ptr<Polytope_Rn> Pvol5(
new Polytope_Rn());
741 boost::shared_ptr<Polytope_Rn> Pvol6(
new Polytope_Rn());
742 boost::shared_ptr<Polytope_Rn> Pvol7(
new Polytope_Rn());
743 boost::shared_ptr<Polytope_Rn> Pvol8(
new Polytope_Rn());
744 boost::shared_ptr<Polytope_Rn> Pvol9(
new Polytope_Rn());
745 boost::shared_ptr<Polytope_Rn> Pvol10(
new Polytope_Rn());
746 boost::shared_ptr<Polytope_Rn> Pvol11(
new Polytope_Rn());
747 boost::shared_ptr<Polytope_Rn> Pvol_cube3d(
new Polytope_Rn());
748 boost::shared_ptr<Polytope_Rn> Pvol_cube4d(
new Polytope_Rn());
749 boost::shared_ptr<Polytope_Rn> Pvol_cube5d(
new Polytope_Rn());
750 boost::shared_ptr<Polytope_Rn> Pvol_cube6d(
new Polytope_Rn());
777 BOOST_REQUIRE(6.65110e-07 < volume1 && volume1 < 6.65112e-07);
778 BOOST_REQUIRE(6.07855e-07 < volume2 && volume2 < 6.07857e-07);
779 BOOST_REQUIRE(1.81130e-06 < volume3 && volume3 < 1.81132e-06);
780 BOOST_REQUIRE(7.37121e-07 < volume4 && volume4 < 7.37123e-07);
781 BOOST_REQUIRE(5.73780e-07 < volume5 && volume5 < 5.73782e-07);
782 BOOST_REQUIRE(3.08791e-06 < volume6 && volume6 < 3.08793e-06);
783 BOOST_REQUIRE(1.11362e-06 < volume7 && volume7 < 1.11364e-06);
784 BOOST_REQUIRE(1.54424e-06 < volume8 && volume8 < 1.54426e-06);
785 BOOST_REQUIRE(1.24113e-05 < volume9 && volume9 < 1.24116e-05);
786 BOOST_REQUIRE(3.21623e-06 < volume10 && volume10 < 3.21625e-06);
787 BOOST_REQUIRE(2.55674e-05 < volume11 && volume11 < 2.55676e-05);
795 BOOST_REQUIRE(volumeC1 == 1000);
796 BOOST_REQUIRE(volumeC2 == 10000);
797 BOOST_REQUIRE(volumeC3 == 100000);
798 BOOST_REQUIRE(volumeC4 == 1000000);
800 boost::shared_ptr<Polytope_Rn> Pvol_A1(
new Polytope_Rn());
801 boost::shared_ptr<Polytope_Rn> Pvol_A2(
new Polytope_Rn());
802 boost::shared_ptr<Polytope_Rn> Pvol_A3(
new Polytope_Rn());
803 boost::shared_ptr<Polytope_Rn> Pvol_A4(
new Polytope_Rn());
814 BOOST_REQUIRE(0.124 < volumeA1 && volumeA1 < 0.126);
815 BOOST_REQUIRE(0.0114730 < volumeA2 && volumeA2 < 0.0114733);
816 BOOST_REQUIRE(0.015947725 < volumeA3 && volumeA3 < 0.015947727);
817 BOOST_REQUIRE(38.8410 < volumeA4 && volumeA4 < 38.8412);
820 cout <<
"/////////////////" << endl;
821 cout <<
"// TEST CUBES //" << endl;
822 cout <<
"///////////////" << endl;
825 boost::shared_ptr<Polytope_Rn> cube_0, cube_1, cube_2;
826 boost::shared_ptr<Polytope_Rn> res_cube_a(
new Polytope_Rn());
827 boost::shared_ptr<Polytope_Rn> res_cube_b(
new Polytope_Rn());
831 cube_0->checkTopologyAndGeometry();
832 cube_1->checkTopologyAndGeometry();
834 res_cube_a->checkTopologyAndGeometry();
838 cout <<
"/////////////////////////////" << endl;
839 cout <<
"// REMOVE CAP HALF-SPACES //" << endl;
840 cout <<
"///////////////////////////" << endl;
843 string ppiston = string(
"test/CAPS/PISTON/5D/");
845 boost::shared_ptr<Polytope_Rn> P1_5D(
new Polytope_Rn());
846 boost::shared_ptr<Polytope_Rn> P2_5D(
new Polytope_Rn());
847 boost::shared_ptr<Polytope_Rn> P3_5D(
new Polytope_Rn());
848 boost::shared_ptr<Polytope_Rn> P4_5D(
new Polytope_Rn());
857 boost::shared_ptr<Polytope_Rn> ps_P12_5D_S1(
new Polytope_Rn());
858 boost::shared_ptr<Polytope_Rn> ps_P12_5D_S2(
new Polytope_Rn());
859 boost::shared_ptr<Polytope_Rn> ps_P123_5D_S1(
new Polytope_Rn());
860 boost::shared_ptr<Polytope_Rn> ps_P123_5D_S2(
new Polytope_Rn());
861 boost::shared_ptr<Polytope_Rn> ps_P1234_5D_S1(
new Polytope_Rn());
862 boost::shared_ptr<Polytope_Rn> ps_P1234_5D_S2(
new Polytope_Rn());
863 std::set< unsigned int > P1Caps, P2Caps, P3Caps, P4Caps;
864 std::set< unsigned int > Sum12Caps, Sum123Caps, Sum1234Caps;
865 {
for (
unsigned int i=0; i<2; ++i) {
870 {
for (
unsigned int i=0; i<4; ++i) {
873 cout <<
"############################" << endl;
874 cout <<
"# pseudosum: P1 + P2 = P12 #" << endl;
875 cout <<
"############################" << endl;
879 cout <<
"##############################" << endl;
880 cout <<
"# pseudosum: P12 + P3 = P123 #" << endl;
881 cout <<
"##############################" << endl;
885 cout <<
"################################" << endl;
886 cout <<
"# pseudosum: P123 + P4 = P1234 #" << endl;
887 cout <<
"################################" << endl;
892 boost::shared_ptr<Polytope_Rn> polP12_5D(
new Polytope_Rn());
893 boost::shared_ptr<Polytope_Rn> shgP12_5D(
new Polytope_Rn());
894 boost::shared_ptr<Polytope_Rn> polP123_5D(
new Polytope_Rn());
895 boost::shared_ptr<Polytope_Rn> shgP123_5D(
new Polytope_Rn());
896 boost::shared_ptr<Polytope_Rn> polP1234_5D(
new Polytope_Rn());
897 boost::shared_ptr<Polytope_Rn> shgP1234_5D(
new Polytope_Rn());
898 cout <<
"############################" << endl;
899 cout <<
"# with caps: P1 + P2 = P12 #" << endl;
900 cout <<
"############################" << endl;
904 cout <<
"##############################" << endl;
905 cout <<
"# with caps: P12 + P3 = P123 #" << endl;
906 cout <<
"##############################" << endl;
910 cout <<
"################################" << endl;
911 cout <<
"# with caps: P123 + P4 = P1234 #" << endl;
912 cout <<
"################################" << endl;
917 std::set< unsigned int > hyperplanes2project2D;
918 hyperplanes2project2D.insert(3);
919 hyperplanes2project2D.insert(4);
920 boost::shared_ptr<Polytope_Rn> proj_polP1234_5D(
new Polytope_Rn());
921 boost::shared_ptr<Polytope_Rn> proj_ps_P1234_5D_S1(
new Polytope_Rn());
926 boost::shared_ptr<Polytope_Rn> finalP2D(
new Polytope_Rn());
930 string path_test_caps = string(
"test/CAPS/");
931 {
for (
int i=1; i<argc; ++i) {
932 if (strcmp(argv[i],
"piston") == 0) {
935 cout <<
"##########" << endl;
936 cout <<
"# Piston #" << endl;
937 cout <<
"##########" << endl;
938 string path_test_caps_piston = path_test_caps+string(
"PISTON/");
939 boost::shared_ptr<Polytope_Rn> pist1_TestCaps(
new Polytope_Rn());
940 boost::shared_ptr<Polytope_Rn> pist2_TestCaps(
new Polytope_Rn());
941 boost::shared_ptr<Polytope_Rn> pist_Sum_TestCaps(
new Polytope_Rn());
942 boost::shared_ptr<Polytope_Rn> pist_Sum_TestCaps_check(
new Polytope_Rn());
945 std::set< unsigned int > PO1Caps, PO2Caps, PSum_1Caps_;
946 PO1Caps.insert(0); PO1Caps.insert(1); PO1Caps.insert(2); PO1Caps.insert(3);
947 PO2Caps.insert(0); PO2Caps.insert(1); PO2Caps.insert(2); PO2Caps.insert(3);
955 cout <<
"#########" << endl;
956 cout <<
"# R3 Ex #" << endl;
957 cout <<
"#########" << endl;
958 boost::shared_ptr<Polytope_Rn> p1_TestCaps(
new Polytope_Rn());
959 boost::shared_ptr<Polytope_Rn> p2_TestCaps(
new Polytope_Rn());
960 boost::shared_ptr<Polytope_Rn> Sum_TestCaps(
new Polytope_Rn());
961 boost::shared_ptr<Polytope_Rn> Sum_TestCaps_check(
new Polytope_Rn());
964 std::set< unsigned int > O1Caps, O2Caps, Sum_1Caps_;
965 O1Caps.insert(0); O1Caps.insert(1); O1Caps.insert(3); O1Caps.insert(4);
970 cout <<
"###########" << endl;
971 cout <<
"# CIRP R6 #" << endl;
972 cout <<
"###########" << endl;
975 boost::shared_ptr<Polytope_Rn> p1_TestCaps_b(
new Polytope_Rn());
976 boost::shared_ptr<Polytope_Rn> p2_TestCaps_b(
new Polytope_Rn());
977 boost::shared_ptr<Polytope_Rn> Sum_TestCaps_b(
new Polytope_Rn());
978 boost::shared_ptr<Polytope_Rn> Sum_TestCaps_check_b(
new Polytope_Rn());
981 std::set< unsigned int > O1Caps_b, O2Caps_b, Sum_1Caps_b;
982 O1Caps_b.insert(0); O1Caps_b.insert(1); O1Caps_b.insert(2); O1Caps_b.insert(3); O1Caps_b.insert(4); O1Caps_b.insert(5);
983 O2Caps_b.insert(0); O2Caps_b.insert(1); O2Caps_b.insert(2); O2Caps_b.insert(3); O2Caps_b.insert(4); O2Caps_b.insert(5);
988 cout <<
"############" << endl;
989 cout <<
"# SPEC CAP #" << endl;
990 cout <<
"############" << endl;
993 string path_test_caps2 = string(
"test/CAPS/spec_small_disc/");
994 boost::shared_ptr<Polytope_Rn> Pc_21(
new Polytope_Rn());
995 boost::shared_ptr<Polytope_Rn> Pc_22(
new Polytope_Rn());
996 boost::shared_ptr<Polytope_Rn> Pc_23(
new Polytope_Rn());
997 boost::shared_ptr<Polytope_Rn> Pc_24(
new Polytope_Rn());
998 boost::shared_ptr<Polytope_Rn> Pc_25(
new Polytope_Rn());
999 boost::shared_ptr<Polytope_Rn> Pc_26(
new Polytope_Rn());
1000 boost::shared_ptr<Polytope_Rn> Pg_37(
new Polytope_Rn());
1001 boost::shared_ptr<Polytope_Rn> Pg_38(
new Polytope_Rn());
1002 boost::shared_ptr<Polytope_Rn> Pg_14(
new Polytope_Rn());
1003 cout <<
"#########################" << endl;
1004 cout <<
"# SPEC CAP: truncations #" << endl;
1005 cout <<
"#########################" << endl;
1024 std::set< unsigned int > Int_1Caps, Int_2Caps, Sum_1Caps, Sum_1_s2Caps, P_11_20_FC1Caps, P_20_30_FC1Caps;
1025 std::set< unsigned int > Pc_21Caps, Pc_22Caps, Pc_23Caps, Pc_24Caps, Pc_25Caps, Pc_26Caps, Pg_37Caps;
1026 {
for (
unsigned int i=0; i<8; ++i) {
1027 Pc_21Caps.insert(i);Pc_22Caps.insert(i);
1029 {
for (
unsigned int i=0; i<6; ++i) {
1030 Pc_23Caps.insert(i);Pc_24Caps.insert(i);
1032 {
for (
unsigned int i=0; i<4; ++i) {
1033 Pg_37Caps.insert(i);
1035 Pc_25Caps.insert(0);Pc_26Caps.insert(0);Pc_25Caps.insert(1);Pc_26Caps.insert(1);Pc_25Caps.insert(6);Pc_26Caps.insert(6);Pc_25Caps.insert(7);Pc_26Caps.insert(7);
1037 cout <<
"######################" << endl;
1038 cout <<
"# Operations for FC1 #" << endl;
1039 cout <<
"######################" << endl;
1040 boost::shared_ptr<Polytope_Rn> Int_1, Int_2, P_11_20_FC1, P_20_30_FC1;
1041 boost::shared_ptr<Polytope_Rn> Sum_1(
new Polytope_Rn()); boost::shared_ptr<Polytope_Rn> Sum_1_s2(
new Polytope_Rn());
1052 cout <<
"#########################################" << endl;
1053 cout <<
"# Polytope from node 1.0 to 3.0 for FC1 #" << endl;
1054 cout <<
"#########################################" << endl;
1055 boost::shared_ptr<Polytope_Rn> P_11_30_FC1_s1(
new Polytope_Rn()); boost::shared_ptr<Polytope_Rn> P_11_30_FC1_s2(
new Polytope_Rn());
1056 std::set< unsigned int > P_11_30_FC1_s2Caps, P_11_30_FC1_s1Caps;
1057 BOOST_REQUIRE(
politopixAPI::pseudoSum(P_20_30_FC1, P_11_20_FC1, P_11_30_FC1_s2, P_20_30_FC1Caps, P_11_20_FC1Caps, P_11_30_FC1_s2Caps) ==
TEST_OK );
1058 BOOST_REQUIRE(
politopixAPI::pseudoSum(P_11_20_FC1, P_20_30_FC1, P_11_30_FC1_s1, P_11_20_FC1Caps, P_20_30_FC1Caps, P_11_30_FC1_s1Caps) ==
TEST_OK );
1061 cout <<
"#####################" << endl;
1062 cout <<
"# Final sum for FC1 #" << endl;
1063 cout <<
"#####################" << endl;
1064 boost::shared_ptr<Polytope_Rn> Pfin_FC1_s1(
new Polytope_Rn()); boost::shared_ptr<Polytope_Rn> Pfin_FC1_s2(
new Polytope_Rn());
1065 std::set< unsigned int > Pfin_FC1_s1Caps, Pfin_FC1_s2Caps;
1070 boost::shared_ptr<Polytope_Rn> final_sant(
new Polytope_Rn());
1077 cout <<
"#############################" << endl;
1078 cout <<
"# Simulation cutting system #" << endl;
1079 cout <<
"#############################" << endl;
1082 string path_test_cutting = string(
"test/AFILADO/");
1083 boost::shared_ptr<Polytope_Rn> P11(
new Polytope_Rn());
1084 boost::shared_ptr<Polytope_Rn> P33_43(
new Polytope_Rn());
1085 boost::shared_ptr<Polytope_Rn> P34_44(
new Polytope_Rn());
1086 boost::shared_ptr<Polytope_Rn> P41(
new Polytope_Rn());
1087 cout <<
"########################" << endl;
1088 cout <<
"# CUTTING: truncations #" << endl;
1089 cout <<
"########################" << endl;
1098 boost::shared_ptr<Polytope_Rn> P30_40(
new Polytope_Rn());
1099 boost::shared_ptr<Polytope_Rn> P11_41S2(
new Polytope_Rn());
1100 boost::shared_ptr<Polytope_Rn> P11_41S1(
new Polytope_Rn());
1101 boost::shared_ptr<Polytope_Rn> PfinS1(
new Polytope_Rn());
1102 boost::shared_ptr<Polytope_Rn> PfinS2(
new Polytope_Rn());
1103 boost::shared_ptr<Polytope_Rn> PfinS3(
new Polytope_Rn());
1104 std::set< unsigned int > P11Caps, P33_43Caps, P34_44Caps, P41Caps;
1105 std::set< unsigned int > P30_40Caps, P11_41Caps, PfinCaps;
1106 {
for (
unsigned int i=0; i<10; ++i) {
1107 P34_44Caps.insert(i);
1109 {
for (
unsigned int i=0; i<4; ++i) {
1112 P33_43Caps.insert(i);
1115 cout <<
"##############" << endl;
1116 cout <<
"# Operations #" << endl;
1117 cout <<
"##############" << endl;
1122 cout <<
"#############" << endl;
1123 cout <<
"# Final sum #" << endl;
1124 cout <<
"#############" << endl;
1132 cout <<
"###################" << endl;
1133 cout <<
"# DATA1: Lattices #" << endl;
1134 cout <<
"###################" << endl;
1136 path_test1 = string(
"./test/DATA1/");
1144 std::vector< std::vector< ListOfFaces > > Lattice2Compare;
1155 Lattice2Compare.clear();
1167 Lattice2Compare.clear();
1179 Lattice2Compare.clear();
1191 Lattice2Compare.clear();
1196 cout <<
"###############" << endl;
1197 cout <<
"# PROJECTIONS #" << endl;
1198 cout <<
"###############" << endl;
1202 {
for (
unsigned int i=0; i<6; ++i) {
1203 H1->setCoefficient(i,0);
1204 H2->setCoefficient(i,0);
1205 H3->setCoefficient(i,0);
1207 H1->setCoefficient(0,1);
1208 H2->setCoefficient(1,1);
1209 H3->setCoefficient(2,1);
1213 std::vector< boost::shared_ptr<HalfSpace_Rn> > arrayOfHS;
1214 arrayOfHS.push_back(H1);
1215 arrayOfHS.push_back(H2);
1216 arrayOfHS.push_back(H3);
1221 string pcaps = string(
"test/PROJ/");
1226 std::set< unsigned int > hyperplanes2project;
1227 hyperplanes2project.insert(1);hyperplanes2project.insert(2);hyperplanes2project.insert(3);
1242 hyperplanes2project.clear();
1243 hyperplanes2project.insert(1);hyperplanes2project.insert(2);hyperplanes2project.insert(3);
1258 hyperplanes2project.clear();
1259 hyperplanes2project.insert(1);hyperplanes2project.insert(2);hyperplanes2project.insert(3);
1274 hyperplanes2project.clear();
1275 hyperplanes2project.insert(1);hyperplanes2project.insert(2);hyperplanes2project.insert(3);
1290 hyperplanes2project.clear();
1291 hyperplanes2project.insert(1);hyperplanes2project.insert(2);hyperplanes2project.insert(3);
1309 hyperplanes2project.clear();
1310 hyperplanes2project.insert(1);hyperplanes2project.insert(2);hyperplanes2project.insert(3);
1322 cout <<
"#####################" << endl;
1323 cout <<
"# TRACING GENERATORS #" << endl;
1324 cout <<
"#####################" << endl;
1327 string tal_path(
"test/TALADRO/");
1333 std::vector< std::vector<int> > genitorsOfTal_CP1(Tal_CP1->numberOfGenerators());
1334 std::vector< std::vector<int> > genitorsOfTal_CP2(Tal_CP2->numberOfGenerators());
1335 std::vector< std::vector<int> > genitorsOfTal_CP3(Tal_CP3->numberOfGenerators());
1336 std::vector< std::vector<int> > genitorsOfTal_CP_1_2,genitorsOfTal_CP_1_2_3;
1338 for (
unsigned int i=0; i<genitorsOfTal_CP1.size(); ++i)
1339 genitorsOfTal_CP1[i].push_back(i);
1340 for (
unsigned int j=0; j<genitorsOfTal_CP2.size(); ++j)
1341 genitorsOfTal_CP2[j].push_back(j);
1342 for (
unsigned int j=0; j<genitorsOfTal_CP3.size(); ++j)
1343 genitorsOfTal_CP3[j].push_back(j);
1352 for (
unsigned int i=0; i<genitorsOfTal_CP_1_2.size(); ++i) {
1353 boost::shared_ptr<Generator_Rn> VX(
new Generator_Rn(thisDim));
1354 VX->makeSum(Tal_CP1->getGenerator(genitorsOfTal_CP_1_2[i][0]), Tal_CP2->getGenerator(genitorsOfTal_CP_1_2[i][1]));
1355 BOOST_REQUIRE( VX->isEqual2(Tal_SUM12->getGenerator(i), thisDim, tol_2) ==
true );
1357 for (
unsigned int i=0; i<genitorsOfTal_CP_1_2_3.size(); ++i) {
1359 VX_1_2->makeSum(Tal_CP1->getGenerator(genitorsOfTal_CP_1_2_3[i][0]), Tal_CP2->getGenerator(genitorsOfTal_CP_1_2_3[i][1]));
1360 VX->makeSum(VX_1_2, Tal_CP3->getGenerator(genitorsOfTal_CP_1_2_3[i][2]));
1361 BOOST_REQUIRE( VX->isEqual2(Tal_SUM123->getGenerator(i), thisDim, tol_2) ==
true );
static polito_EXPORT int makeBox(boost::shared_ptr< Polytope_Rn > &A, Point_Rn Pmin, Point_Rn Pmax)
Create a box or rectangle parallelepiped whose corners are Pmin and Pmax.
static polito_EXPORT int savePolytope(const string &pathA, boost::shared_ptr< Polytope_Rn > &A)
Save a polytope in the corresponding file name.
Creation of a n-coordinate geometric point designed to be shared by its neighbour faces...
static polito_EXPORT int computeIntersection(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, boost::shared_ptr< Polytope_Rn > &C)
Compute the intersection between two HV-polytopes with the Double Description algorithm.
static polito_EXPORT void setDimension(unsigned int dim)
Set the dimension for the cartesian space we work in.
static polito_EXPORT int computeVoronoiDiagram(const boost::shared_ptr< Polytope_Rn > &inputSpace, const std::vector< Point_Rn > &listOfSeeds, std::vector< boost::shared_ptr< Polytope_Rn > > &VoronoiCells, Voronoi_Rn::TypeOfAlgorithm vorAlgo=Voronoi_Rn::Incremental)
Compute the Voronoi Diagram in a n-dimensional space i.e. a partitioning of an input space into regio...
Model a polytope using its two equivalent definitions : the convex hull and the half-space intersecti...
A half-space whose frontier is a linear (n-1) dimension space. _constant + _coefficients[0].x1 + ... + _coefficients[n-1].xn >= 0.
Model a polyhedral cone using its two equivalent definitions : the convex hull and the half-space int...
Refers to the class CellByCellDistNgb (100% of the distances between seeds to be sorted) ...
static polito_EXPORT double computeVolume(const boost::shared_ptr< Polytope_Rn > P)
Return the volume of the given polytope P with its double description. The implemented algorithm can ...
static polito_EXPORT int checkEqualityOfPolytopes(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, bool getFaceMapping=false)
Check whether two HV-polytopes are identical Check whether the vertices of A are inside B half-spaces...
static polito_EXPORT int makeCube(boost::shared_ptr< Polytope_Rn > &A, double M)
Create a cube whose vertices will be (+-M, ..., +-M)
static polito_EXPORT int pseudoSum(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, boost::shared_ptr< Polytope_Rn > &C, const std::set< unsigned int > &firstOperandCaps, const std::set< unsigned int > &secondOperandCaps, std::set< unsigned int > &newCaps, double bb_size=1000.)
Compute the Minkowski sum of two polytopes and then remove all cap half-spaces to truncate again...
const GEOMETRIC_OBJECT current()
Return the current geometric element.
static polito_EXPORT bool checkEqualityOfVertices(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B)
Check whether two V-polytopes are identical Check whether the sets of vertices of A and B are equal...
Refers to the class CellByCellVoronoi.
static polito_EXPORT int checkTopologyAndGeometry(const boost::shared_ptr< PolyhedralCone_Rn > &A)
Check whether a HV-polytopes is correct.
Refers to the class CellByCellDistNgb ( 1% of the distances between seeds to be sorted) ...
static polito_EXPORT int loadPolytope(const string &pathA, boost::shared_ptr< Polytope_Rn > &A)
Load a polytope from the corresponding file name.
void begin()
Move the iterator at the beginning of the list.
static polito_EXPORT int PolarPolytope(const boost::shared_ptr< Polytope_Rn > &original_pol, boost::shared_ptr< Polytope_Rn > &polar_pol)
Compute the polar polytope.
int test_main(int argc, char *argv[])
static polito_EXPORT int computeDoubleDescription(boost::shared_ptr< Polytope_Rn > &A, double bb_size=1000.)
Compute the HV-description for a given H-polytope or V-polytope with the Double Description algorithm...
static polito_EXPORT void setTolerance(double t)
Give the minimum distance between two points.
static polito_EXPORT double getTolerance()
Give the minimum distance between two points.
bool end() const
Tell whether we have reached the end of the list.
Combinatorial face enumeration for polytopes.
static polito_EXPORT unsigned int getDimension()
Return the dimension of the cartesian space we work in.
A n-coordinates generator, which can be a vertex or an edge whether it is contained by a polytope or ...
static polito_EXPORT int loadPolyhedralCone(const string &pathA, boost::shared_ptr< PolyhedralCone_Rn > &A)
Load a polyhedral cone from the corresponding file name.
Refers to the class CellByCellVoronoiDist.
Refers to the class IncrementalVoronoi.
This class is designed to run the list of all geometric objects representing a polytope.
void next()
Move the iterator one step forward.
static void Compute(const boost::shared_ptr< Polytope_Rn > &A)
const std::vector< std::vector< ListOfFaces > > & getFacesWithVertices()
void computeHyperplanesSeparationForProjection(const std::vector< boost::shared_ptr< HalfSpace_Rn > > &, boost::shared_ptr< Polytope_Rn > &)
void setCoordinate(unsigned int i, double val)
static polito_EXPORT int pseudoIntersection(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, boost::shared_ptr< Polytope_Rn > &C, const std::set< unsigned int > &firstOperandCaps, const std::set< unsigned int > &secondOperandCaps, std::set< unsigned int > &newCaps, double bb_size=1000.)
Remove all cap half-spaces and then compute the intersection of two capped polytopes.
static void load(const std::string &filename, std::vector< std::vector< ListOfFaces > > &latt)
Load the polytope lattice.
static polito_EXPORT int computeMinkowskiSumOfPolytopes(const boost::shared_ptr< Polytope_Rn > &A, const boost::shared_ptr< Polytope_Rn > &B, boost::shared_ptr< Polytope_Rn > &C)
Compute the Minkowski sum between two HV-polytopes.