mirror of https://github.com/CGAL/cgal
Used std::array instead of std::vector as the size is known at compile time
This commit is contained in:
parent
724ef98978
commit
6b0a8c5b6d
|
|
@ -4,7 +4,7 @@
|
||||||
#include <CGAL/Random.h>
|
#include <CGAL/Random.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <vector>
|
#include <array>
|
||||||
typedef CGAL::Simple_cartesian<double> K;
|
typedef CGAL::Simple_cartesian<double> K;
|
||||||
typedef CGAL::Min_sphere_of_points_d_traits_2<K,double> Traits;
|
typedef CGAL::Min_sphere_of_points_d_traits_2<K,double> Traits;
|
||||||
typedef CGAL::Min_sphere_of_spheres_d<Traits> Min_circle;
|
typedef CGAL::Min_sphere_of_spheres_d<Traits> Min_circle;
|
||||||
|
|
@ -14,7 +14,7 @@ int
|
||||||
main( int, char**)
|
main( int, char**)
|
||||||
{
|
{
|
||||||
const int n = 100;
|
const int n = 100;
|
||||||
std::vector<Point> P(n);
|
std::array<Point, n> P;
|
||||||
CGAL::Random r; // random number generator
|
CGAL::Random r; // random number generator
|
||||||
|
|
||||||
for ( int i = 0; i < n; ++i){
|
for ( int i = 0; i < n; ++i){
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
#include <CGAL/Simple_homogeneous.h>
|
#include <CGAL/Simple_homogeneous.h>
|
||||||
#include <CGAL/Min_circle_2.h>
|
#include <CGAL/Min_circle_2.h>
|
||||||
#include <CGAL/Min_circle_2_traits_2.h>
|
#include <CGAL/Min_circle_2_traits_2.h>
|
||||||
#include <vector>
|
#include <array>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
// typedefs
|
// typedefs
|
||||||
|
|
@ -16,7 +16,7 @@ int
|
||||||
main( int, char**)
|
main( int, char**)
|
||||||
{
|
{
|
||||||
const int n = 100;
|
const int n = 100;
|
||||||
std::vector<Point> P(n);
|
std::array<Point, n> P;
|
||||||
|
|
||||||
for ( int i = 0; i < n; ++i){
|
for ( int i = 0; i < n; ++i){
|
||||||
P.at(i) = Point( (i%2 == 0 ? i : -i), 0, 1);
|
P.at(i) = Point( (i%2 == 0 ? i : -i), 0, 1);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue