[Boost-bugs] [Boost C++ Libraries] #8380: sym_difference yields bad result for large numbers

Subject: [Boost-bugs] [Boost C++ Libraries] #8380: sym_difference yields bad result for large numbers
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-04-03 14:46:43


#8380: sym_difference yields bad result for large numbers
--------------------------------------------------------------------------+-
 Reporter: Volker Schöch <vschoech@…> | Owner: barendgehrels
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: geometry
  Version: Boost 1.52.0 | Severity: Problem
 Keywords: sym_difference, polygon, large numbers, domain of definition |
--------------------------------------------------------------------------+-
 Here is an example where using a relatively small number yields the
 correct result whereas using ''boost::numeric::bounds<int>::highest()/2''
 yields a bad result when calling boost::geometry::sym_difference.

 My polygon type is '''oriented counter-clockwise''' and '''not closed''',
 my point type is based on '''int'''. Based on using int, can you offer any
 guidance about the largest possible numbers ("domain of definition") that
 yield correct results in the boost geometry algorithms?

 Here is our conversation on the geometry mailing list regarding this issue
 in 1.48.0:[[BR]]
 http://lists.boost.org/geometry/2012/02/1849.php

 For readability, I use the `^` operator to denote the call to
 sym_difference below.

 {{{
 MULTIPOLYGON(((564 2394,1548 2850,2526 2916,2526 32767,564 32767)))
 ^ MULTIPOLYGON(((564 3252,2526 3252,2526 32767,564 32767)))
 correct result: MULTIPOLYGON(((564 3252,564 2394,1548 2850,2526 2916,2526
 3252)))

 MULTIPOLYGON(((564 2394,1548 2850,2526 2916,2526 1073741823,564
 1073741823)))
 ^ MULTIPOLYGON(((564 3252,2526 3252,2526 1073741823,564 1073741823)))
 bad result: MULTIPOLYGON(((564 3252,564 2394,1548 2850,2526 2916,2526
 333411)))
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8380>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC