merge from Spatial_sorting-increase_dimension-odevil

This commit is contained in:
Sébastien Loriot 2011-05-25 09:00:55 +00:00
commit b9e7afba64
16 changed files with 74 additions and 13 deletions

1
.gitattributes vendored
View File

@ -1717,6 +1717,7 @@ Kernel_23/test/Kernel_23/CMakeLists.txt -text
Kernel_d/doc_tex/Kernel_d/hypercube.png -text
Kernel_d/doc_tex/Kernel_d_ref/Kernel_Compute_coordinate_d.tex -text
Kernel_d/doc_tex/Kernel_d_ref/Kernel_Less_coordinate_d.tex -text
Kernel_d/doc_tex/Kernel_d_ref/Kernel_Point_dimension_d.tex -text
Kernel_d/include/CGAL/Kernel_d/Cartesian_const_iterator_d.h -text
Kernel_d/test/Kernel_d/Linear_algebra-test.cmd eol=lf
Kinetic_data_structures/demo/Kinetic_data_structures/data/after002 -text

View File

@ -8,6 +8,9 @@
set(CGAL_CONFIG_LOADED TRUE)
set(CGAL_INSTALLATION_PACKAGE_DIR "@CGAL_INSTALLATION_PACKAGE_DIR@")
set(CGAL_CORE_PACKAGE_DIR "@CGAL_CORE_PACKAGE_DIR@")
set(CGAL_MAJOR_VERSION "@CGAL_MAJOR_VERSION@" )
set(CGAL_MINOR_VERSION "@CGAL_MINOR_VERSION@" )
set(CGAL_BUILD_VERSION "@CGAL_BUILD_VERSION@" )

View File

@ -24,6 +24,11 @@
#include <cassert>
#include <cmath>
#ifdef isfinite
# error isfinite cannot be a macro if one want to use C++0x std::isfinite
// On Intel Compiler 12, isfinite is a macro in <cmath.h> :-(
#endif
template < typename T >
void use(T) {}

View File

@ -126,6 +126,8 @@ replacing operators, especially for equality testing.
\ccGlue
\ccNestedType{Orthogonal_vector_d}{}
\ccGlue
\ccNestedType{Point_dimension_d}{}
\ccGlue
\ccNestedType{Point_of_sphere_d}{}
\ccGlue
\ccNestedType{Point_to_vector_d}{}

View File

@ -0,0 +1,9 @@
\begin{ccRefFunctionObjectConcept}{Kernel::Point_dimension_d}
A model for this must provide:
\ccCreationVariable{fo}
\ccMemberFunction{ int operator()(const Kernel::Point_d&
p);} {returns the dimension of $p$}
\end{ccRefFunctionObjectConcept}

View File

@ -97,6 +97,7 @@
\input{Kernel_d_ref/Kernel_Orientation_d.tex}
\input{Kernel_d_ref/Kernel_Oriented_side_d.tex}
\input{Kernel_d_ref/Kernel_Orthogonal_vector_d.tex}
\input{Kernel_d_ref/Kernel_Point_dimension_d.tex}
\input{Kernel_d_ref/Kernel_Point_of_sphere_d.tex}
\input{Kernel_d_ref/Kernel_Point_to_vector_d.tex}
\input{Kernel_d_ref/Kernel_Project_along_d_axis_d.tex}

View File

@ -252,6 +252,7 @@ public:
typedef Lt_from_compare<Self> Less_lexicographically_d;
typedef Le_from_compare<Self> Less_or_equal_lexicographically_d;
typedef Less_coordinateCd<Self> Less_coordinate_d;
typedef Point_dimensionCd<Self> Point_dimension_d;
typedef Eq_from_method<Self> Equal_d;
typedef Center_of_sphereCd<Self> Center_of_sphere_d;
typedef Contained_in_linear_hullCd<Self> Contained_in_linear_hull_d;
@ -261,6 +262,8 @@ public:
Compute_coordinate_d compute_coordinate_d_object() const
{ return Compute_coordinate_d(); }
Point_dimension_d point_dimension_d_object() const
{ return Point_dimension_d(); }
Less_coordinate_d less_coordinate_d_object() const
{ return Less_coordinate_d(); }
Lift_to_paraboloid_d lift_to_paraboloid_d_object() const

View File

@ -254,6 +254,7 @@ public:
typedef Lt_from_compare<Self> Less_lexicographically_d;
typedef Le_from_compare<Self> Less_or_equal_lexicographically_d;
typedef Less_coordinateHd<Self> Less_coordinate_d;
typedef Point_dimensionHd<Self> Point_dimension_d;
typedef Eq_from_method<Self> Equal_d;
typedef Center_of_sphereHd<Self> Center_of_sphere_d;
typedef Contained_in_linear_hullHd<Self> Contained_in_linear_hull_d;
@ -263,6 +264,8 @@ public:
Compute_coordinate_d compute_coordinate_d_object() const
{ return Compute_coordinate_d(); }
Point_dimension_d point_dimension_d_object() const
{ return Point_dimension_d(); }
Less_coordinate_d less_coordinate_d_object() const
{ return Less_coordinate_d(); }
Lift_to_paraboloid_d lift_to_paraboloid_d_object() const

View File

@ -49,14 +49,27 @@ class Compute_coordinateCd {
}
};
template <typename K>
class Point_dimensionCd {
typedef typename K::FT FT;
typedef typename K::Point_d Point_d;
public:
typedef int result_type;
const result_type
operator()(const Point_d& p) const
{
return p.dimension();
}
};
template <typename K>
class Less_coordinateCd {
typedef typename K::FT FT;
typedef typename K::Point_d Point_d;
public:
typedef bool result_type;
const result_type
operator()(const Point_d& p, const Point_d& q, int i) const
result_type
operator()(const Point_d& p, const Point_d& q, int i) const
{
return p.cartesian(i)<q.cartesian(i);
}

View File

@ -48,6 +48,19 @@ class Compute_coordinateHd {
}
};
template <typename K>
class Point_dimensionHd {
typedef typename K::RT RT;
typedef typename K::Point_d Point_d;
public:
typedef int result_type;
const result_type
operator()(const Point_d& p) const
{
return p.dimension();
}
};
template <typename K>
class Less_coordinateHd {
typedef typename K::RT RT;
@ -62,6 +75,7 @@ class Less_coordinateHd {
}
};
template <class R>
struct Lift_to_paraboloidHd {
typedef typename R::Point_d Point_d;

View File

@ -203,7 +203,7 @@ if(CGAL_Qt4_FOUND AND QT4_FOUND AND OPENGL_FOUND AND QGLVIEWER_FOUND)
else()
set(other_sources ${ARGN_TAIL})
endif()
qt4_generate_moc( "${CMAKE_CURRENT_SOURCE_DIR}/${plugin_implementation_base_name}.cpp" ${plugin_implementation_base_name}.moc )
qt4_generate_moc( ${plugin_implementation_base_name}.cpp "${CMAKE_CURRENT_BINARY_DIR}/${moc_file_name}" )
add_file_dependencies( ${plugin_implementation_base_name}.moc "${CMAKE_CURRENT_SOURCE_DIR}/${plugin_implementation_base_name}.cpp" )
add_library(${plugin_name} MODULE ${option} ${plugin_implementation_base_name}.moc ${plugin_implementation_base_name}.cpp ${other_sources})

View File

@ -1,8 +1,9 @@
// Copyright (c) 2006 GeometryFactory (France). All rights reserved.
// Copyright (c) 2006-2011 GeometryFactory (France). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you may redistribute it under
// the terms of the Q Public License version 1.0.
// See the file LICENSE.QPL distributed with CGAL.
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.

View File

@ -22,6 +22,12 @@ functions and functors.
}
\ccNestedType{Point_dimension_d}%
{Functor object type returning the dimension of a \ccc{Point_d}.
Must provide
\ccc{int operator()(Point_d p)} returning the dimension of $p$.
}
\ccNestedType{Compute_coordinate_d}%
{Functor object type returning the coordinates of a \ccc{Point_d}.
Must provide
@ -54,6 +60,7 @@ The following member functions to create instances of the above predicate
object types must exist.
\setlength\parskip{0mm}
\ccMemberFunction{Point_dimension_d point_dimension_d_object(); }{}
\ccMemberFunction{Compute_coordinate_d compute_coordinate_d_object(); }{}
\ccMemberFunction{Less_coordinate_d less_coordinate_d_object(); }{}

View File

@ -139,7 +139,7 @@ public:
template <class RandomAccessIterator>
void operator() (RandomAccessIterator begin, RandomAccessIterator end) const
{
_dimension = begin->dimension();
_dimension = _k.point_dimension_d_object()(*begin);
two_to_dim = 1;
Starting_position start(_dimension);

View File

@ -146,17 +146,16 @@ public:
template <class RandomAccessIterator>
void operator() (RandomAccessIterator begin, RandomAccessIterator end) const
{
K k;
_dimension = begin->dimension();
_dimension = _k.point_dimension_d_object()(*begin);
two_to_dim = 1;
Starting_position start(_dimension);
Corner min(_dimension),max(_dimension);
for (int i=0; i<_dimension; ++i)
min[i]=max[i]=to_double( k.compute_coordinate_d_object() (*begin,i) );
min[i]=max[i]=to_double( _k.compute_coordinate_d_object() (*begin,i) );
for(RandomAccessIterator it=begin+1; it<end; ++it){
for (int i=0; i<_dimension; ++i){
double d= to_double( k.compute_coordinate_d_object() (*it,i) );
double d= to_double( _k.compute_coordinate_d_object() (*it,i) );
if (d < min[i]) min[i] = d;
if (d > max[i]) max[i] = d;
}

View File

@ -297,7 +297,7 @@ int main ()
std::cout << " Sorting points... " << std::flush;
cost.reset();cost.start();
CGAL::hilbert_sort (v.begin(), v.end());
CGAL::hilbert_sort (v.begin(), v.end(),CGAL::Hilbert_sort_median_policy());
cost.stop();
std::cout << "done in "<<cost.time()<<"seconds." << std::endl;