Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] "unite" operation in MinKowski_2

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] "unite" operation in MinKowski_2


Chronological Thread 
  • From: Yue Biek <>
  • To:
  • Subject: Re: [cgal-discuss] "unite" operation in MinKowski_2
  • Date: Mon, 16 May 2011 21:26:33 +0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=OlA5+dp1xhneW46GvlKSGca4JDIW9SAdA5OqxUr/08nSknddxXJKJki6x1jKB3OoTC L7xcymvjqN6cVSW/CEHOwEjtYWekkdO2gyXnPf0bHMXVmp+rF8fg0dQ1rsdmaXRCq1HA ibrbBxQHGdCF3jxY72mirFO432mW3yJh9lz9o=


Dear S,
  Thank you very much! the problems have solved!

2011/5/16 Sebastien Loriot (GeometryFactory) <sloriot.ml@gmail.com>
Bernd Gaertner wrote:
My guess is that since the decimal value 0.1 is not representable as a double value under the binary IEEE standard, Lazy_exact_NT gives you a surrounding interval that is more than just one point. If so, this particular problem should go away if you use Point p(1,2).

The problem you have comes from the fact that x() and y() don't return
references. Due to the type_equality_wrapper (the mechanism making Kernel::Point_2 and Point_2<kernel> being compatible), a reference to
a temporary is returned at some point.

You should write:
       const MP_FT& x() const {return *pos;}
       const MP_FT& y() const {return *(pos+1);}



S.


Best,
Bernd.

Yue Biek wrote:
I first write a simple demo to test the validity of C_Point2.
int main()
{
Point p(0.1, 0.2);
MP_FT x = p.x();
std::cout << p.x() << std::endl;
}

However, the problem issued when p.x() executes. I found the error is caused by a test down in to_double() method:
// Interval_nt.h
bool is_point() const
 {
  return sup() == inf();
 }

It seems that it complains the cartesion component of C_Point has different supremum and infimum. If my guess is right, how could this happen?
Really need some pointers here.



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





Archive powered by MHonArc 2.6.16.

Top of Page