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