Used std::array instead of std::vector as the size is known at compile time

This commit is contained in:
Anirudh Lakhanpal 2025-01-22 17:56:58 +05:30
parent 724ef98978
commit 6b0a8c5b6d
2 changed files with 4 additions and 4 deletions

View File

@ -4,7 +4,7 @@
#include <CGAL/Random.h>
#include <iostream>
#include <vector>
#include <array>
typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Min_sphere_of_points_d_traits_2<K,double> Traits;
typedef CGAL::Min_sphere_of_spheres_d<Traits> Min_circle;
@ -14,7 +14,7 @@ int
main( int, char**)
{
const int n = 100;
std::vector<Point> P(n);
std::array<Point, n> P;
CGAL::Random r; // random number generator
for ( int i = 0; i < n; ++i){

View File

@ -2,7 +2,7 @@
#include <CGAL/Simple_homogeneous.h>
#include <CGAL/Min_circle_2.h>
#include <CGAL/Min_circle_2_traits_2.h>
#include <vector>
#include <array>
#include <iostream>
// typedefs
@ -16,7 +16,7 @@ int
main( int, char**)
{
const int n = 100;
std::vector<Point> P(n);
std::array<Point, n> P;
for ( int i = 0; i < n; ++i){
P.at(i) = Point( (i%2 == 0 ? i : -i), 0, 1);