Go to the documentation of this file.
43 label nElem = this->size();
45 if (labelRange::debug)
47 Info<<
"before insert "
48 << nElem <<
" elements, insert at " <<
insert <<
nl
54 if (labelRange::debug)
56 Info<<
"copy between " << nElem <<
" and " <<
insert <<
nl;
61 if (labelRange::debug)
63 Info<<
"copy from " << (i) <<
" to " << (i+1) <<
nl;
66 ParentType::operator[](i+1) = ParentType::operator[](i);
70 if (labelRange::debug)
88 ParentType::operator[](nElem) = ParentType::operator[](elemI);
133 else if (this->empty())
142 labelRange& currRange = ParentType::operator[](elemI);
150 for (; elemI < this->size()-1; ++elemI)
152 labelRange& nextRange = ParentType::operator[](elemI+1);
155 currRange += nextRange;
169 else if (
range < currRange)
171 insertBefore(elemI,
range);
188 if (
range.empty() || this->empty())
195 labelRange& currRange = ParentType::operator[](elemI);
205 Info<<
"Fragment removal ";
207 printRange(
Info, currRange) <<
endl;
214 labelRange fragment(lower, upper - lower + 1);
217 lower =
range.last() + 1;
218 upper = currRange.
last();
220 currRange =
labelRange(lower, upper - lower + 1);
222 insertBefore(elemI, fragment);
229 printRange(
Info, currRange) <<
endl;
236 else if (
range.first() <= currRange.
last())
242 Info<<
"RHS removal ";
244 printRange(
Info, currRange) <<
endl;
250 currRange =
labelRange(lower, upper - lower + 1);
256 printRange(
Info, currRange) <<
endl;
268 Info<<
"LHS removal ";
270 printRange(
Info, currRange) <<
endl;
276 currRange =
labelRange(lower, upper - lower + 1);
282 printRange(
Info, currRange) <<
endl;
305 os << static_cast<const labelRanges::ParentType&>(ranges);
points setSize(newPointi)
label last() const
The (inclusive) upper value of the range.
#define forAll(list, i)
Loop across all elements in list.
labelRanges()
Construct null.
void clear()
Reset to zero size.
Ostream & endl(Ostream &os)
Add newline and flush stream.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Ostream & operator<<(Ostream &, const edgeMesh &)
bool intersects(const labelRange &, const bool touches=false) const
Return true if the ranges intersect.
void insertBefore(const label, const labelRange &)
Insert range before specified insertion index, by copying up.
void purgeEmpty()
Purge empty ranges, by copying down.
Istream & operator>>(Istream &, edgeMesh &)
label first() const
The (inclusive) lower value of the range.
T remove()
Remove and return the top element.
static const const_iterator endIter_
const_iterator returned by end(), cend()
Various functions to operate on Lists.
Ostream & printRange(Ostream &, const labelRange &) const
Print the range for debugging purposes.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool add(const labelRange &)
Add the range to the list.
void setSize(const label)
Alter the addressed list size.
friend Ostream & operator(Ostream &, const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
timeIndices insert(timeIndex, timeDirs[timeI].value())