30 template<
class LabelList>
33 const DLPermutation<LabelList>&
p,
42 template<
class LabelList>
49 next_(permutation.size(), -1),
51 previous_(permutation.size(), -1)
71 template<
class LabelList>
84 template<
class LabelList>
92 template<
class LabelList>
104 template<
class LabelList>
113 template<
class LabelList>
123 template<
class LabelList>
127 i_ = p_.previous_[i_];
132 template<
class LabelList>
142 template<
class LabelList>
148 return i_ == iter.i_;
152 template<
class LabelList>
158 return !(*
this == iter);
164 template<
class LabelList>
179 template<
class LabelList>
194 template<
class LabelList>
207 result[i ++] = *iter;
215 result[-- i] = *iter;
223 template<
class LabelList>
231 template<
class LabelList>
239 template<
class LabelList>
247 template<
class LabelList>
255 template<
class LabelList>
263 template<
class LabelList>
271 template<
class LabelList>
279 template<
class LabelList>
287 template<
class LabelList>
290 const label i = next_.size();
293 previous_.append(tail_);
299 template<
class LabelList>
302 const label i = next_.size();
305 previous_.append(-2);
306 previous_[head_] = i;
311 template<
class LabelList>
314 if (i == head_)
return;
316 const label i0 = previous_[i];
317 const label i1 = next_[i];
319 (i1 != -1 ? previous_[i1] : tail_) = previous_[i];
321 previous_[head_] = i;
323 next_[i0] = next_[i];
329 template<
class LabelList>
332 if (i == tail_)
return;
334 const label i0 = previous_[i];
335 const label i1 = next_[i];
337 (i0 != -2 ? next_[i0] : head_) = next_[i];
341 previous_[i1] = previous_[i];
342 previous_[i] = tail_;
#define forAllConstIterReverse(Container, container, iter)
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
A bi-directional constant iterator.
const_iterator & operator--()
Decrement.
label operator*() const
Dereference.
const_iterator & operator++()
Increment.
const_iterator next() const
Return the next iterator without incrementing.
const_iterator(const DLPermutation &, const label)
Construct at an index within a permutation.
const_iterator previous() const
Return the previous iterator without incrementing.
A permutation stored in the same manner as a doubly-linked list in order to facilitate reordering in ...
void sink(const label i)
Sink a given index to the end of the permutation.
const_iterator rbegin() const
Return the starting reverse iterator.
const_iterator cbegin() const
Return the starting forward iterator.
const_iterator rend() const
Return the ending reverse iterator.
const_iterator crbegin() const
Return the starting reverse iterator.
const_iterator begin() const
Return the starting forward iterator.
const_iterator crend() const
Return the ending reverse iterator.
List< label > permutation(const bool reverse)
Return the permutation.
DLPermutation(const List< label > &permutation)
Construct for a given permutation.
const_iterator cend() const
Return the ending forward iterator.
const_iterator end() const
Return the ending forward iterator.
void append()
Add a new index to the end of the permutation.
void prepend()
Add a new index to the start of the permutation.
void raise(const label i)
Raise a given index to the start of the permutation.
void size(const label)
Override size to be inconsistent with allocated storage.
T & first()
Return the first element of the list.
bool empty() const
Return true if the UList is empty (ie, size() is zero)
T & last()
Return the last element of the list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void reverse(UList< T > &, const label n)
randomGenerator rndGen(653213)