Commit Graph

39 Commits

Author SHA1 Message Date
Andreas Fabri 6c547e5663 Mainly added includes 2013-09-13 22:24:30 +02:00
Laurent Rineau d19578725b Fix warnings 2013-02-07 18:15:23 +01:00
Laurent Rineau e87dad0f95 Fix all warnings in demo/Polyhedron/
The compilation was fix g++-4.8, and the flags:
  --std=c++11 -frounding-math Wall -Wno-array-bounds -Wno-uninitialized
2013-02-06 17:03:20 +01:00
Sébastien Loriot 82b2ebc865 apply the cpp0x namespace renaming in all files 2012-12-19 11:33:17 +01:00
Laurent Rineau db194534c7 First big patch to fix -Wunused-local-typedefs
-Wunused-local-typedefs is a new warning flag of gcc-4.7, and it will enabled
 by -Wall since gcc-4.8 (not yet released).

The fix is a big set of removals of unused typedefs (or comments, or moves,
depending on the context).
2012-08-01 13:29:16 +00:00
Sébastien Loriot 3de45905c0 use a dedicated version of the function assigning points to region in case
at least two extreme points are identical.

for the archive here is the result of the benchmark like done for r69398.
br_spl correspond to the same code but replacing the implementation of 
ch_akl_toussaint_assign_points_to_regions_deg by:
  for ( ; first != last; ++first )
  {
    //note that e!=w and s!=n except if the convex hull is a point (they are lexicographically sorted)
    if ( left_turn(*e, *w, *first ) )   
    {
        if (s!=w && left_turn( *s, *w, *first ) )       region1.push_back( *first );
        else if (e!=s && left_turn( *e, *s, *first ) )  region2.push_back( *first );
    }
    else
    {
        if (n!=e && left_turn( *n, *e, *first ) )       region3.push_back( *first );
        else if (w!=n && left_turn( *w, *n, *first ) )  region4.push_back( *first );
    }
  }  

The conclusion is that that version is always the fastest.

2 extreme points 
    using vector
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |  1.34  |  2.61  | 16.15  | 16.69 |  18.31 |  20.91  |
    |branch   |  0.10  |  0.74  |  9.24  | 11.0  |  12.74 |  15.24  |
    |br_spl   |  0.12  |  0.91  | 10.18  | 11.88 |  13.68 |  15.88  |
    |--------------------------------------------------------------- 

    using list
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |  1.27  |  2.66  |  16.09 | 16.66 |  18.19  | 21.21  |
    |branch   |  0.10  |  0.8   |   9.49 | 11.36 |  13.09  | 15.55  |
    |br_spl   |  0.13  |  0.9   |  10.32 | 12.00 |  13.93  | 16.14  |
    --------------------------------------------------------------- |

 
3 extreme points
    using vector
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |   1.34 |   2.46 |  14.26 | 14.81 |   16.40 | 18.48  |
    |branch   |   0.18 |   0.87 |  10.07 | 11.76 |   13.52 | 15.59  |
    |br_spl   |   0.12 |   0.98 |  10.41 | 12.07 |   13.94 | 15.93  |
    |---------------------------------------------------------------| 

    using list
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |   1.32 |   2.45 |  14.17 | 14.76 |   16.62 | 18.61  |
    |branch   |   0.19 |   0.86 |  10.21 | 12.03 |   13.66 | 15.96  |
    |br_spl   |   0.16 |   0.94 |  10.74 | 12.38 |   14.39 | 16.31  |
    |---------------------------------------------------------------| 

Convex hull is 2 points
    using vector
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |  0.19  |  1.39  |  13.54 | 13.46 |  14.16  | 14.05  |
    |branch   |  0.11  |  0.54  |   5.02 |  4.96 |   5.09  |  5.06  |
    |br_spl   |  0.12  |  0.94  |   9.02 |  9.0  |   8.98  |  9.13  |
    |---------------------------------------------------------------| 

    using list
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |   0.18 |   1.46 |  13.89 | 13.88 |   14.44 | 14.11  |
    |branch   |   0.14 |   0.58 |   5.12 |  5.07 |    5.07 |  5.29  |
    |br_spl   |   0.14 |   0.97 |   9.28 |  9.28 |    9.30 |  9.54  |
    |---------------------------------------------------------------| 

4 extreme points
    using vector
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------| 
    |next     |   2.37 |   2.97 |   9.84 |  8.07 |    7.76 | 9.0    |
    |branch   |   0.10 |   0.50 |   6.76 |  7.36 |    7.42 | 8.66   |
    |br_spl   |   0.13 |   0.46 |   6.74 |  7.30 |    7.38 | 8.65   |
    |---------------------------------------------------------------|

    using list
    |nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|
    |nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
    |---------------------------------------------------------------|
    |next     |   2.34 |   3.07 |   9.91 |  8.01 |    7.78 | 9.17   |
    |branch   |   0.11 |   0.54 |   6.78 |  7.44 |    7.58 | 8.93   |
    |br_spl   |   0.14 |   0.50 |   6.82 |  7.44 |    7.51 | 8.94   |
    |---------------------------------------------------------------|
2012-05-31 12:48:42 +00:00
Sébastien Loriot d6f0881f52 make sure ranges are not empty.
benchmark results are still valid
2012-05-30 15:52:46 +00:00
Sébastien Loriot a4b5ae22aa The akl_toussaint algo first determines extreme points along x and y axis, and then
associates each input point outside the diamond defined by the aforementioned extreme points
to one of the 4 regions defined. The old implementation did not take into account 
the fact that the extreme points where also tested, which resulted in filter failures.

To avoid that, the range of input points is split (artificially) in 5 ranges and
the association part is done for each range. The implementation is faster when using
random access iterators as input.

Here is the result of a benchmark on random points in a disk.
In order to have significant running time, the same convex hull
is computed several times (nb runs) and the total time is reported.


Using a vector of points as input

nb pts   |     10 |   100  |   1000 | 10000 |  100000 | 1000000|  
nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
---------------------------------------------------------------
next     | 2.34s  | 2.95s  |  9.88s | 8.02s | 7.80s   | 9.06s  |
branch   | 0.11s  | 0.49s  |  6.79s | 7.49s | 7.43s   | 8.74s  |
---------------------------------------------------------------


Using a list of points as input

nb pts   |     10 |    100 |   1000 | 10000 |  100000 | 1000000|  
nb runs  | 100001 | 100001 | 100001 | 10001 |    1001 |     101|
---------------------------------------------------------------
next     |  2.34s | 3.16s  |  9.85s | 8.08s |   7.84s | 9.27s  |
branch   |  0.14s | 0.54s  |  6.93s | 7.51s |   7.61s | 8.98s  |
---------------------------------------------------------------
2012-05-30 15:17:59 +00:00
Sébastien Loriot 19857458b6 deprecation warnings 2012-05-28 07:28:03 +00:00
Laurent Rineau 8f59fd9592 Turn QPL into LGPLv3+ 2012-01-13 16:33:35 +00:00
Philipp Möller 8eb30ef805 Replaced all uses of predecessor/successor with prev/next. 2011-06-07 16:21:58 +00:00
Laurent Rineau 167dd190c7 Fix compilation error about boost::bind
Fix an ambiguity between boost::bind and std::bind (C++0x): prefix
bind with boost:: explicitly.
2011-06-03 16:42:30 +00:00
Laurent Rineau 8679a3911e Merged revisions 56835,56864-56870,56876,56895-56897 via svnmerge from
svn+ssh://lrineau@scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.6-branch

........
  r56835 | lrineau | 2010-06-17 12:56:52 +0200 (Thu, 17 Jun 2010) | 6 lines
  
  Remove the constructor Gmpfr(long double) on Microsoft Visual C++. A big
  comment in the source code explains why.
  
  The testsuite will check that the construction of Gmpfr from a long double
  on MSVC still works and produces the right Gmpfr.
........
  r56864 | afabri | 2010-06-18 11:04:47 +0200 (Fri, 18 Jun 2010) | 1 line
  
  Use tie from boost::
........
  r56865 | afabri | 2010-06-18 11:11:49 +0200 (Fri, 18 Jun 2010) | 1 line
  
  Use bind from boost::
........
  r56866 | afabri | 2010-06-18 11:38:50 +0200 (Fri, 18 Jun 2010) | 1 line
  
  Use bind from boost:: (detected in Mesh_3 VC10 testsuite)
........
  r56867 | lrineau | 2010-06-18 11:39:24 +0200 (Fri, 18 Jun 2010) | 3 lines
  
  cmake-2.8.2rc2 is out.
  /bigobj is necessary
........
  r56868 | afabri | 2010-06-18 11:52:37 +0200 (Fri, 18 Jun 2010) | 1 line
  
  Add #include <fstream>
........
  r56869 | afabri | 2010-06-18 11:55:33 +0200 (Fri, 18 Jun 2010) | 1 line
  
  Shorten filename as with path it exceeds easily 256 letters which poor Visual C++ can't handle
........
  r56870 | afabri | 2010-06-18 12:24:30 +0200 (Fri, 18 Jun 2010) | 1 line
  
  Use tie from boost::
........
  r56876 | lrineau | 2010-06-18 16:40:36 +0200 (Fri, 18 Jun 2010) | 3 lines
  
  New try to fix the issue of Gmpfr(long double) with MSVC and libmpfr-1.dll
  compiled by Mingw.
........
  r56895 | lrineau | 2010-06-20 23:16:40 +0200 (Sun, 20 Jun 2010) | 3 lines
  
  Using boost::bind is not sufficient" "bind" without qualifier was
  ambiguous, according to MSVC2010, with std::bind (from C++0x).
........
  r56896 | lrineau | 2010-06-20 23:18:29 +0200 (Sun, 20 Jun 2010) | 3 lines
  
  Qualify "bind" with "boost::", to avoid the ambiguity (according to
  MSVC2010), with std::bind (C++0x).
........
  r56897 | lrineau | 2010-06-20 23:19:17 +0200 (Sun, 20 Jun 2010) | 2 lines
  
  Stupid typo!
........
2010-06-20 21:48:20 +00:00
Sébastien Loriot 52317dd49f add python script (replace_CGAL_NAMESPACE.py) to replace CGAL_BEGIN_NAMESPACE and CGAL_END_NAMESPACE
by namespace CGAL { and } //namespace CGAL. in all .h and .cpp files
in a directory.
Apply it to all packages in the trunk
Remove macro definition from the config.h file.
2010-06-09 07:37:13 +00:00
Sylvain Pion 85dc12f2a7 Remove empty lines at beginning and end of files
(apply Scripts/developer_scripts/remove_empty_lines.pl).
2010-02-01 12:55:28 +00:00
Stéphane Tayeb 8dceee4164 Add include<CGAL/assertions.h> in *_assertion files. 2009-10-07 13:16:13 +00:00
Stéphane Tayeb 770492c1c7 Use new version of script create_assertions.sh to generate *_assertions.h files.
Diffs are:
 * #undef added
 * in old files, (void)0 is replaced by static_cast<void>(0)
 * in old files, lines as "#  define CGAL_xxx_assertion 1" are added
 * in point_set_processing_assertions.h, surface_mesh_parameterization_assertions.h, surface_reconstruction_points_assertions.h, "|| defined(CGAL_NDEBUG)" is replaced by "|| defined (NDEBUG)"
 * protective macros (if any) are removed
 * included files if any (<CGAL/assertions.h>, <CGAL/trace.h>) are removed
2009-10-07 07:49:44 +00:00
Sylvain Pion 8573fe26ce Rename CGALi to internal. 2009-08-24 17:10:04 +00:00
Sylvain Pion 76f9ad0aa5 Replace various std::copy calls by constructors of vector/list. 2008-08-20 09:52:00 +00:00
Michael Hoffmann 827fc44e29 Remove dependency on CGAL/functional. 2008-07-23 15:31:38 +00:00
Sylvain Pion 79864c0c8e Remove Arity_tag. 2008-07-22 12:29:01 +00:00
Sylvain Pion 2eb0d8f9e9 certainly() -> possibly(). 2008-07-14 11:16:41 +00:00
Sylvain Pion 9d7a609ff2 Make assertions trigger an error only for *certain* conditions (using CGAL::certainly()).
This is useful for interval arithmetic code.
(replay of r44002 with the header order hopefully fixed)
2008-07-10 21:49:17 +00:00
Sylvain Pion 2b4ebf01f7 Undo r44002 as it's buggy 2008-07-06 20:47:29 +00:00
Sylvain Pion 514a17ad4f Improve the interaction of assertions and interval computations.
Things like "CGAL_assertion(denominator != 0)" produced assertion failures for no gain.
So now, the assertion is triggered only if the condition is certain, using CGAL::certainly().
That is, change the following in all assertion files :
  ((EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
to :
  (CGAL::certainly(EX)?(static_cast<void>(0)): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__))
2008-07-06 17:05:47 +00:00
Sylvain Pion 0308a5845c Qualify cref() by boost:: as there is a cref() in TR1 as well. 2008-03-11 14:45:12 +00:00
Andreas Fabri ce48e143bd fixed typo 2008-03-11 10:37:32 +00:00
Sylvain Pion 740e5179a6 Replace <CGAL/functional.h> by <boost/bind.hpp>.
If it works, then we can do the same elsewhere,
and schedule <CGAL/functional.h> for removal.
2008-03-10 00:10:50 +00:00
Sylvain Pion 7b114599ad Get rid of CGAL_REP_CLASS_DEFINED 2008-01-03 19:02:00 +00:00
Sylvain Pion d49e006c53 Remove default argument "0" to calls to assertion_fail() et al,
as the default is now the empty string "".
It should fix the problem that we have lost the assertion messages
(seeing "what():  basic_string::_S_construct NULL not valid" instead),
for packages that use package-specific assertion macros.
2007-12-21 21:58:27 +00:00
Sylvain Pion 917bfaffa4 formatting 2007-02-15 14:48:03 +00:00
Ron Wein 1dee919574 Fixed a problem with the include files. 2006-06-04 15:33:38 +00:00
Andreas Fabri 139ccd2db0 undo of a previous svn move 2006-06-02 13:11:51 +00:00
Andreas Fabri 0ea6b431d3 undo of a previous svn move 2006-06-02 13:11:37 +00:00
Ron Wein df2ec0d736 Changed files with *.C prefix to *_impl.h, and moved some non-interface
include files to a the Convex_hull_2 subfolder.
2006-05-29 09:01:56 +00:00
Christophe Delage 23e9fe7522 Fixed a silly bug found by Thomas Hackl, thanks to Camille Wormser. 2006-04-19 13:29:42 +00:00
Laurent Saboret db6a8f948c Change CVS keywords to SVN style 2006-02-16 14:30:13 +00:00
Laurent Saboret 1aad55d4cb Change CVS keywords to SVN style 2006-02-14 10:08:15 +00:00
Laurent Saboret 20e0dc0e01 Move packages to trunk root 2006-02-14 08:58:14 +00:00