mirror of https://github.com/CGAL/cgal
try to fix some warnings
This commit is contained in:
parent
fe929dee85
commit
b5047c9bb8
|
|
@ -16,7 +16,7 @@ int main( )
|
||||||
int N=10000;
|
int N=10000;
|
||||||
std::vector<Point> v;
|
std::vector<Point> v;
|
||||||
boost::mt19937 gen;
|
boost::mt19937 gen;
|
||||||
gen.seed(time(0));
|
gen.seed(0u);
|
||||||
|
|
||||||
random_convex_hull_in_disc_2(N,RADIUS,gen,std::back_inserter(v),K());
|
random_convex_hull_in_disc_2(N,RADIUS,gen,std::back_inserter(v),K());
|
||||||
size_t size = v.size();
|
size_t size = v.size();
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,8 @@
|
||||||
// Author(s) : Remy Thomasse <remy.thomasse@inria.fr>
|
// Author(s) : Remy Thomasse <remy.thomasse@inria.fr>
|
||||||
|
|
||||||
#ifndef CGAL_RANDOM_CONVEX_HULL_DISC_H
|
#ifndef CGAL_RANDOM_CONVEX_HULL_DISC_H
|
||||||
#define CGAL_RANDOM_CONVEX_HULL_DISC_H
|
#define CGAL_RANDOM_CONVEX_HULL_DISC_H 1
|
||||||
#include <boost/random.hpp>
|
#include <boost/random.hpp>
|
||||||
#include <CGAL/config.h>
|
|
||||||
//#include <cmath>
|
|
||||||
#include <CGAL/Polygon_2_algorithms.h>
|
#include <CGAL/Polygon_2_algorithms.h>
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
@ -184,7 +182,7 @@ void random_convex_hull_in_disc_2(std::size_t n, double radius, std::list<typena
|
||||||
|
|
||||||
do { // Initialization
|
do { // Initialization
|
||||||
long init =
|
long init =
|
||||||
std::min(static_cast<std::size_t>(100), n - simulated_points);
|
static_cast<long>((std::min)(static_cast<std::size_t>(100), n - simulated_points));
|
||||||
|
|
||||||
generate_points_annulus(init, -CGAL_PI, CGAL_PI, 0, radius, l,
|
generate_points_annulus(init, -CGAL_PI, CGAL_PI, 0, radius, l,
|
||||||
gen);
|
gen);
|
||||||
|
|
@ -236,9 +234,9 @@ void random_convex_hull_in_disc_2(std::size_t n, double radius, std::list<typena
|
||||||
FT p_disc = squared_small_radius / squared_radius;
|
FT p_disc = squared_small_radius / squared_radius;
|
||||||
long nb;
|
long nb;
|
||||||
if (simulated_points < T) {
|
if (simulated_points < T) {
|
||||||
nb = static_cast<long>(std::min(simulated_points, n - simulated_points));
|
nb = static_cast<long>((std::min)(simulated_points, n - simulated_points));
|
||||||
} else {
|
} else {
|
||||||
nb = static_cast<long>(std::min(T, n - simulated_points));
|
nb = static_cast<long>((std::min)(T, n - simulated_points));
|
||||||
}
|
}
|
||||||
boost::binomial_distribution<long> dbin(nb, to_double(p_disc));
|
boost::binomial_distribution<long> dbin(nb, to_double(p_disc));
|
||||||
boost::variate_generator<
|
boost::variate_generator<
|
||||||
|
|
|
||||||
|
|
@ -285,8 +285,8 @@ MainWindow::on_actionGeneratePolytopeInDisc_triggered()
|
||||||
bool ok = false;
|
bool ok = false;
|
||||||
const int number_of_points =
|
const int number_of_points =
|
||||||
QInputDialog::getInteger(this,
|
QInputDialog::getInteger(this,
|
||||||
tr("Number of random points"),
|
tr("Number of random points in the disc"),
|
||||||
tr("Enter number of random points"),
|
tr("Enter number of random points.\nThe polytope will be the convex hull of these points."),
|
||||||
100,
|
100,
|
||||||
0,
|
0,
|
||||||
(std::numeric_limits<int>::max)(),
|
(std::numeric_limits<int>::max)(),
|
||||||
|
|
@ -302,7 +302,7 @@ MainWindow::on_actionGeneratePolytopeInDisc_triggered()
|
||||||
|
|
||||||
segments.reserve(segments.size() + 100);
|
segments.reserve(segments.size() + 100);
|
||||||
|
|
||||||
CGAL::random_convex_hull_in_disc_2(number_of_points,100,gen,std::back_inserter(points),K());
|
CGAL::random_convex_hull_in_disc_2(number_of_points,radius,gen,std::back_inserter(points),K());
|
||||||
std::vector<Point_2>::iterator it2=points.begin();
|
std::vector<Point_2>::iterator it2=points.begin();
|
||||||
for(std::vector<Point_2>::iterator it=points.begin();it!=points.end();it++){
|
for(std::vector<Point_2>::iterator it=points.begin();it!=points.end();it++){
|
||||||
it2++;
|
it2++;
|
||||||
|
|
@ -313,7 +313,7 @@ MainWindow::on_actionGeneratePolytopeInDisc_triggered()
|
||||||
|
|
||||||
|
|
||||||
// default cursor
|
// default cursor
|
||||||
QApplication::restoreOverrideCursor();std::cout<<"OK";
|
QApplication::restoreOverrideCursor();
|
||||||
|
|
||||||
emit(changed());
|
emit(changed());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue