Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Re: Hilbert Sort on a User Defined Point

Subject: CGAL users discussion list

List archive

[cgal-discuss] Re: Hilbert Sort on a User Defined Point


Chronological Thread 
  • From: Derek <>
  • To:
  • Subject: [cgal-discuss] Re: Hilbert Sort on a User Defined Point
  • Date: Tue, 10 Aug 2010 07:30:50 -0700 (PDT)


Here's the complex error massage:

In file included from
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/algorithm:62,
from nn_test.h:24,
from nn_test.cc:10:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:
In function ‘const _Tp& std::__median(const _Tp&, const _Tp&, const _Tp&)
[with _Tp = Point3]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2268:

instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Size = int]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5220:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:89:
error: no match for ‘operator<’ in ‘__a < __b’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:90:
error: no match for ‘operator<’ in ‘__b < __c’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:92:
error: no match for ‘operator<’ in ‘__a < __c’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:96:
error: no match for ‘operator<’ in ‘__a < __c’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:98:
error: no match for ‘operator<’ in ‘__b < __c’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:
In function ‘_RandomAccessIterator
std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator,
_Tp) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Point3*,
std::vector<Point3, std::allocator<Point3> > >, _Tp = Point3]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2268:

instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Size = int]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5220:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2209:
error: no match for ‘operator<’ in
‘__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
[with _Iterator = Point3*, _Container = std::vector<Point3,
std::allocator<Point3> >]() < __pivot’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2268:

instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Size = int]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5220:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2212:
error: no match for ‘operator<’ in ‘__pivot <
__last.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with
_Iterator = Point3*, _Container = std::vector<Point3, std::allocator<Point3>
>]()’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:
In function ‘void std::__insertion_sort(_RandomAccessIterator,
_RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2178:

instantiated from ‘void std::__final_insertion_sort(_RandomAccessIterator,
_RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5222:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2106:
error: no match for ‘operator<’ in ‘__val <
__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with
_Iterator = Point3*, _Container = std::vector<Point3, std::allocator<Point3>
>]()’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:
In function ‘void std::__heap_select(_RandomAccessIterator,
_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5067:

instantiated from ‘void std::partial_sort(_RAIter, _RAIter, _RAIter) [with
_RAIter = __gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2256:

instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Size = int]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5220:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:1906:
error: no match for ‘operator<’ in
‘__i.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with
_Iterator = Point3*, _Container = std::vector<Point3, std::allocator<Point3>
>]() < __first.__gnu_cxx::__normal_iterator<_Iterator,
_Container>::operator* [with _Iterator = Point3*, _Container =
std::vector<Point3, std::allocator<Point3> >]()’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:
In function ‘void std::__unguarded_linear_insert(_RandomAccessIterator, _Tp)
[with _RandomAccessIterator = __gnu_cxx::__normal_iterator<Point3*,
std::vector<Point3, std::allocator<Point3> > >, _Tp = Point3]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2112:

instantiated from ‘void std::__insertion_sort(_RandomAccessIterator,
_RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2178:

instantiated from ‘void std::__final_insertion_sort(_RandomAccessIterator,
_RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5222:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2067:
error: no match for ‘operator<’ in ‘__val <
__next.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator* [with
_Iterator = Point3*, _Container = std::vector<Point3, std::allocator<Point3>
>]()’
In file included from
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:62,
from
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/algorithm:62,
from nn_test.h:24,
from nn_test.cc:10:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:
In function ‘void std::__adjust_heap(_RandomAccessIterator, _Distance,
_Distance, _Tp) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Distance = int, _Tp = Point3]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:394:

instantiated from ‘void std::make_heap(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:1904:

instantiated from ‘void std::__heap_select(_RandomAccessIterator,
_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5067:

instantiated from ‘void std::partial_sort(_RAIter, _RAIter, _RAIter) [with
_RAIter = __gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2256:

instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Size = int]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5220:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:232:
error: no match for ‘operator<’ in
‘__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+
[with _Iterator = Point3*, _Container = std::vector<Point3,
std::allocator<Point3> >](((const ptrdiff_t&)((const ptrdiff_t*)(&
__secondChild)))).__gnu_cxx::__normal_iterator<_Iterator,
_Container>::operator* [with _Iterator = Point3*, _Container =
std::vector<Point3, std::allocator<Point3> >]() <
__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+ [with
_Iterator = Point3*, _Container = std::vector<Point3, std::allocator<Point3>
>](((const ptrdiff_t&)((const ptrdiff_t*)(&(__secondChild +
-0x000000001))))).__gnu_cxx::__normal_iterator<_Iterator,
_Container>::operator* [with _Iterator = Point3*, _Container =
std::vector<Point3, std::allocator<Point3> >]()’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:
In function ‘void std::__push_heap(_RandomAccessIterator, _Distance,
_Distance, _Tp) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Distance = int, _Tp = Point3]’:
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:244:

instantiated from ‘void std::__adjust_heap(_RandomAccessIterator, _Distance,
_Distance, _Tp) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Distance = int, _Tp = Point3]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:394:

instantiated from ‘void std::make_heap(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:1904:

instantiated from ‘void std::__heap_select(_RandomAccessIterator,
_RandomAccessIterator, _RandomAccessIterator) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5067:

instantiated from ‘void std::partial_sort(_RAIter, _RAIter, _RAIter) [with
_RAIter = __gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:2256:

instantiated from ‘void std::__introsort_loop(_RandomAccessIterator,
_RandomAccessIterator, _Size) [with _RandomAccessIterator =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >, _Size = int]’
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_algo.h:5220:

instantiated from ‘void std::sort(_RAIter, _RAIter) [with _RAIter =
__gnu_cxx::__normal_iterator<Point3*, std::vector<Point3,
std::allocator<Point3> > >]’
nn_test.cc:327: instantiated from here
/usr/lib/gcc/i586-redhat-linux/4.4.1/../../../../include/c++/4.4.1/bits/stl_heap.h:134:
error: no match for ‘operator<’ in
‘__first.__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator+
[with _Iterator = Point3*, _Container = std::vector<Point3,
std::allocator<Point3> >](((const ptrdiff_t&)((const ptrdiff_t*)(&
__parent)))).__gnu_cxx::__normal_iterator<_Iterator, _Container>::operator*
[with _Iterator = Point3*, _Container = std::vector<Point3,
std::allocator<Point3> >]() < __value’
make: *** [nn_test.o] Error 1

The class I am using for traits is:

class Spatial_sorting_traits
{
public:
typedef Point3 Point_3;

Spatial_sorting_traits() {}

Spatial_sorting_traits(Spatial_sorting_traits &) {}

struct Less_x_3
{
bool operator()(const Point_3 &p1, const Point_3 &p2)
{
return p1.x() < p2.x();
}
};
struct Less_y_3
{
bool operator()(const Point_3 &p1, const Point_3 &p2)
{
return p1.y() < p2.y();
}
};
struct Less_z_3
{
bool operator()(const Point_3 &p1, const Point_3 &p2)
{
return p1.z() < p2.z();
}
};

Less_x_3 less_x_3_object() const
{
return Less_x_3();
}
Less_y_3 less_y_3_object() const
{
return Less_y_3();
}
Less_z_3 less_z_3_object() const
{
return Less_z_3();
}
};

I pass this into Hilbert_sort_3 as the Traits. I'm pretty sure that my
problem is the CGAL kernel. I don't know how to give my class the model for
a CGAL Kernel. Should I have Spatial_sorting_traits extend the Kernel I use
for my point (which is just a simple one I wrote for my point class)?
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Hilbert-Sort-on-a-User-Defined-Point-tp2318793p2319878.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page