mirror of https://github.com/CGAL/cgal
Clean whitespace / tabs in Spatial_sorting/include (cosmetic only)
This commit is contained in:
parent
902183b701
commit
5c41b10d2b
|
|
@ -26,7 +26,9 @@ namespace internal {
|
|||
hilbert_split (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
Cmp cmp = Cmp ())
|
||||
{
|
||||
if (begin >= end) return begin;
|
||||
if (begin >= end)
|
||||
return begin;
|
||||
|
||||
#if defined(CGAL_HILBERT_SORT_WITH_MEDIAN_POLICY_CROSS_PLATFORM_BEHAVIOR)
|
||||
RandomAccessIterator middle = begin + (end - begin) / 2;
|
||||
CGAL::nth_element (begin, middle, end, cmp);
|
||||
|
|
@ -36,9 +38,9 @@ namespace internal {
|
|||
std::nth_element (begin, middle, end, cmp);
|
||||
return middle;
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
} // namespace internal
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
#include <CGAL/config.h>
|
||||
#include <CGAL/tags.h>
|
||||
#include <functional>
|
||||
#include <cstddef>
|
||||
#include <CGAL/Hilbert_sort_base.h>
|
||||
|
||||
#include <boost/type_traits/is_convertible.hpp>
|
||||
|
|
@ -24,15 +22,18 @@
|
|||
#include <tbb/parallel_invoke.h>
|
||||
#endif
|
||||
|
||||
#include <functional>
|
||||
#include <cstddef>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class K, int x, bool up> struct Hilbert_cmp_2;
|
||||
|
||||
template <class K, int x>
|
||||
struct Hilbert_cmp_2<K,x,true>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_2,
|
||||
typename K::Point_2, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_2, typename K::Point_2, bool>
|
||||
{
|
||||
typedef typename K::Point_2 Point;
|
||||
K k;
|
||||
|
|
@ -45,8 +46,7 @@ namespace internal {
|
|||
|
||||
template <class K>
|
||||
struct Hilbert_cmp_2<K,0,false>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_2,
|
||||
typename K::Point_2, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_2, typename K::Point_2, bool>
|
||||
{
|
||||
typedef typename K::Point_2 Point;
|
||||
K k;
|
||||
|
|
@ -59,8 +59,7 @@ namespace internal {
|
|||
|
||||
template <class K>
|
||||
struct Hilbert_cmp_2<K,1,false>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_2,
|
||||
typename K::Point_2, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_2, typename K::Point_2, bool>
|
||||
{
|
||||
typedef typename K::Point_2 Point;
|
||||
K k;
|
||||
|
|
@ -70,7 +69,8 @@ namespace internal {
|
|||
return k.less_y_2_object() (p, q);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
template <class K, class ConcurrencyTag>
|
||||
class Hilbert_sort_median_2
|
||||
|
|
@ -84,8 +84,12 @@ private:
|
|||
Kernel _k;
|
||||
std::ptrdiff_t _limit;
|
||||
|
||||
template <int x, bool up> struct Cmp : public internal::Hilbert_cmp_2<Kernel,x,up>
|
||||
{ Cmp (const Kernel &k) : internal::Hilbert_cmp_2<Kernel,x,up> (k) {} };
|
||||
template <int x, bool up>
|
||||
struct Cmp
|
||||
: public internal::Hilbert_cmp_2<Kernel,x,up>
|
||||
{
|
||||
Cmp (const Kernel &k) : internal::Hilbert_cmp_2<Kernel,x,up> (k) {}
|
||||
};
|
||||
|
||||
public:
|
||||
Hilbert_sort_median_2 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1)
|
||||
|
|
@ -96,7 +100,8 @@ public:
|
|||
void recursive_sort (RandomAccessIterator begin, RandomAccessIterator end) const
|
||||
{
|
||||
const int y = (x + 1) % 2;
|
||||
if (end - begin <= _limit) return;
|
||||
if (end - begin <= _limit)
|
||||
return;
|
||||
|
||||
RandomAccessIterator m0 = begin, m4 = end;
|
||||
|
||||
|
|
@ -111,7 +116,8 @@ public:
|
|||
}
|
||||
|
||||
template <int x, bool upx, bool upy, class RandomAccessIterator>
|
||||
struct Recursive_sort {
|
||||
struct Recursive_sort
|
||||
{
|
||||
const Self& hs;
|
||||
RandomAccessIterator begin,end;
|
||||
|
||||
|
|
@ -152,7 +158,8 @@ public:
|
|||
"Parallel_tag is enabled but TBB is unavailable.");
|
||||
#else
|
||||
const int y = (x + 1) % 2;
|
||||
if (end - begin <= _limit) return;
|
||||
if (end - begin <= _limit)
|
||||
return;
|
||||
|
||||
RandomAccessIterator m0 = begin, m4 = end;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ namespace internal {
|
|||
|
||||
template <class K, int x>
|
||||
struct Hilbert_cmp_3<K,x,true>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3,
|
||||
typename K::Point_3, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3, typename K::Point_3, bool>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
K k;
|
||||
|
|
@ -45,8 +44,7 @@ namespace internal {
|
|||
|
||||
template <class K>
|
||||
struct Hilbert_cmp_3<K,0,false>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3,
|
||||
typename K::Point_3, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3, typename K::Point_3, bool>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
K k;
|
||||
|
|
@ -59,8 +57,7 @@ namespace internal {
|
|||
|
||||
template <class K>
|
||||
struct Hilbert_cmp_3<K,1,false>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3,
|
||||
typename K::Point_3, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3, typename K::Point_3, bool>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
K k;
|
||||
|
|
@ -73,8 +70,7 @@ namespace internal {
|
|||
|
||||
template <class K>
|
||||
struct Hilbert_cmp_3<K,2,false>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3,
|
||||
typename K::Point_3, bool>
|
||||
: public CGAL::cpp98::binary_function<typename K::Point_3, typename K::Point_3, bool>
|
||||
{
|
||||
typedef typename K::Point_3 Point;
|
||||
K k;
|
||||
|
|
@ -84,13 +80,13 @@ namespace internal {
|
|||
return k.less_z_3_object() (p, q);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
template <class K, class ConcurrencyTag>
|
||||
class Hilbert_sort_median_3
|
||||
{
|
||||
public:
|
||||
|
||||
typedef Hilbert_sort_median_3<K, ConcurrencyTag> Self;
|
||||
typedef K Kernel;
|
||||
typedef typename Kernel::Point_3 Point;
|
||||
|
|
@ -99,15 +95,18 @@ private:
|
|||
Kernel _k;
|
||||
std::ptrdiff_t _limit;
|
||||
|
||||
template <int x, bool up> struct Cmp : public internal::Hilbert_cmp_3<Kernel,x,up>
|
||||
{ Cmp (const Kernel &k) : internal::Hilbert_cmp_3<Kernel,x,up> (k) {} };
|
||||
template <int x, bool up>
|
||||
struct Cmp
|
||||
: public internal::Hilbert_cmp_3<Kernel,x,up>
|
||||
{
|
||||
Cmp (const Kernel &k) : internal::Hilbert_cmp_3<Kernel,x,up> (k) {}
|
||||
};
|
||||
|
||||
public:
|
||||
Hilbert_sort_median_3 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1)
|
||||
: _k(k), _limit (limit)
|
||||
{}
|
||||
|
||||
|
||||
template <int x, bool upx, bool upy, bool upz, class RandomAccessIterator>
|
||||
void recursive_sort (RandomAccessIterator begin, RandomAccessIterator end) const
|
||||
{
|
||||
|
|
@ -135,7 +134,8 @@ public:
|
|||
}
|
||||
|
||||
template <int x, bool upx, bool upy, bool upz, class RandomAccessIterator>
|
||||
struct Recursive_sort {
|
||||
struct Recursive_sort
|
||||
{
|
||||
const Self& hs;
|
||||
RandomAccessIterator begin,end;
|
||||
|
||||
|
|
@ -166,12 +166,10 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
template <int x, bool upx, bool upy, bool upz, class RandomAccessIterator>
|
||||
void sort (RandomAccessIterator begin, RandomAccessIterator end, Parallel_tag) const
|
||||
{
|
||||
#ifndef CGAL_LINKED_WITH_TBB
|
||||
|
||||
CGAL_USE(begin);
|
||||
CGAL_USE(end);
|
||||
CGAL_static_assertion_msg (!(boost::is_convertible<ConcurrencyTag, Parallel_tag>::value),
|
||||
|
|
@ -202,7 +200,6 @@ public:
|
|||
Recursive_sort<y, !upy, upz, !upx, RandomAccessIterator>(*this, m5, m6),
|
||||
Recursive_sort<y, !upy, upz, !upx, RandomAccessIterator>(*this, m6, m7),
|
||||
Recursive_sort<z, !upz, !upx, upy, RandomAccessIterator>(*this, m7, m8));
|
||||
|
||||
} else {
|
||||
recursive_sort<0, false, false, false>(begin, end);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ namespace internal {
|
|||
K k;
|
||||
int axe;
|
||||
bool orient;
|
||||
Hilbert_cmp_d (int a, bool o, const K &_k = K())
|
||||
: k(_k), axe(a), orient(o) {}
|
||||
Hilbert_cmp_d (int a, bool o, const K &_k = K()) : k(_k), axe(a), orient(o) {}
|
||||
|
||||
bool operator() (const Point &p, const Point &q) const
|
||||
{
|
||||
return (orient ? (k.less_coordinate_d_object() (q,p,axe) )
|
||||
|
|
@ -41,7 +41,7 @@ namespace internal {
|
|||
}
|
||||
};
|
||||
|
||||
}
|
||||
} // namespace internal
|
||||
|
||||
template <class K>
|
||||
class Hilbert_sort_median_d
|
||||
|
|
@ -57,9 +57,11 @@ private:
|
|||
mutable int _dimension;
|
||||
mutable int two_to_dim;
|
||||
|
||||
struct Cmp : public internal::Hilbert_cmp_d<Kernel>
|
||||
{ Cmp (int a, bool dir, const Kernel &k)
|
||||
: internal::Hilbert_cmp_d<Kernel> (a,dir,k) {} };
|
||||
struct Cmp
|
||||
: public internal::Hilbert_cmp_d<Kernel>
|
||||
{
|
||||
Cmp (int a, bool dir, const Kernel &k) : internal::Hilbert_cmp_d<Kernel> (a,dir,k) {}
|
||||
};
|
||||
|
||||
public:
|
||||
Hilbert_sort_median_d(const Kernel &k = Kernel(), std::ptrdiff_t limit = 1)
|
||||
|
|
@ -70,7 +72,8 @@ public:
|
|||
void sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
Starting_position start, int direction) const
|
||||
{
|
||||
if (end - begin <= _limit) return;
|
||||
if (end - begin <= _limit)
|
||||
return;
|
||||
|
||||
int nb_directions = _dimension;
|
||||
int nb_splits = two_to_dim;
|
||||
|
|
@ -129,7 +132,6 @@ public:
|
|||
sort( places[two_to_dim-1], places[two_to_dim], start, last_dir);
|
||||
}
|
||||
|
||||
|
||||
template <class RandomAccessIterator>
|
||||
void operator() (RandomAccessIterator begin, RandomAccessIterator end) const
|
||||
{
|
||||
|
|
@ -139,22 +141,21 @@ public:
|
|||
|
||||
typename std::iterator_traits<RandomAccessIterator>::difference_type N=end-begin;
|
||||
N*=2;
|
||||
for (int i=0; i<_dimension; ++i) start[i]=false; // we start below in all coordinates
|
||||
for (int i=0; i<_dimension; ++i)
|
||||
start[i]=false; // we start below in all coordinates
|
||||
|
||||
for (int i=0; i<_dimension; ++i) {
|
||||
two_to_dim *= 2; // compute 2^_dimension
|
||||
N/=2;
|
||||
if (N==0) break; // not many points, this number of dimension is enough
|
||||
if (N==0)
|
||||
break; // not many points, this number of dimension is enough
|
||||
}
|
||||
|
||||
|
||||
// we start with direction 0;
|
||||
sort (begin, end, start, 0);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif//CGAL_HILBERT_SORT_MEDIAN_d_H
|
||||
|
|
|
|||
|
|
@ -67,8 +67,8 @@ namespace internal {
|
|||
return to_double(k.compute_y_2_object()(p)) < value;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
template <class K>
|
||||
class Hilbert_sort_middle_2
|
||||
|
|
@ -81,8 +81,12 @@ private:
|
|||
Kernel _k;
|
||||
std::ptrdiff_t _limit;
|
||||
|
||||
template <int x, bool up> struct Cmp : public internal::Fixed_hilbert_cmp_2<Kernel,x,up>
|
||||
{ Cmp (double v, const Kernel &k) : internal::Fixed_hilbert_cmp_2<Kernel,x,up> (v, k) {} };
|
||||
template <int x, bool up>
|
||||
struct Cmp
|
||||
: public internal::Fixed_hilbert_cmp_2<Kernel,x,up>
|
||||
{
|
||||
Cmp (double v, const Kernel &k) : internal::Fixed_hilbert_cmp_2<Kernel,x,up> (v, k) {}
|
||||
};
|
||||
|
||||
public:
|
||||
Hilbert_sort_middle_2 (const Kernel &k = Kernel(), std::ptrdiff_t limit = 1)
|
||||
|
|
@ -101,12 +105,9 @@ public:
|
|||
|
||||
RandomAccessIterator m0 = begin, m4 = end;
|
||||
|
||||
RandomAccessIterator m2 =
|
||||
internal::fixed_hilbert_split (m0, m4, Cmp< x, upx> (xmed,_k));
|
||||
RandomAccessIterator m1 =
|
||||
internal::fixed_hilbert_split (m0, m2, Cmp< y, upy> (ymed,_k));
|
||||
RandomAccessIterator m3 =
|
||||
internal::fixed_hilbert_split (m2, m4, Cmp< y, !upy> (ymed,_k));
|
||||
RandomAccessIterator m2 = internal::fixed_hilbert_split (m0, m4, Cmp< x, upx> (xmed,_k));
|
||||
RandomAccessIterator m1 = internal::fixed_hilbert_split (m0, m2, Cmp< y, upy> (ymed,_k));
|
||||
RandomAccessIterator m3 = internal::fixed_hilbert_split (m2, m4, Cmp< y, !upy> (ymed,_k));
|
||||
|
||||
if (m1!=m4)
|
||||
sort<y, upy, upx> (m0, m1, ymin, xmin, ymed, xmed);
|
||||
|
|
@ -144,7 +145,6 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif//CGAL_HILBERT_SORT_MIDDLE_2_H
|
||||
|
|
|
|||
|
|
@ -24,11 +24,13 @@ namespace internal {
|
|||
fixed_hilbert_split (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
Cmp cmp = Cmp ())
|
||||
{
|
||||
if (begin >= end) return begin;
|
||||
if (begin >= end)
|
||||
return begin;
|
||||
|
||||
return std::partition (begin, end, cmp);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
//
|
||||
// Author(s) : Sebastien Loriot
|
||||
|
||||
|
||||
#ifndef CGAL_SPATIAL_SORT_TRAITS_ADAPTER_2_H
|
||||
#define CGAL_SPATIAL_SORT_TRAITS_ADAPTER_2_H
|
||||
|
||||
|
|
@ -19,13 +18,14 @@
|
|||
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
|
||||
namespace CGAL{
|
||||
|
||||
using ::get;
|
||||
|
||||
template<class Base_traits, class PointPropertyMap>
|
||||
class Spatial_sort_traits_adapter_2:public Base_traits{
|
||||
class Spatial_sort_traits_adapter_2
|
||||
: public Base_traits
|
||||
{
|
||||
PointPropertyMap ppmap_;
|
||||
public:
|
||||
Spatial_sort_traits_adapter_2(Base_traits base=Base_traits()):Base_traits(base){}
|
||||
|
|
@ -37,7 +37,9 @@ public:
|
|||
typedef typename boost::property_traits<PointPropertyMap>::key_type Point_2;
|
||||
typedef typename boost::call_traits<Point_2>::param_type Arg_type;
|
||||
|
||||
struct Less_x_2 : public Base_traits::Less_x_2{
|
||||
struct Less_x_2
|
||||
: public Base_traits::Less_x_2
|
||||
{
|
||||
Less_x_2(const PointPropertyMap& ppmap, const typename Base_traits::Less_x_2& base):
|
||||
Base_traits::Less_x_2(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -46,7 +48,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct Less_y_2 : public Base_traits::Less_y_2{
|
||||
struct Less_y_2
|
||||
: public Base_traits::Less_y_2
|
||||
{
|
||||
Less_y_2(const PointPropertyMap& ppmap, const typename Base_traits::Less_y_2& base):
|
||||
Base_traits::Less_y_2(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -59,7 +63,6 @@ public:
|
|||
Less_y_2 less_y_2_object () const {return Less_y_2(ppmap_, static_cast<const Gt*>(this)->less_y_2_object() );}
|
||||
|
||||
const PointPropertyMap& point_property_map() const {return ppmap_;}
|
||||
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -17,13 +17,14 @@
|
|||
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
|
||||
namespace CGAL{
|
||||
|
||||
using ::get;
|
||||
|
||||
template<class Base_traits, class PointPropertyMap>
|
||||
class Spatial_sort_traits_adapter_3:public Base_traits{
|
||||
class Spatial_sort_traits_adapter_3
|
||||
: public Base_traits
|
||||
{
|
||||
PointPropertyMap ppmap_;
|
||||
public:
|
||||
Spatial_sort_traits_adapter_3(Base_traits base=Base_traits()):Base_traits(base){}
|
||||
|
|
@ -35,7 +36,9 @@ public:
|
|||
typedef typename boost::property_traits<PointPropertyMap>::key_type Point_3;
|
||||
typedef typename boost::call_traits<Point_3>::param_type Arg_type;
|
||||
|
||||
struct Less_x_3 : public Base_traits::Less_x_3{
|
||||
struct Less_x_3
|
||||
: public Base_traits::Less_x_3
|
||||
{
|
||||
Less_x_3(const PointPropertyMap& ppmap, const typename Base_traits::Less_x_3& base):
|
||||
Base_traits::Less_x_3(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -44,7 +47,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct Less_y_3 : public Base_traits::Less_y_3{
|
||||
struct Less_y_3
|
||||
: public Base_traits::Less_y_3
|
||||
{
|
||||
Less_y_3(const PointPropertyMap& ppmap, const typename Base_traits::Less_y_3& base):
|
||||
Base_traits::Less_y_3(base),ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -53,7 +58,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct Less_z_3 : public Base_traits::Less_z_3{
|
||||
struct Less_z_3
|
||||
: public Base_traits::Less_z_3
|
||||
{
|
||||
Less_z_3(const PointPropertyMap& ppmap, const typename Base_traits::Less_z_3& base):
|
||||
Base_traits::Less_z_3(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -67,7 +74,6 @@ public:
|
|||
Less_z_3 less_z_3_object () const {return Less_z_3(ppmap_, static_cast<const Gt*>(this)->less_z_3_object() );}
|
||||
|
||||
const PointPropertyMap& point_property_map() const {return ppmap_;}
|
||||
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -22,7 +22,9 @@ namespace CGAL{
|
|||
using ::get;
|
||||
|
||||
template<class Base_traits, class PointPropertyMap>
|
||||
class Spatial_sort_traits_adapter_d:public Base_traits{
|
||||
class Spatial_sort_traits_adapter_d
|
||||
: public Base_traits
|
||||
{
|
||||
PointPropertyMap ppmap_;
|
||||
public:
|
||||
Spatial_sort_traits_adapter_d(Base_traits base=Base_traits()) : Base_traits(base){}
|
||||
|
|
@ -34,9 +36,9 @@ public:
|
|||
typedef typename boost::property_traits<PointPropertyMap>::key_type Point_d;
|
||||
typedef typename boost::call_traits<Point_d>::param_type Arg_type;
|
||||
|
||||
|
||||
|
||||
struct Point_dimension_d: public Base_traits::Point_dimension_d{
|
||||
struct Point_dimension_d
|
||||
: public Base_traits::Point_dimension_d
|
||||
{
|
||||
Point_dimension_d(const PointPropertyMap& ppmap, const typename Base_traits::Point_dimension_d& base):
|
||||
Base_traits::Point_dimension_d(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -45,7 +47,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
struct Less_coordinate_d: public Base_traits::Less_coordinate_d{
|
||||
struct Less_coordinate_d
|
||||
: public Base_traits::Less_coordinate_d
|
||||
{
|
||||
Less_coordinate_d(const PointPropertyMap& ppmap, const typename Base_traits::Less_coordinate_d& base):
|
||||
Base_traits::Less_coordinate_d(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -54,8 +58,9 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
struct Compute_coordinate_d: public Base_traits::Compute_coordinate_d{
|
||||
struct Compute_coordinate_d
|
||||
: public Base_traits::Compute_coordinate_d
|
||||
{
|
||||
Compute_coordinate_d(const PointPropertyMap& ppmap, const typename Base_traits::Compute_coordinate_d& base):
|
||||
Base_traits::Compute_coordinate_d(base), ppmap_(ppmap){}
|
||||
const PointPropertyMap& ppmap_;
|
||||
|
|
@ -64,14 +69,11 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Point_dimension_d point_dimension_d_object () const {return Point_dimension_d(ppmap_, static_cast<const Gt*>(this)->point_dimension_d_object() );}
|
||||
Less_coordinate_d less_coordinate_d_object () const {return Less_coordinate_d(ppmap_, static_cast<const Gt*>(this)->less_coordinate_d_object() );}
|
||||
Compute_coordinate_d compute_coordinate_d_object () const {return Compute_coordinate_d(ppmap_, static_cast<const Gt*>(this)->compute_coordinate_d_object() );}
|
||||
|
||||
const PointPropertyMap& point_property_map() const {return ppmap_;}
|
||||
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@
|
|||
#include <algorithm>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
||||
namespace internal {
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator, class Kernel, class Policy>
|
||||
|
|
@ -75,6 +73,7 @@ namespace internal {
|
|||
CGAL::cpp98::random_shuffle(begin,end, rng);
|
||||
(Hilbert_sort_d<Kernel, Policy> (k))(begin, end);
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator>
|
||||
|
|
@ -113,10 +112,8 @@ void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
|||
|
||||
internal::hilbert_sort<ConcurrencyTag>(begin, end, Kernel(), policy,
|
||||
static_cast<value_type *> (0));
|
||||
|
||||
}
|
||||
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator>
|
||||
void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
Hilbert_sort_middle_policy policy)
|
||||
|
|
@ -128,10 +125,8 @@ void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
|||
|
||||
internal::hilbert_sort<ConcurrencyTag>(begin, end, Kernel(), policy,
|
||||
static_cast<value_type *> (0));
|
||||
|
||||
}
|
||||
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator, class Kernel, class Policy>
|
||||
void hilbert_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k, Policy policy)
|
||||
|
|
|
|||
|
|
@ -42,8 +42,10 @@ void hilbert_sort_on_sphere (RandomAccessIterator begin,
|
|||
template <class RandomAccessIterator>
|
||||
void hilbert_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
double sq_r = 1.0,
|
||||
const typename CGAL::Kernel_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3 &p =
|
||||
typename CGAL::Kernel_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3(0,0,0))
|
||||
const typename CGAL::Kernel_traits<
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3 &p =
|
||||
typename CGAL::Kernel_traits<
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3(0,0,0))
|
||||
{
|
||||
|
||||
typedef std::iterator_traits<RandomAccessIterator> ITraits;
|
||||
|
|
@ -51,52 +53,51 @@ void hilbert_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator en
|
|||
typedef CGAL::Kernel_traits<value_type> KTraits;
|
||||
typedef typename KTraits::Kernel Kernel;
|
||||
|
||||
internal::hilbert_sort_on_sphere(begin, end, Kernel(), Hilbert_sort_median_policy(),
|
||||
static_cast<value_type *> (0), sq_r, p);
|
||||
|
||||
internal::hilbert_sort_on_sphere(begin, end, Kernel(), Hilbert_sort_median_policy(), static_cast<value_type *> (0), sq_r, p);
|
||||
}
|
||||
|
||||
template <class RandomAccessIterator>
|
||||
void hilbert_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator end, Hilbert_sort_median_policy policy,
|
||||
double sq_r = 1.0,
|
||||
const typename CGAL::Kernel_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3 &p =
|
||||
typename CGAL::Kernel_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3(0,0,0))
|
||||
const typename CGAL::Kernel_traits<
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3 &p =
|
||||
typename CGAL::Kernel_traits<
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3(0,0,0))
|
||||
{
|
||||
typedef std::iterator_traits<RandomAccessIterator> ITraits;
|
||||
typedef typename ITraits::value_type value_type;
|
||||
typedef CGAL::Kernel_traits<value_type> KTraits;
|
||||
typedef typename KTraits::Kernel Kernel;
|
||||
|
||||
internal::hilbert_sort_on_sphere(begin, end, Kernel(), policy,
|
||||
static_cast<value_type *> (0), sq_r, p);
|
||||
internal::hilbert_sort_on_sphere(begin, end, Kernel(), policy, static_cast<value_type *> (0), sq_r, p);
|
||||
}
|
||||
|
||||
|
||||
template <class RandomAccessIterator>
|
||||
void hilbert_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator end, Hilbert_sort_middle_policy policy,
|
||||
double sq_r = 1.0,
|
||||
const typename CGAL::Kernel_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3 &p =
|
||||
typename CGAL::Kernel_traits<typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3(0,0,0))
|
||||
const typename CGAL::Kernel_traits<
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3 &p =
|
||||
typename CGAL::Kernel_traits<
|
||||
typename std::iterator_traits<RandomAccessIterator>::value_type>::Kernel::Point_3(0,0,0))
|
||||
{
|
||||
typedef std::iterator_traits<RandomAccessIterator> ITraits;
|
||||
typedef typename ITraits::value_type value_type;
|
||||
typedef CGAL::Kernel_traits<value_type> KTraits;
|
||||
typedef typename KTraits::Kernel Kernel;
|
||||
|
||||
internal::hilbert_sort_on_sphere(begin, end, Kernel(), policy,
|
||||
static_cast<value_type *> (0), sq_r, p);
|
||||
internal::hilbert_sort_on_sphere(begin, end, Kernel(), policy, static_cast<value_type *> (0), sq_r, p);
|
||||
}
|
||||
|
||||
|
||||
template <class RandomAccessIterator, class Kernel, class Policy>
|
||||
void hilbert_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator end, const Kernel &k, Policy policy,
|
||||
double sq_r = 1.0, const typename Kernel::Point_3 &p = typename Kernel::Point_3(0,0,0))
|
||||
void hilbert_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k, Policy policy,
|
||||
double sq_r = 1.0,
|
||||
const typename Kernel::Point_3 &p = typename Kernel::Point_3(0,0,0))
|
||||
{
|
||||
typedef std::iterator_traits<RandomAccessIterator> ITraits;
|
||||
typedef typename ITraits::value_type value_type;
|
||||
|
||||
internal::hilbert_sort_on_sphere(begin, end,
|
||||
k, policy, static_cast<value_type *> (0), sq_r, p);
|
||||
internal::hilbert_sort_on_sphere(begin, end, k, policy, static_cast<value_type *> (0), sq_r, p);
|
||||
}
|
||||
|
||||
} // end of namespace CGAL
|
||||
|
|
|
|||
|
|
@ -253,7 +253,6 @@ struct Transform_coordinates_traits_3 {
|
|||
Compute_y compute_y_2_object() const { return Compute_y(); }
|
||||
};
|
||||
|
||||
|
||||
} } //namespace CGAL::internal
|
||||
|
||||
#endif // CGAL_INTERNAL_SCALE_COORDINATES_ADAPTOR_TRAITS_3_H
|
||||
|
|
|
|||
|
|
@ -30,8 +30,7 @@ namespace CGAL {
|
|||
namespace internal {
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator, class Policy, class Kernel>
|
||||
void spatial_sort (
|
||||
RandomAccessIterator begin, RandomAccessIterator end,
|
||||
void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k,
|
||||
Policy /*policy*/,
|
||||
typename Kernel::Point_2 *,
|
||||
|
|
@ -50,13 +49,11 @@ namespace internal {
|
|||
if (threshold_multiscale==0) threshold_multiscale=16;
|
||||
if (ratio==0.0) ratio=0.25;
|
||||
|
||||
(Multiscale_sort<Sort> (Sort (k, threshold_hilbert),
|
||||
threshold_multiscale, ratio)) (begin, end);
|
||||
(Multiscale_sort<Sort> (Sort (k, threshold_hilbert), threshold_multiscale, ratio)) (begin, end);
|
||||
}
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator, class Policy, class Kernel>
|
||||
void spatial_sort (
|
||||
RandomAccessIterator begin, RandomAccessIterator end,
|
||||
void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k,
|
||||
Policy /*policy*/,
|
||||
typename Kernel::Point_3 *,
|
||||
|
|
@ -75,13 +72,11 @@ namespace internal {
|
|||
if (threshold_multiscale==0) threshold_multiscale=64;
|
||||
if (ratio==0.0) ratio=0.125;
|
||||
|
||||
(Multiscale_sort<Sort> (Sort (k, threshold_hilbert),
|
||||
threshold_multiscale, ratio)) (begin, end);
|
||||
(Multiscale_sort<Sort> (Sort (k, threshold_hilbert), threshold_multiscale, ratio)) (begin, end);
|
||||
}
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator, class Policy, class Kernel>
|
||||
void spatial_sort (
|
||||
RandomAccessIterator begin, RandomAccessIterator end,
|
||||
void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k,
|
||||
Policy /*policy*/,
|
||||
typename Kernel::Point_d *,
|
||||
|
|
@ -100,13 +95,11 @@ namespace internal {
|
|||
if (threshold_multiscale==0) threshold_multiscale=500;
|
||||
if (ratio==0.0) ratio=0.05;
|
||||
|
||||
(Multiscale_sort<Sort> (Sort (k, threshold_hilbert),
|
||||
threshold_multiscale, ratio)) (begin, end);
|
||||
(Multiscale_sort<Sort> (Sort (k, threshold_hilbert), threshold_multiscale, ratio)) (begin, end);
|
||||
}
|
||||
|
||||
} //namespace internal
|
||||
|
||||
|
||||
template <class ConcurrencyTag = Sequential_tag, class RandomAccessIterator, class Policy, class Kernel>
|
||||
void spatial_sort (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k,
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ namespace CGAL {
|
|||
namespace internal {
|
||||
|
||||
template <class RandomAccessIterator, class Policy, class Kernel>
|
||||
void spatial_sort_on_sphere (
|
||||
RandomAccessIterator begin, RandomAccessIterator end,
|
||||
void spatial_sort_on_sphere (RandomAccessIterator begin, RandomAccessIterator end,
|
||||
const Kernel &k,
|
||||
Policy /*policy*/,
|
||||
typename Kernel::Point_3 *,
|
||||
|
|
|
|||
Loading…
Reference in New Issue