88 #ifndef RFC_IN_PLACE_LIST_N_H
89 #define RFC_IN_PLACE_LIST_N_H 1
102 template <
class T,
int n=1>
158 #ifdef CGAL_CFG_NO_ITERATOR_TRAITS
159 #ifndef CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT
161 inline std::bidirectional_iterator_tag
163 return std::bidirectional_iterator_tag();
171 inline std::ptrdiff_t*
173 return (std::ptrdiff_t*)(0);
175 #endif // CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT
176 #endif // CGAL_CFG_NO_ITERATOR_TRAITS //
178 template <
class T,
bool managed>
290 x.next_link[
dim] = position.
node;
291 x.prev_link[
dim] = (*position.
node).prev_link[
dim];
292 (*((*position.
node).prev_link[
dim])).next_link[dim] = &x;
293 (*position.
node).prev_link[dim] = &x;
317 template <
class InputIterator>
320 while (first != last)
324 template <
class InputIterator>
325 void insert(T* pos, InputIterator first, InputIterator last) {
327 while (first != last)
331 void insert(T* pos,
const T* first,
const T* last) {
342 (*((*i.
node).prev_link[
dim])).next_link[dim] = (*i.
node).next_link[
dim];
343 (*((*i.
node).next_link[dim])).prev_link[dim] = (*i.
node).prev_link[
dim];
379 template <
class InputIterator>
411 template <
class InputIterator>
412 void assign( InputIterator first, InputIterator last) {
425 else if ( sz <
size()) {
444 return std::lexicographical_compare(
begin(),
end(),
456 (*((*last.
node).prev_link[
dim])).next_link[dim] = position.
node;
458 (*((*position.
node).prev_link[dim])).next_link[dim] = first.
node;
459 T* tmp = (*position.
node).prev_link[
dim];
460 (*position.
node).prev_link[dim] = (*last.
node).prev_link[
dim];
461 (*last.
node).prev_link[dim] = (*first.
node).prev_link[
dim];
462 (*first.
node).prev_link[dim] = tmp;
484 if (position == i || position == ++j)
return;
501 std::distance(first, last, n);
512 void remove(
const T& value);
536 template <
class T,
bool managed>
540 insert(position, *get_node());
543 template <
class T,
bool managed>
547 insert(position, *get_node(x));
550 template <
class T,
bool managed>
554 while (first != last)
558 template <
class T,
bool managed>
568 while (first1 != last1 && first2 != last2) {
571 T* tmp1 = (*first1).next_link[dim];
572 T* tmp2 = (*first1).prev_link[dim];
574 (*first1).next_link[dim] = tmp1;
575 (*first1).prev_link[dim] = tmp2;
579 erase(first1, last1);
581 insert(last1, first2, last2);
586 template <
class T,
bool managed>
591 while( first != last) {
596 (*node).next_link[dim] =
node;
597 (*node).prev_link[dim] =
node;
600 template <
class T,
bool managed>
604 while (first != last) {
613 template <
class T,
bool managed>
615 if (size() < 2)
return;
616 for (
iterator first = ++begin(); first != end();) {
618 transfer(begin(), old, first);
622 template <
class T,
bool managed>
626 if (first == last)
return;
628 while (++next != last) {
637 template <
class T,
bool managed>
643 while (first1 != last1 && first2 != last2)
644 if (*first2 < *first1) {
646 transfer(first1, first2, ++next);
651 transfer(last1, first2, last2);
656 template <
class T,
bool managed>
658 if (size() < 2)
return;
665 while(i < fill && !counter[i].
empty()) {
667 carry.
swap(counter[i++]);
669 carry.
swap(counter[i]);
673 for (
int i = 1;
i < fill; ++
i)
674 counter[
i].
merge(counter[
i-1]);
675 swap(counter[fill-1]);
683 #endif // RFC_IN_PLACE_LIST_N_H //
void splice(iterator position, Self &x)
_In_place_list_n_iterator< const T > const_iterator
std::reverse_iterator< const_iterator > const_reverse_iterator
void swap(int &a, int &b)
bool operator>(const Self &i) const
In_place_list_n(const T *first, const T *last, int d=0)
bool operator!=(const Self &y) const
void transfer(iterator position, iterator first, iterator last)
const_iterator end() const
void insert(T *pos, size_type n)
In_place_list_n(size_type n, const T &value, int d=0)
iterator insert(T *pos, T &x)
size_type max_size() const
void assign(size_type n, const T &t)
void int int REAL REAL * y
void insert(T *pos, InputIterator first, InputIterator last)
const_reference back() const
In_place_list_n(const Self &x)
std::reverse_iterator< iterator > reverse_iterator
bool operator!=(const Self &x) const
boolean empty(T_VertexSet s)
_In_place_list_n_iterator< T > iterator
void splice(iterator pos, Self &x, iterator first, iterator last)
void assign(InputIterator first, InputIterator last)
void splice(T *p, Self &x, T *first, T *last)
_In_place_list_n_iterator(T *x, int d=0)
In_place_list_n< T, managed > Self
void set_dimension(int d)
double length(Vector3D *const v, int n)
_In_place_list_n_iterator(int d=0)
#define RFC_END_NAME_SPACE
void resize(size_type sz, T c=T())
void insert(T *pos, size_type n, const T &x=T())
void splice(iterator position, Self &x, iterator i)
#define RFC_BEGIN_NAME_SPACE
void erase(T *first, T *last)
static bool equal(const Bbox_3 &b1, const Bbox_3 &b2, Real tol_r)
In_place_list_n(InputIterator first, InputIterator last, int d=0)
reverse_iterator rbegin()
void splice(T *position, Self &x, T *i)
const_reverse_iterator rbegin() const
_In_place_list_n_iterator< T > Self
bool operator>=(const Self &i) const
std::bidirectional_iterator_tag iterator_category
bool operator<(const Self &y) const
const_iterator begin() const
void remove(const T &value)
const_reverse_iterator rend() const
const_reference front() const
std::ptrdiff_t difference_type
bool operator==(const Self &y) const
const T & const_reference
std::ptrdiff_t difference_type
*********************************************************************Illinois Open Source License ****University of Illinois NCSA **Open Source License University of Illinois All rights reserved ****Developed free of to any person **obtaining a copy of this software and associated documentation to deal with the Software without including without limitation the rights to merge
void insert(T *pos, const T *first, const T *last)
bool operator==(const Self &x) const
iterator insert(iterator position, T &x)
void splice(T *position, Self &x)
void insert(iterator pos, InputIterator first, InputIterator last)
bool operator<=(const Self &i) const
Self & operator=(const Self &x)