Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
In_place_list_n< T, managed > Class Template Reference

#include <In_place_list_n.h>

Public Types

typedef T value_type
 
typedef T * pointer
 
typedef const T * const_pointer
 
typedef T & reference
 
typedef const T & const_reference
 
typedef std::size_t size_type
 
typedef std::ptrdiff_t difference_type
 
typedef
_In_place_list_n_iterator< T > 
iterator
 
typedef
_In_place_list_n_iterator
< const T > 
const_iterator
 
typedef std::reverse_iterator
< iterator
reverse_iterator
 
typedef std::reverse_iterator
< const_iterator
const_reverse_iterator
 
typedef In_place_list_n< T,
managed > 
Self
 

Public Member Functions

 In_place_list_n (int d=0)
 
void set_dimension (int d)
 
void swap (Self &x)
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
bool empty () const
 
size_type size () const
 
size_type max_size () const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
iterator insert (iterator position, T &x)
 
iterator insert (T *pos, T &x)
 
void push_front (T &x)
 
void push_back (T &x)
 
void insert (iterator position, size_type n)
 
void insert (iterator position, size_type n, const T &x)
 
void insert (T *pos, size_type n)
 
void insert (T *pos, size_type n, const T &x=T())
 
template<class InputIterator >
void insert (iterator pos, InputIterator first, InputIterator last)
 
template<class InputIterator >
void insert (T *pos, InputIterator first, InputIterator last)
 
void insert (T *pos, const T *first, const T *last)
 
void erase (iterator i)
 
void erase (T *pos)
 
void pop_front ()
 
void pop_back ()
 
void erase (iterator first, iterator last)
 
void erase (T *first, T *last)
 
void clear ()
 
 In_place_list_n (size_type n, const T &value, int d=0)
 
template<class InputIterator >
 In_place_list_n (InputIterator first, InputIterator last, int d=0)
 
 In_place_list_n (const T *first, const T *last, int d=0)
 
 In_place_list_n (const Self &x)
 
 ~In_place_list_n ()
 
Selfoperator= (const Self &x)
 
void destroy ()
 
template<class InputIterator >
void assign (InputIterator first, InputIterator last)
 
void assign (size_type n, const T &t)
 
void resize (size_type sz, T c=T())
 
bool operator== (const Self &y) const
 
bool operator!= (const Self &y) const
 
bool operator< (const Self &y) const
 
bool operator> (const Self &i) const
 
bool operator<= (const Self &i) const
 
bool operator>= (const Self &i) const
 
void splice (iterator position, Self &x)
 
void splice (T *position, Self &x)
 
void splice (iterator position, Self &x, iterator i)
 
void splice (T *position, Self &x, T *i)
 
void splice (iterator pos, Self &x, iterator first, iterator last)
 
void splice (T *p, Self &x, T *first, T *last)
 
void remove (const T &value)
 
void reverse ()
 
void unique ()
 
void merge (Self &x)
 
void sort ()
 

Protected Member Functions

T * get_node ()
 
T * get_node (const T &t)
 
void put_node (T *p)
 
void transfer (iterator position, iterator first, iterator last)
 

Protected Attributes

T * node
 
std::size_t length
 
int dim
 

Detailed Description

template<class T, bool managed = false>
class In_place_list_n< T, managed >

Definition at line 100 of file In_place_list_n.h.

Member Typedef Documentation

Definition at line 235 of file In_place_list_n.h.

typedef const T* const_pointer

Definition at line 228 of file In_place_list_n.h.

typedef const T& const_reference

Definition at line 230 of file In_place_list_n.h.

typedef std::reverse_iterator<const_iterator> const_reverse_iterator

Definition at line 238 of file In_place_list_n.h.

typedef std::ptrdiff_t difference_type

Definition at line 232 of file In_place_list_n.h.

Definition at line 234 of file In_place_list_n.h.

typedef T* pointer

Definition at line 227 of file In_place_list_n.h.

typedef T& reference

Definition at line 229 of file In_place_list_n.h.

typedef std::reverse_iterator<iterator> reverse_iterator

Definition at line 237 of file In_place_list_n.h.

typedef In_place_list_n<T,managed> Self

Definition at line 240 of file In_place_list_n.h.

typedef std::size_t size_type

Definition at line 231 of file In_place_list_n.h.

typedef T value_type

Definition at line 226 of file In_place_list_n.h.

Constructor & Destructor Documentation

In_place_list_n ( int  d = 0)
inlineexplicit

Definition at line 246 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::get_node(), and In_place_list_n< T, managed >::node.

246  : length(0), dim(d) {
247  // introduces an empty list.
248  node = get_node();
249  (*node).next_link[dim] = node;
250  (*node).prev_link[dim] = node;
251  }
const NT & d
Definition: adj.h:150
std::size_t length

Here is the call graph for this function:

In_place_list_n ( size_type  n,
const T &  value,
int  d = 0 
)
inlineexplicit

Definition at line 370 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::get_node(), In_place_list_n< T, managed >::insert(), and In_place_list_n< T, managed >::node.

370  : length(0), dim(d) {
371  // introduces a list with n items, all initialized with copies of
372  // value.
373  node = get_node();
374  (*node).next_link[dim] = node;
375  (*node).prev_link[dim] = node;
376  insert(begin(), n, value);
377  }
const NT & d
Definition: adj.h:150
std::size_t length
const NT & n
iterator insert(iterator position, T &x)

Here is the call graph for this function:

In_place_list_n ( InputIterator  first,
InputIterator  last,
int  d = 0 
)
inline

Definition at line 380 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::get_node(), In_place_list_n< T, managed >::insert(), and In_place_list_n< T, managed >::node.

380  : length(0), dim(d) {
381  // a list with copies from the range [`first,last').
382  node = get_node();
383  (*node).next_link[dim] = node;
384  (*node).prev_link[dim] = node;
385  insert( begin(), first, last);
386  }
const NT & d
Definition: adj.h:150
std::size_t length
iterator insert(iterator position, T &x)

Here is the call graph for this function:

In_place_list_n ( const T *  first,
const T *  last,
int  d = 0 
)
inline

Definition at line 388 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::get_node(), In_place_list_n< T, managed >::insert(), and In_place_list_n< T, managed >::node.

388  : length(0), dim(d) {
389  // a list with copies from the range [`first,last').
390  node = get_node();
391  (*node).next_link[dim] = node;
392  (*node).prev_link[dim] = node;
393  insert(begin(), first, last);
394  }
const NT & d
Definition: adj.h:150
std::size_t length
iterator insert(iterator position, T &x)

Here is the call graph for this function:

In_place_list_n ( const Self x)
inline

Definition at line 395 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::get_node(), In_place_list_n< T, managed >::insert(), and In_place_list_n< T, managed >::node.

395  : length(0), dim(x.dim) {
396  // copy constructor. Each item in `l1' is copied.
397  node = get_node();
398  (*node).next_link[dim] = node;
399  (*node).prev_link[dim] = node;
400  insert(begin(), x.begin(), x.end());
401  }
Definition: adj.h:150
std::size_t length
void int int REAL * x
Definition: read.cpp:74
iterator insert(iterator position, T &x)

Here is the call graph for this function:

~In_place_list_n ( )
inline

Definition at line 402 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::erase(), and In_place_list_n< T, managed >::put_node().

402  {
403  erase(begin(), end());
404  put_node(node);
405  }
Definition: adj.h:150
void put_node(T *p)
void erase(iterator i)

Here is the call graph for this function:

Member Function Documentation

void assign ( InputIterator  first,
InputIterator  last 
)
inline

Definition at line 412 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::erase(), and In_place_list_n< T, managed >::insert().

412  {
413  erase( begin(), end());
414  insert( begin(), first, last);
415  }
void erase(iterator i)
iterator insert(iterator position, T &x)

Here is the call graph for this function:

void assign ( size_type  n,
const T &  t 
)
inline

Definition at line 417 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::erase(), and In_place_list_n< T, managed >::insert().

417  {
418  erase( begin(), end());
419  insert( begin(), n, t);
420  }
const NT & n
void erase(iterator i)
iterator insert(iterator position, T &x)

Here is the call graph for this function:

reference back ( )
inline
const_reference back ( ) const
inline

Definition at line 283 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim.

283 { return *node->prev_link[dim]; }
Definition: adj.h:150
const_iterator begin ( ) const
inline

Definition at line 263 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim.

263 { return const_iterator(node->next_link[dim],dim); }
_In_place_list_n_iterator< const T > const_iterator
Definition: adj.h:150
void clear ( )
inline

Definition at line 366 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), and In_place_list_n< T, managed >::erase().

366 { erase( begin(), end()); }
void erase(iterator i)

Here is the call graph for this function:

void destroy ( )

Definition at line 588 of file In_place_list_n.h.

References i, Mesquite::length(), and _In_place_list_n_iterator< T >::node.

588  {
589  iterator first = begin();
590  iterator last = end();
591  while( first != last) {
592  iterator i = first++;
593  put_node(i.node);
594  }
595  length = 0;
596  (*node).next_link[dim] = node;
597  (*node).prev_link[dim] = node;
598 }
_In_place_list_n_iterator< T > iterator
std::size_t length
void put_node(T *p)
blockLoc i
Definition: read.cpp:79

Here is the call graph for this function:

const_iterator end ( ) const
inline

Definition at line 265 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim.

265 { return const_iterator(node,dim); }
_In_place_list_n_iterator< const T > const_iterator
Definition: adj.h:150
void erase ( iterator  i)
inline

Definition at line 339 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::length, _In_place_list_n_iterator< T >::node, In_place_list_n< T, managed >::put_node(), and RFC_assertion.

Referenced by In_place_list_n< T, managed >::assign(), In_place_list_n< T, managed >::clear(), In_place_list_n< T, managed >::erase(), In_place_list_n< T, managed >::pop_back(), In_place_list_n< T, managed >::pop_front(), In_place_list_n< T, managed >::resize(), and In_place_list_n< T, managed >::~In_place_list_n().

339  {
340  // removes the item from list `l', where `pos' refers to.
341  RFC_assertion( length > 0);
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];
344  if (managed)
345  put_node(i.node);
346  --length;
347  }
std::size_t length
void put_node(T *p)
blockLoc i
Definition: read.cpp:79
#define RFC_assertion
Definition: rfc_basic.h:65

Here is the call graph for this function:

Here is the caller graph for this function:

void erase ( T *  pos)
inline

Definition at line 348 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::erase().

Referenced by In_place_list_n< T, managed >::erase().

348 { erase( iterator( pos,dim)); }
_In_place_list_n_iterator< T > iterator
void erase(iterator i)

Here is the call graph for this function:

Here is the caller graph for this function:

void erase ( iterator  first,
iterator  last 
)

Definition at line 552 of file In_place_list_n.h.

553  {
554  while (first != last)
555  erase(first++);
556 }
void erase(iterator i)
void erase ( T *  first,
T *  last 
)
inline

Definition at line 362 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::erase().

362  {
363  erase( iterator(first,dim), iterator(last,dim));
364  }
_In_place_list_n_iterator< T > iterator
void erase(iterator i)

Here is the call graph for this function:

reference front ( )
inline

Definition at line 280 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin().

Referenced by Overlay::get_next_inode_ccw(), Overlay::get_next_inode_cw(), Overlay::insert_node_in_blue_edge(), Overlay::intersect_blue_with_green(), Overlay::project_adjacent_green_vertices(), and Overlay::verify_inode().

280 { return *begin(); }

Here is the call graph for this function:

Here is the caller graph for this function:

const_reference front ( ) const
inline

Definition at line 281 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin().

281 { return *begin(); }

Here is the call graph for this function:

T* get_node ( )
inlineprotected

Definition at line 185 of file In_place_list_n.h.

Referenced by In_place_list_n< T, managed >::In_place_list_n(), and In_place_list_n< T, managed >::insert().

185 { return new T;}

Here is the caller graph for this function:

T* get_node ( const T &  t)
inlineprotected

Definition at line 186 of file In_place_list_n.h.

186 { return new T(t);}
iterator insert ( iterator  position,
T &  x 
)
inline

Definition at line 287 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::length, and _In_place_list_n_iterator< T >::node.

Referenced by In_place_list_n< T, managed >::assign(), In_place_list_n< T, managed >::In_place_list_n(), In_place_list_n< T, managed >::insert(), In_place_list_n< T, managed >::push_back(), In_place_list_n< T, managed >::push_front(), and In_place_list_n< T, managed >::resize().

287  {
288  // inserts `t' in front of iterator `pos'. The return value points
289  // to the inserted item.
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;
294  ++length;
295  return iterator(&x,dim);
296  }
_In_place_list_n_iterator< T > iterator
std::size_t length
void int int REAL * x
Definition: read.cpp:74

Here is the caller graph for this function:

iterator insert ( T *  pos,
T &  x 
)
inline

Definition at line 297 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::insert().

297  {
298  return insert( iterator(pos,dim), x);
299  }
_In_place_list_n_iterator< T > iterator
void int int REAL * x
Definition: read.cpp:74
iterator insert(iterator position, T &x)

Here is the call graph for this function:

void insert ( iterator  position,
size_type  n 
)

Definition at line 538 of file In_place_list_n.h.

538  {
539  while (n--)
540  insert(position, *get_node());
541 }
const NT & n
iterator insert(iterator position, T &x)
void insert ( iterator  position,
size_type  n,
const T &  x 
)

Definition at line 545 of file In_place_list_n.h.

545  {
546  while (n--)
547  insert(position, *get_node(x));
548 }
void int int REAL * x
Definition: read.cpp:74
const NT & n
iterator insert(iterator position, T &x)
void insert ( T *  pos,
size_type  n 
)
inline

Definition at line 312 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::insert().

Referenced by In_place_list_n< T, managed >::insert().

312 { insert( iterator(pos,dim), n); }
_In_place_list_n_iterator< T > iterator
const NT & n
iterator insert(iterator position, T &x)

Here is the call graph for this function:

Here is the caller graph for this function:

void insert ( T *  pos,
size_type  n,
const T &  x = T() 
)
inline

Definition at line 313 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::insert(), and x.

313  {
314  insert( iterator(pos,dim), n, x);
315  }
_In_place_list_n_iterator< T > iterator
void int int REAL * x
Definition: read.cpp:74
const NT & n
iterator insert(iterator position, T &x)

Here is the call graph for this function:

void insert ( iterator  pos,
InputIterator  first,
InputIterator  last 
)
inline

Definition at line 318 of file In_place_list_n.h.

References In_place_list_n< T, managed >::get_node(), and In_place_list_n< T, managed >::insert().

318  {
319  // inserts the range [`first, last') in front of iterator `pos'.
320  while (first != last)
321  insert(pos, *get_node(*first++));
322  }
iterator insert(iterator position, T &x)

Here is the call graph for this function:

void insert ( T *  pos,
InputIterator  first,
InputIterator  last 
)
inline

Definition at line 325 of file In_place_list_n.h.

References In_place_list_n< T, managed >::get_node(), and In_place_list_n< T, managed >::insert().

325  {
326  // inserts the range [`first, last') in front of iterator `pos'.
327  while (first != last)
328  insert(pos, *get_node(*first++));
329  }
iterator insert(iterator position, T &x)

Here is the call graph for this function:

void insert ( T *  pos,
const T *  first,
const T *  last 
)
inline

Definition at line 331 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::insert().

331  {
332  insert( iterator(pos,dim), const_iterator(first,dim),
333  const_iterator(last,dim));
334  }
_In_place_list_n_iterator< const T > const_iterator
_In_place_list_n_iterator< T > iterator
iterator insert(iterator position, T &x)

Here is the call graph for this function:

size_type max_size ( ) const
inline

Definition at line 278 of file In_place_list_n.h.

278 { return size_type(-1); }
std::size_t size_type
void merge ( Self x)

Definition at line 638 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::length, and Mesquite::length().

Referenced by In_place_list_n< T, managed >::sort().

638  {
639  iterator first1 = begin();
640  iterator last1 = end();
641  iterator first2 = x.begin();
642  iterator last2 = x.end();
643  while (first1 != last1 && first2 != last2)
644  if (*first2 < *first1) {
645  iterator next = first2;
646  transfer(first1, first2, ++next);
647  first2 = next;
648  } else
649  ++first1;
650  if (first2 != last2)
651  transfer(last1, first2, last2);
652  length += x.length;
653  x.length= 0;
654 }
void transfer(iterator position, iterator first, iterator last)
_In_place_list_n_iterator< T > iterator
std::size_t length
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

bool operator!= ( const Self y) const
inline

Definition at line 439 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), equal(), and In_place_list_n< T, managed >::size().

439  {
440  return size() != y.size() || ! std::equal(begin(),end(),y.begin());
441  }
void int int REAL REAL * y
Definition: read.cpp:74
size_type size() const
static bool equal(const Bbox_3 &b1, const Bbox_3 &b2, Real tol_r)
Definition: Overlay_1d.C:87

Here is the call graph for this function:

bool operator< ( const Self y) const
inline

Definition at line 443 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), and In_place_list_n< T, managed >::end().

443  {
444  return std::lexicographical_compare( begin(),end(),
445  y.begin(),y.end());
446  }
void int int REAL REAL * y
Definition: read.cpp:74

Here is the call graph for this function:

bool operator<= ( const Self i) const
inline

Definition at line 448 of file In_place_list_n.h.

448 { return !(i < *this); }
blockLoc i
Definition: read.cpp:79
In_place_list_n< T, managed > & operator= ( const Self x)

Definition at line 561 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::end().

561  {
562  if (this != &x) {
563  dim = x.dim;
564  iterator first1 = begin();
565  iterator last1 = end();
566  const_iterator first2 = x.begin();
567  const_iterator last2 = x.end();
568  while (first1 != last1 && first2 != last2) {
569  // Save the pointer values before assignment.
570  // Assignment avoids unneccassary delete's and new's.
571  T* tmp1 = (*first1).next_link[dim];
572  T* tmp2 = (*first1).prev_link[dim];
573  *first1 = *first2++;
574  (*first1).next_link[dim] = tmp1;
575  (*first1).prev_link[dim] = tmp2;
576  ++first1;
577  }
578  if (first2 == last2)
579  erase(first1, last1);
580  else
581  insert(last1, first2, last2);
582  }
583  return *this;
584 }
_In_place_list_n_iterator< const T > const_iterator
_In_place_list_n_iterator< T > iterator
void int int REAL * x
Definition: read.cpp:74
void erase(iterator i)
iterator insert(iterator position, T &x)

Here is the call graph for this function:

bool operator== ( const Self y) const
inline

Definition at line 435 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), equal(), and In_place_list_n< T, managed >::size().

435  {
436  return size() == y.size() && std::equal(begin(), end(), y.begin());
437  }
void int int REAL REAL * y
Definition: read.cpp:74
size_type size() const
static bool equal(const Bbox_3 &b1, const Bbox_3 &b2, Real tol_r)
Definition: Overlay_1d.C:87

Here is the call graph for this function:

bool operator> ( const Self i) const
inline

Definition at line 447 of file In_place_list_n.h.

447 { return i < *this; }
blockLoc i
Definition: read.cpp:79
bool operator>= ( const Self i) const
inline

Definition at line 449 of file In_place_list_n.h.

References i.

449 { return !(*this < i); }
blockLoc i
Definition: read.cpp:79
void pop_back ( )
inline

Definition at line 353 of file In_place_list_n.h.

References In_place_list_n< T, managed >::end(), and In_place_list_n< T, managed >::erase().

Referenced by Overlay::insert_node_in_blue_edge().

353  {
354  // removes the last item from list `l'.
355  iterator tmp = end();
356  erase(--tmp);
357  }
_In_place_list_n_iterator< T > iterator
void erase(iterator i)

Here is the call graph for this function:

Here is the caller graph for this function:

void pop_front ( )
inline

Definition at line 350 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), and In_place_list_n< T, managed >::erase().

Referenced by Overlay::insert_node_in_blue_edge(), and Overlay::intersect_blue_with_green().

350 { erase(begin()); }
void erase(iterator i)

Here is the call graph for this function:

Here is the caller graph for this function:

void push_back ( T &  x)
inline

Definition at line 303 of file In_place_list_n.h.

References In_place_list_n< T, managed >::end(), and In_place_list_n< T, managed >::insert().

Referenced by Overlay::sort_on_green_edges().

303 { insert(end(), x); }
void int int REAL * x
Definition: read.cpp:74
iterator insert(iterator position, T &x)

Here is the call graph for this function:

Here is the caller graph for this function:

void push_front ( T &  x)
inline

Definition at line 300 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), and In_place_list_n< T, managed >::insert().

Referenced by Overlay::intersect_blue_with_green().

300 { insert(begin(), x); }
void int int REAL * x
Definition: read.cpp:74
iterator insert(iterator position, T &x)

Here is the call graph for this function:

Here is the caller graph for this function:

void put_node ( T *  p)
inlineprotected

Definition at line 187 of file In_place_list_n.h.

Referenced by In_place_list_n< T, managed >::erase(), and In_place_list_n< T, managed >::~In_place_list_n().

187 { delete p;}

Here is the caller graph for this function:

reverse_iterator rbegin ( )
inline

Definition at line 267 of file In_place_list_n.h.

References In_place_list_n< T, managed >::end().

Referenced by Overlay::associate_green_vertices(), Overlay::get_inodes_of_face(), and Overlay::sort_on_green_edges().

267 { return reverse_iterator(end()); }
std::reverse_iterator< iterator > reverse_iterator

Here is the call graph for this function:

Here is the caller graph for this function:

const_reverse_iterator rbegin ( ) const
inline

Definition at line 268 of file In_place_list_n.h.

References In_place_list_n< T, managed >::end().

268  {
269  return const_reverse_iterator(end());
270  }
std::reverse_iterator< const_iterator > const_reverse_iterator

Here is the call graph for this function:

void remove ( const T &  value)

Definition at line 601 of file In_place_list_n.h.

601  {
602  iterator first = begin();
603  iterator last = end();
604  while (first != last) {
605  iterator next = first;
606  ++next;
607  if (*first == value)
608  erase(first);
609  first = next;
610  }
611 }
_In_place_list_n_iterator< T > iterator
void erase(iterator i)
reverse_iterator rend ( )
inline

Definition at line 271 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin().

Referenced by Overlay::associate_green_vertices(), Overlay::get_inodes_of_face(), and Overlay::sort_on_green_edges().

271 { return reverse_iterator(begin()); }
std::reverse_iterator< iterator > reverse_iterator

Here is the call graph for this function:

Here is the caller graph for this function:

const_reverse_iterator rend ( ) const
inline

Definition at line 272 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin().

272  {
273  return const_reverse_iterator(begin());
274  }
std::reverse_iterator< const_iterator > const_reverse_iterator

Here is the call graph for this function:

void resize ( size_type  sz,
c = T() 
)
inline

Definition at line 422 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::erase(), i, In_place_list_n< T, managed >::insert(), and In_place_list_n< T, managed >::size().

422  {
423  if ( sz > size())
424  insert( end(), sz - size(), c);
425  else if ( sz < size()) {
426  iterator i = begin();
427  while ( sz-- > 0)
428  ++i;
429  erase( i, end());
430  } // else do nothing
431  }
size_type size() const
_In_place_list_n_iterator< T > iterator
blockLoc i
Definition: read.cpp:79
void erase(iterator i)
iterator insert(iterator position, T &x)

Here is the call graph for this function:

void reverse ( )

Definition at line 614 of file In_place_list_n.h.

614  {
615  if (size() < 2) return;
616  for (iterator first = ++begin(); first != end();) {
617  iterator old = first++;
618  transfer(begin(), old, first);
619  }
620 }
void transfer(iterator position, iterator first, iterator last)
size_type size() const
_In_place_list_n_iterator< T > iterator
void set_dimension ( int  d)
inline

Definition at line 252 of file In_place_list_n.h.

References d, and In_place_list_n< T, managed >::dim.

252 { dim = d; }
const NT & d
void sort ( )

Definition at line 657 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), empty(), i, merge, In_place_list_n< T, managed >::merge(), In_place_list_n< T, managed >::splice(), swap(), and In_place_list_n< T, managed >::swap().

657  {
658  if (size() < 2) return;
660  In_place_list_n<T,managed> counter[64];
661  int fill = 0;
662  while (!empty()) {
663  carry.splice(carry.begin(), *this, begin());
664  int i = 0;
665  while(i < fill && !counter[i].empty()) {
666  counter[i].merge(carry);
667  carry.swap(counter[i++]);
668  }
669  carry.swap(counter[i]);
670  if (i == fill)
671  ++fill;
672  }
673  for (int i = 1; i < fill; ++i)
674  counter[i].merge(counter[i-1]);
675  swap(counter[fill-1]);
676 }
void splice(iterator position, Self &x)
size_type size() const
void swap(Self &x)
bool empty() const
blockLoc i
Definition: read.cpp:79
void merge(Self &x)

Here is the call graph for this function:

void splice ( iterator  position,
Self x 
)
inline

Definition at line 466 of file In_place_list_n.h.

References In_place_list_n< T, managed >::begin(), In_place_list_n< T, managed >::empty(), In_place_list_n< T, managed >::end(), In_place_list_n< T, managed >::length, and In_place_list_n< T, managed >::transfer().

Referenced by In_place_list_n< T, managed >::sort(), and In_place_list_n< T, managed >::splice().

466  {
467  // inserts the list x before position `pos' and x becomes empty.
468  // It takes constant time. Precondition: `&l != &x'.
469  if (!x.empty()) {
470  transfer(position, x.begin(), x.end());
471  length += x.length;
472  x.length = 0;
473  }
474  }
void transfer(iterator position, iterator first, iterator last)
std::size_t length
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

void splice ( T *  position,
Self x 
)
inline

Definition at line 475 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::splice().

475  {
476  splice( iterator(position,dim), x);
477  }
void splice(iterator position, Self &x)
_In_place_list_n_iterator< T > iterator
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

void splice ( iterator  position,
Self x,
iterator  i 
)
inline

Definition at line 478 of file In_place_list_n.h.

References i, j, In_place_list_n< T, managed >::length, and In_place_list_n< T, managed >::transfer().

478  {
479  // inserts an element pointed to by i from list x before position
480  // `pos' and removes the element from x. It takes constant time. i
481  // is a valid dereferenceable iterator of x. The result is
482  // unchanged if `pos == i' or `pos == ++i'.
483  iterator j = i;
484  if (position == i || position == ++j) return;
485  transfer(position, i, j);
486  ++length;
487  --x.length;
488  }
void transfer(iterator position, iterator first, iterator last)
_In_place_list_n_iterator< T > iterator
std::size_t length
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74
j indices j
Definition: Indexing.h:6

Here is the call graph for this function:

void splice ( T *  position,
Self x,
T *  i 
)
inline

Definition at line 489 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::splice().

489  {
490  splice( iterator(position,dim), x, iterator(i,dim));
491  }
void splice(iterator position, Self &x)
_In_place_list_n_iterator< T > iterator
blockLoc i
Definition: read.cpp:79
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

void splice ( iterator  pos,
Self x,
iterator  first,
iterator  last 
)
inline

Definition at line 492 of file In_place_list_n.h.

References In_place_list_n< T, managed >::length, n, and In_place_list_n< T, managed >::transfer().

492  {
493  // inserts elements in the range [`first, last') before position
494  // `pos' and removes the elements from x. It takes constant time
495  // if `&x == $l'; otherwise, it takes linear time. [`first,
496  // last') is a valid range in x. Precondition: `pos' is not in the
497  // range [`first, last').
498  if (first != last) {
499  if (&x != this) {
500  difference_type n = 0;
501  std::distance(first, last, n);
502  x.length -= n;
503  length += n;
504  }
505  transfer(pos, first, last);
506  }
507  }
void transfer(iterator position, iterator first, iterator last)
std::size_t length
void int int REAL * x
Definition: read.cpp:74
const NT & n
std::ptrdiff_t difference_type

Here is the call graph for this function:

void splice ( T *  p,
Self x,
T *  first,
T *  last 
)
inline

Definition at line 508 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and In_place_list_n< T, managed >::splice().

508  {
509  splice( iterator(p,dim), x, iterator(first,dim), iterator(last,dim));
510  }
void splice(iterator position, Self &x)
_In_place_list_n_iterator< T > iterator
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

void swap ( Self x)
inline

Definition at line 254 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, In_place_list_n< T, managed >::length, In_place_list_n< T, managed >::node, and swap().

Referenced by In_place_list_n< T, managed >::sort().

254  {
255  std::swap(node, x.node);
256  std::swap(length, x.length);
257  std::swap(dim, x.dim);
258  }
void swap(int &a, int &b)
Definition: buildface.cpp:88
Definition: adj.h:150
std::size_t length
void int int REAL * x
Definition: read.cpp:74

Here is the call graph for this function:

Here is the caller graph for this function:

void transfer ( iterator  position,
iterator  first,
iterator  last 
)
inlineprotected

Definition at line 454 of file In_place_list_n.h.

References In_place_list_n< T, managed >::dim, and _In_place_list_n_iterator< T >::node.

Referenced by In_place_list_n< T, managed >::splice().

454  {
455  // move the range [`first, last') before the position.
456  (*((*last.node).prev_link[dim])).next_link[dim] = position.node;
457  (*((*first.node).prev_link[dim])).next_link[dim] = last.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;
463  }

Here is the caller graph for this function:

void unique ( )

Definition at line 623 of file In_place_list_n.h.

623  {
624  iterator first = begin();
625  iterator last = end();
626  if (first == last) return;
627  iterator next = first;
628  while (++next != last) {
629  if (*first == *next)
630  erase(next);
631  else
632  first = next;
633  next = first;
634  }
635 }
_In_place_list_n_iterator< T > iterator
void erase(iterator i)

Member Data Documentation


The documentation for this class was generated from the following file: