mirror of https://github.com/CGAL/cgal
Superfluous.
This commit is contained in:
parent
499c4901e2
commit
04389bc7cb
|
|
@ -1,32 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Polygon_2.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/random_convex_set_2.h>
|
||||
#include <CGAL/all_furthest_neighbors_2.h>
|
||||
#include <CGAL/IO/Ostream_iterator.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
typedef double FT;
|
||||
|
||||
struct Kernel : public CGAL::Cartesian<FT> {};
|
||||
|
||||
typedef Kernel::Point_2 Point;
|
||||
typedef std::vector<int> Index_cont;
|
||||
typedef CGAL::Polygon_2<Kernel> Polygon_2;
|
||||
typedef CGAL::Random_points_in_square_2<Point> Generator;
|
||||
typedef CGAL::Ostream_iterator<int,std::ostream> Oiterator;
|
||||
|
||||
int main()
|
||||
{
|
||||
// generate random convex polygon:
|
||||
Polygon_2 p;
|
||||
CGAL::random_convex_set_2(10, std::back_inserter(p), Generator(1));
|
||||
|
||||
// compute all furthest neighbors:
|
||||
CGAL::all_furthest_neighbors_2(p.vertices_begin(), p.vertices_end(),
|
||||
Oiterator(std::cout));
|
||||
std::cout << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
// file: examples/Matrix_search/extremal_polygon_2_example.C
|
||||
|
||||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/Polygon_2.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/random_convex_set_2.h>
|
||||
#include <CGAL/extremal_polygon_2.h>
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
|
||||
typedef double FT;
|
||||
|
||||
struct Kernel : public CGAL::Cartesian<FT> {};
|
||||
|
||||
typedef Kernel::Point_2 Point;
|
||||
typedef std::vector<int> Index_cont;
|
||||
typedef CGAL::Polygon_2<Kernel> Polygon_2;
|
||||
typedef CGAL::Random_points_in_square_2<Point> Generator;
|
||||
|
||||
int main() {
|
||||
|
||||
int n = 10;
|
||||
int k = 5;
|
||||
|
||||
// generate random convex polygon:
|
||||
Polygon_2 p;
|
||||
CGAL::random_convex_set_2(n, std::back_inserter(p), Generator(1));
|
||||
std::cout << "Generated Polygon:\n" << p << std::endl;
|
||||
|
||||
// compute maximum area incribed k-gon of p:
|
||||
Polygon_2 k_gon;
|
||||
CGAL::maximum_area_inscribed_k_gon_2(
|
||||
p.vertices_begin(), p.vertices_end(), k, std::back_inserter(k_gon));
|
||||
std::cout << "Maximum area " << k << "-gon:\n"
|
||||
<< k_gon << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
// ----------------------------------------------------------------------------
|
||||
// ** EOF
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
#include <CGAL/Cartesian.h>
|
||||
#include <CGAL/point_generators_2.h>
|
||||
#include <CGAL/rectangular_p_center_2.h>
|
||||
#include <CGAL/IO/Ostream_iterator.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
|
||||
typedef double FT;
|
||||
|
||||
struct Kernel : public CGAL::Cartesian<FT> {};
|
||||
|
||||
typedef Kernel::Point_2 Point;
|
||||
typedef std::vector<Point> Cont;
|
||||
typedef CGAL::Random_points_in_square_2<Point> Generator;
|
||||
typedef CGAL::Ostream_iterator<Point,std::ostream> OIterator;
|
||||
|
||||
int main()
|
||||
{
|
||||
int n = 10;
|
||||
int p = 2;
|
||||
OIterator cout_ip(std::cout);
|
||||
CGAL::set_pretty_mode(std::cout);
|
||||
|
||||
Cont points;
|
||||
CGAL::copy_n(Generator(1), n, std::back_inserter(points));
|
||||
std::cout << "Generated Point Set:\n";
|
||||
std::copy(points.begin(), points.end(), cout_ip);
|
||||
|
||||
FT p_radius;
|
||||
std::cout << "\n\n" << p << "-centers:\n";
|
||||
CGAL::rectangular_p_center_2(
|
||||
points.begin(), points.end(), cout_ip, p_radius, 3);
|
||||
std::cout << "\n\n" << p << "-radius = " << p_radius << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
#include <CGAL/Random.h>
|
||||
#include <CGAL/Cartesian_matrix.h>
|
||||
#include <CGAL/sorted_matrix_search.h>
|
||||
#include <CGAL/functional.h>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <iterator>
|
||||
|
||||
typedef int Value;
|
||||
typedef std::vector<Value> Vector;
|
||||
typedef Vector::iterator Value_iterator;
|
||||
typedef std::vector<Vector> Vector_cont;
|
||||
typedef CGAL::Cartesian_matrix<std::plus<int>,
|
||||
Value_iterator,
|
||||
Value_iterator> Matrix;
|
||||
|
||||
int main()
|
||||
{
|
||||
// set of vectors the matrices are build from:
|
||||
Vector_cont vectors;
|
||||
|
||||
// generate a random vector and sort it:
|
||||
Vector a;
|
||||
const int n = 5;
|
||||
for (int i = 0; i < n; ++i)
|
||||
a.push_back(CGAL::default_random(100));
|
||||
std::sort(a.begin(), a.end());
|
||||
std::cout << "a = ( ";
|
||||
std::copy(a.begin(), a.end(), std::ostream_iterator<int>(std::cout," "));
|
||||
std::cout << ")\n";
|
||||
|
||||
// build a Cartesian matrix from a:
|
||||
Matrix M(a.begin(), a.end(), a.begin(), a.end());
|
||||
|
||||
// search for an upper bound for max(a):
|
||||
Value bound = a[n-1];
|
||||
Value upper_bound =
|
||||
CGAL::sorted_matrix_search(
|
||||
&M, &M + 1,
|
||||
CGAL::sorted_matrix_search_traits_adaptor(
|
||||
CGAL::bind_2(std::greater_equal<Value>(), bound), M));
|
||||
std::cout << "Upper bound for " << bound << " is "
|
||||
<< upper_bound << "." << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue