Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Using Plane_3 as key in a std::map

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Using Plane_3 as key in a std::map


Chronological Thread 
  • From: gunshi gupta <>
  • To:
  • Subject: Re: [cgal-discuss] Using Plane_3 as key in a std::map
  • Date: Tue, 8 Dec 2015 21:24:50 +0530
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:/vGjaBJQY1MIQhyZrtmcpTZWNBhigK39O0sv0rFitYgUIvXxwZ3uMQTl6Ol3ixeRBMOAu6wC07KempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRMiK14ye7KObxd76W01wnj2zYLd/fl2djD76kY0ou7ZkMbs70RDTo3FFKKx8zGJsIk+PzV6nvp/jtM0rziJLpvh099JcSb6oOOMjXLlABXInNXo07Yvlr17YXA6X7zwdVGsR1RFHCgyA4BDhVYrqqXjGsb921yCeeMH3VrspQi+K7qFxSRauhj1UGSQ+9TTYl8prjKMTrw+5uxU3l4HJZpqVNfVjZr/ULPsVQGNAWoBaUCkXUdD0VJcGE+dUZbUQlIL6vVZb9RY=

Okay, apologies, i guess the confusion regarding field and ring type was due to some misinterpretation while reading the kernel manual.
sample code:

typedef CGAL::Lazy_exact_nt<CGAL::Gmpq>                                             NT;

typedef CGAL::Simple_cartesian<NT>                                                  K;//tried with Extended cartesian as well

typedef K::Point_3                                                                 Point3;

typedef K::Plane_3                                                                 Plane3;


    std::map<Plane3, int,CGAL::Plane_lt> planes;

    planes[Plane3(Point3(12,0,0),Point3(0,6,0),Point3(0,0,8))]=2;

    std::cout<<planes[Plane3(Point3(6,3,0),Point3(0,3,4),Point3(6,0,4))];


//output: 0

//Plane3(Point3(6,3,0),Point3(0,3,4),Point3(6,0,4))==Plane3(Point3(12,0,0),Point3(0,6,0),Point3(0,0,8)) returns true


On Tue, Dec 8, 2015 at 9:06 PM, Marc Glisse <> wrote:
On Tue, 8 Dec 2015, vimarsh wrote:

I wanted to use a Plane_3 as the key value in a std::map, so i passed the
third argument to the map as:

typedef CGAL::Lazy_exact_nt<CGAL::Gmpq>                         NT;
typedef CGAL::Extended_cartesian<NT>                                 K;
typedef K::Plane_3
Plane3;

It does not work if i just do std::map<Plane3,int>,(so i guess it is not
derived from LessComparable), and i tried passing CGAL::Plane_lt as the
third argument, but later realised that is only for RingType while my kernel
uses a FieldType.

Uh? A field is a ring. Could you show a minimal program and the error you got?

How can i achieve what i want with my kernel?
(I also tried replacing the RT with FT, after copying how Plane_lt is
defined, in my code, but that didn't work either )

"doesn't work" doesn't help.

--
Marc Glisse


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss






Archive powered by MHonArc 2.6.18.

Top of Page