ajout de test

This commit is contained in:
Remy Thomasse 2014-06-25 16:58:47 +02:00
parent a0fdbe9ab0
commit 6c3072ec95
1 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,35 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/random_convex_hull_in_disc_2.h>
#include <iostream>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_2 Point_2;
typedef CGAL::Polygon_2<K> Polygon_2;
int
main( )
{
Polygon_2 p;
int n( 1000);
boost::random::mt19937 gen;
// build random hull from n random points in a disc:
random_convex_hull_in_disc_2(n,1.0,gen,std::back_inserter(p),K());
// check convexity:
if ( ! p.is_convex()) {
std::cerr << "ERROR: polygon is not convex." << std::endl;
return 1;
}
return 0;
} // int main( )
// ----------------------------------------------------------------------------
// ** EOF
// ----------------------------------------------------------------------------