Subject: CGAL users discussion list
List archive
- From: houes <>
- To:
- Subject: Re: [cgal-discuss] Hash function for the Plane_3 class
- Date: Fri, 27 Apr 2018 16:04:58 -0700 (MST)
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=SoftFail ; spf=Pass
- Ironport-phdr: 9a23:aFH6axYxIfp0/6jlyp0ZwSL/LSx+4OfEezUN459isYplN5qZoMyybnLW6fgltlLVR4KTs6sC17KN9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCazbL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD0fOjA38G/ZlM9+g6BVoBy8qBNw34HabZqJNPd8Yq/RYc8WSXZfUstXSidPApm8b4wKD+cZPeZYqJT9qEUVrRCjAgSsAOLvyjBIhn/q3a061PkhHh/d3AE7ENIOtW7brNTxNKsITe+1y6zIwCzFYvhL1zn9743IfQogofGKRb9wd9DexlI0GAPBkFqcs5DqPzSQ1ukLrmOV7PJgWPqyh2MmtQ19uCajy8cih4XTm44YxF7J+T97zYorI9CzVVR1bsS+EJRKsiGXL4t2Td0mQ2FvoCs6zLILtYS9fCcQ05so3BrfZOKdf4eU5RLjUf6dITZ+hH17ZLKynwu+/Em+xuHmSMW50FhHojBYntTCuH0BzR7e5tafRvt45Eih2DKP1w7J6uFDJEA5ja7bK58uwr4wipoTsUPDHjLol0Xtl6KWeUAk9fKp6+TjeLnpupicN4pshgHkLqsugtC/Afg/MgUWQ2eb9v6z1Ln68ULkQbVKleE5krTCsJDBPskbva64AwpN0ok58Rq/DjGm0M4ZnXYdNl5FdgiH3MDVPATFL/n8SPu+mF+xiyxDxvbcP7SnDI+eAGLEleLheqtw8AYIzAs8zcxf4I9ZEZkOJfvyXgn6s9mOXUxxCBC93+uyUIY17YgZQ2/aWvbIYpOXikeB46cUG8fJYYYUvDjnLP18vqzhiHY4nRkWeqz7hsJLOkD9JexvJgCiWVSpms0ISD5YsQ83Teisg1qHA2YKOiSCGpkk7zR+M7qISIfOQof03e6HgGG9F5dcYm0AAVeJQy7l
Marc,
Thank you. I see your point. Epeck might take too much for me, so I choose
Epick.
I used your method to define a comparator for Plane_3. Each plane(a,b,c,d)
is normalized like (a/d,b/d,c/d,1) and a Point_3 is defined by
(a/d,b/d,c/d), I then compared the squared_distance of this point to Origin,
the Plane_3 is smaller if this distance is smaller. Then I sort the array of
Plane_3 using this comparator.
I know this comparison is not accurate, since two plane with the same
to_origin_distance is not necessary the same. After the sorting, planes with
the same to_origin_distance will be grouped together, this including planes
that are not the same. However, in my case, the chance I get a group of
planes that have same to_origin_distance but are different to each other is
low. So after the unique operation, I eliminate quite a lot of identical
planes, although it does not guarantee to eliminate all duplicates.
After the unique operation, I run a brute force method to eliminate left
duplicates planes (basically two nested loops). This process is exact, but
with O(n*n) time complexity. However, I did it after the sorting/unique
which, in my case, greatly reduce n, saves me some time. By the way, I
provide my own Plane_3_equal() function with tolerance to std::unique and in
the later nested loop, so inexact construction is handled.
Demonstration:
input: A B C A A B D (A, B, C, D are distinct planes, A and C are of
same to_origin_distance)
sort : A A C A B B D
unique: A C A B D
2loops: A C B D
This is a workaround method for me. Thanks.
--
Sent from: http://cgal-discuss.949826.n4.nabble.com/
- [cgal-discuss] Hash function for the Plane_3 class, houes, 04/27/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, Marc Glisse, 04/27/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, houes, 04/27/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, Marc Glisse, 04/27/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, houes, 04/28/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, Marc Glisse, 04/27/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, houes, 04/27/2018
- Re: [cgal-discuss] Hash function for the Plane_3 class, Marc Glisse, 04/27/2018
Archive powered by MHonArc 2.6.18.