mirror of https://github.com/CGAL/cgal
Fix examples/tests/demos
This commit is contained in:
parent
063a91a771
commit
3955f031bd
|
|
@ -15,6 +15,7 @@
|
|||
#include <CGAL/Cartesian_d.h>
|
||||
#include <CGAL/point_generators_d.h>
|
||||
#include <CGAL/MP_Float.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
||||
#include <CGAL/Approximate_min_ellipsoid_d.h>
|
||||
#include <CGAL/Approximate_min_ellipsoid_d_traits_2.h>
|
||||
|
|
@ -148,7 +149,7 @@ void simple_test(int n, int d, int multiplicity, double eps)
|
|||
Point_list P;
|
||||
typedef typename is_d_dimensional<Traits>::value is_d;
|
||||
add_random_points<Kernel>(n, d, multiplicity, P, is_d());
|
||||
std::random_shuffle(P.begin(), P.end());
|
||||
CGAL::random_shuffle(P.begin(), P.end());
|
||||
|
||||
// compute minellipsoid:
|
||||
Traits tco;
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ int main() {
|
|||
|
||||
// Use a random permutation to hide the creation history
|
||||
// of the point set.
|
||||
std::random_shuffle( points.begin(), points.end(), get_default_random());
|
||||
CGAL::random_shuffle( points.begin(), points.end());
|
||||
|
||||
// Check range of values.
|
||||
for ( Vector::iterator i = points.begin(); i != points.end(); i++){
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void test_point_generators_2() {
|
|||
perturb_points_2( i1, i2, 10.0);
|
||||
|
||||
// Create a random permutation.
|
||||
std::random_shuffle( points.begin(), points.end(), get_default_random());
|
||||
CGAL::random_shuffle( points.begin(), points.end(), get_default_random());
|
||||
|
||||
assert( points.size() == 1000);
|
||||
for ( std::vector<Point_2>::iterator i = points.begin();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
#include <CGAL/Interval_skip_list.h>
|
||||
#include <CGAL/Interval_skip_list_interval.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
|
|
@ -19,7 +20,7 @@ int main()
|
|||
for(i = 0; i < n; i++) {
|
||||
intervals[i] = Interval(i, i+d);
|
||||
}
|
||||
std::random_shuffle(intervals.begin(), intervals.end());
|
||||
CGAL::random_shuffle(intervals.begin(), intervals.end());
|
||||
|
||||
isl.insert(intervals.begin(), intervals.end());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
#include <CGAL/Interval_skip_list.h>
|
||||
#include <CGAL/Interval_skip_list_interval.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <list>
|
||||
|
|
@ -20,7 +22,7 @@ fct()
|
|||
for(i = 0; i < n; i++) {
|
||||
intervals[i] = Interval(i,i+d);
|
||||
}
|
||||
std::random_shuffle(intervals.begin(), intervals.end());
|
||||
CGAL::random_shuffle(intervals.begin(), intervals.end());
|
||||
|
||||
for(i = 0; i < n; i++) {
|
||||
isl.insert(intervals[i]);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ int main()
|
|||
#include <fstream>
|
||||
|
||||
#include <ctime>
|
||||
#include <algorithm>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
||||
const bool pre_run = false;
|
||||
const bool do_remove = true;
|
||||
|
|
@ -63,7 +63,7 @@ void test(const std::vector<Point> &input, T &t)
|
|||
vhs.push_back(it);
|
||||
}
|
||||
|
||||
std::random_shuffle(vhs.begin(), vhs.end());
|
||||
CGAL::random_shuffle(vhs.begin(), vhs.end());
|
||||
vhs.resize(vhs.size() / 2);
|
||||
for (size_t i = 0; i < vhs.size(); ++i)
|
||||
t.remove(vhs[i]);
|
||||
|
|
|
|||
|
|
@ -972,7 +972,7 @@ void Scene::load_points(const QString& fileName) {
|
|||
std::copy(std::istream_iterator<Point>(ifs),
|
||||
std::istream_iterator<Point>(),
|
||||
std::back_inserter(points));
|
||||
std::random_shuffle(points.begin(), points.end());
|
||||
CGAL::random_shuffle(points.begin(), points.end());
|
||||
p3dt.insert(points.begin(), points.end());
|
||||
|
||||
QString snv;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <CGAL/Periodic_3_Delaunay_triangulation_3.h>
|
||||
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
||||
// Making available the Periodic_3_Delaunay_triangulation_3 to be
|
||||
// drawn in the Scene.
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
#include <CGAL/Polygon_mesh_processing/polygon_soup_to_polygon_mesh.h>
|
||||
|
||||
#include <CGAL/IO/Polyhedron_iostream.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Timer.h>
|
||||
|
||||
#include <fstream>
|
||||
|
|
@ -86,7 +87,7 @@ void shuffle_off(const char* fname_in, const char* fname_out)
|
|||
for (int k=0;k<n;++k)
|
||||
input >> indices[k];
|
||||
|
||||
std::random_shuffle(indices.begin(), indices.end());
|
||||
CGAL::random_shuffle(indices.begin(), indices.end());
|
||||
|
||||
output << n;
|
||||
for (int k=0;k<n;++k)
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <CGAL/Search_traits_3.h>
|
||||
#include <CGAL/Search_traits_adapter.h>
|
||||
#include <CGAL/linear_least_squares_fitting_3.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QApplication>
|
||||
|
|
@ -451,9 +452,9 @@ void Scene_points_with_normal_item_priv::compute_normals_and_vertices() const
|
|||
colors_points.resize(0);
|
||||
|
||||
//Shuffle container to allow quick display random points
|
||||
std::random_shuffle (m_points->begin(), m_points->first_selected());
|
||||
CGAL::random_shuffle (m_points->begin(), m_points->first_selected());
|
||||
if (m_points->nb_selected_points() != 0)
|
||||
std::random_shuffle (m_points->first_selected(), m_points->end());
|
||||
CGAL::random_shuffle (m_points->first_selected(), m_points->end());
|
||||
//if item has normals, points will be one point out of two in the lines data.
|
||||
//else points will be lines and lines discarded.
|
||||
double average_spacing = 0;
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
// ============================================================================
|
||||
|
||||
#include <CGAL/Random.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <cassert>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
|
@ -160,7 +161,7 @@ main()
|
|||
|
||||
std::vector<int> numbers;
|
||||
numbers.push_back(1);
|
||||
std::random_shuffle(numbers.begin(), numbers.end(), CGAL::get_default_random());
|
||||
CGAL::random_shuffle(numbers.begin(), numbers.end(), CGAL::get_default_random());
|
||||
return( 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Modifiable_priority_queue.h>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
|
|
@ -127,7 +128,7 @@ int main()
|
|||
|
||||
//testing correctness of the order
|
||||
int array[10] = {0,1,2,3,4,5,6,7,8,9};
|
||||
std::random_shuffle(array,array+10);
|
||||
CGAL::random_shuffle(array,array+10);
|
||||
data.clear();
|
||||
data.reserve(10);
|
||||
for (int i=0;i<10;++i){
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ void test(const int D, const int d, const int N, bool no_transform)
|
|||
assert( 2 * dc.number_of_vertices() == dc.number_of_full_cells() + 2 );
|
||||
if( dc.current_dimension() > 3 )
|
||||
{
|
||||
std::random_shuffle(points.begin(), points.end());
|
||||
CGAL::random_shuffle(points.begin(), points.end());
|
||||
if (points.size() > 100)
|
||||
points.resize(100);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ int main()
|
|||
|
||||
std::cout <<" Removing vertices in random order" << std::endl;
|
||||
|
||||
std::random_shuffle(V.begin(), V.end());
|
||||
CGAL::random_shuffle(V.begin(), V.end());
|
||||
|
||||
for (i=0; i<125; ++i) {
|
||||
T.remove(V[i]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue