Subject: CGAL users discussion list
List archive
- From: Benoît Presles <>
- To:
- Subject: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points
- Date: Tue, 05 Oct 2010 14:59:23 +0200
Hello everybody,
I am looking for a nice way to copy my data: double* X, double* Y to a list of Point_2.
Here is my code:
//My data (example)
double X[]={1,2,3,5,6};
double Y[]={-10,7,5,9,5};
//My output:
std::list<Point_2> points;
//for loop
for(int i=0; i<5; ++i)
{
//std::cout << X[i] << " " << Y[i] << std::endl;
points.push_back(Point_2(X[i], Y[i]));
}
As one can notice, I do a "for loop" to copy my data. It works but I am looking for a better way. Indeed, when my array X (or Y) is very big, the code is a bit slow.
Thank you in advance for your help,
Best Regards,
Ben_P
- [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Laurent Rineau (GeometryFactory), 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Laurent Rineau (GeometryFactory), 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Laurent Rineau (GeometryFactory), 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Benoît Presles, 10/05/2010
- Re: [cgal-discuss] How to copy double* X double* Y to std::list<Point_2> points, Laurent Rineau (GeometryFactory), 10/05/2010
Archive powered by MHonArc 2.6.16.