Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] sort/unique functions

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] sort/unique functions


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] sort/unique functions
  • Date: Tue, 18 May 2010 10:56:28 +0200

On my machine, the output of the following program is

1 1 1
1 2 1
1 2 1
1 2 3
1 2 4
4 3 1
---
1 1 1
1 2 1
1 2 3
1 2 4
4 3 1

If you do not have the same output, can you please give your CGAL version and platform.

#include <CGAL/Simple_cartesian.h>
#include <list>
#include <iostream>
#include <iterator>

typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;

int main(){
std::list<Point> lst;
lst.push_back(Point(1,1,1));
lst.push_back(Point(4,3,1));
lst.push_back(Point(1,2,1));
lst.push_back(Point(1,2,1));
lst.push_back(Point(1,2,3));
lst.push_back(Point(1,2,4));
lst.sort();

std::copy(lst.begin(),lst.end(),std::ostream_iterator<Point>(std::cout,"\n"));
std::cout << "---" << std::endl;
lst.unique();

std::copy(lst.begin(),lst.end(),std::ostream_iterator<Point>(std::cout,"\n"));

}





Archive powered by MHonArc 2.6.16.

Top of Page