bitSetI.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2018-2019 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
29 
30 inline Foam::label Foam::bitSet::first_not_block() const
31 {
32  if (empty())
33  {
34  return -1;
35  }
36 
37  // Use complement to change 0 <-> 1 and check if any 1's now appear
38 
39  const label nblocks = num_blocks(size());
40 
41  // Extra bits in the final block?
42  const unsigned int off = size() % elem_per_block;
43 
44  if (!off)
45  {
46  for (label blocki=0; blocki < nblocks; ++blocki)
47  {
48  if (~(blocks_[blocki]))
49  {
50  return blocki;
51  }
52  }
53  }
54  else
55  {
56  for (label blocki=0; blocki < nblocks-1; ++blocki)
57  {
58  if (~(blocks_[blocki]))
59  {
60  return blocki;
61  }
62  }
63 
64  // The final block needs masking
65  if (~(blocks_[nblocks-1]) & mask_lower(off))
66  {
67  return nblocks-1;
68  }
69  }
70 
71  return -1;
72 }
73 
74 
75 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
76 
77 inline Foam::bitSet::bitSet() noexcept
78 :
79  PackedList<1>()
80 {}
81 
82 
84 :
85  PackedList<1>(n)
86 {}
87 
88 
89 inline Foam::bitSet::bitSet(const label n, const bool val)
90 :
91  bitSet(n)
92 {
93  if (val) assign(val);
94 }
95 
96 
98 :
99  PackedList<1>(bitset)
100 {}
101 
102 
104 :
105  PackedList<1>(std::move(bitset))
106 {}
107 
108 
110 :
111  bitSet()
112 {
113  assign(bools);
114 }
115 
116 
117 inline Foam::bitSet::bitSet(const label n, const labelUList& locations)
118 :
119  bitSet(n)
120 {
121  setMany(locations.begin(), locations.end());
122 }
123 
124 
125 template<class Addr>
127 (
128  const label n,
129  const IndirectListBase<label, Addr>& locations
130 )
131 :
132  bitSet(n)
133 {
134  setMany(locations.begin(), locations.end());
135 }
136 
137 
139 (
140  const label n,
141  std::initializer_list<label> locations
142 )
143 :
144  bitSet(n)
145 {
146  setMany(locations.begin(), locations.end());
147 }
148 
149 
150 inline Foam::bitSet::bitSet(const labelUList& locations)
151 :
152  bitSet()
153 {
154  setMany(locations.begin(), locations.end());
155 }
156 
157 
158 template<class Addr>
160 (
161  const IndirectListBase<label, Addr>& locations
162 )
163 :
164  bitSet()
165 {
166  setMany(locations.begin(), locations.end());
167 }
168 
169 
171 {
172  return autoPtr<bitSet>::New(*this);
173 }
174 
175 
176 // * * * * * * * * * * * * * * * * References * * * * * * * * * * * * * * * * //
177 
179 (
180  bitSet* parent,
181  const label index
182 )
183 :
184  PackedList<1>::reference(parent, index)
185 {}
186 
187 
189 {
190  const unsigned int mask = (max_value << shift_);
191  ref_ ^= mask;
192 }
193 
194 
195 inline void Foam::bitSet::reference::operator=
196 (
197  const reference& other
198 )
199 {
200  // Accepts self-assignment
201  set(other.get());
202 }
203 
204 
205 inline void Foam::bitSet::reference::operator=
206 (
207  const unsigned int val
208 )
209 {
210  set(val);
211 }
212 
213 
214 inline Foam::bitSet::reference::operator unsigned int () const
215 {
216  return get();
217 }
218 
219 
220 // * * * * * * * * * * * * * * * * Iterators * * * * * * * * * * * * * * * * //
221 
222 inline Foam::bitSet::const_iterator::const_iterator() noexcept
223 :
224  set_(nullptr),
225  pos_(-1)
226 {}
227 
228 
229 inline Foam::bitSet::const_iterator::const_iterator(const bitSet* parent)
230 :
231  set_(parent),
232  pos_(set_->find_first())
233 {}
234 
235 
236 inline Foam::bitSet::const_iterator::const_iterator
237 (
238  const bitSet* parent,
239  label pos
240 )
241 :
242  set_(parent),
243  pos_(set_->find_next(pos-1))
244 {}
245 
246 
248 {
249  return pos_;
250 }
251 
252 
254 {
255  pos_ = set_->find_next(pos_);
256  return *this;
257 }
258 
259 
260 inline bool Foam::bitSet::const_iterator::operator==
261 (
262  const const_iterator& iter
263 ) const noexcept
264 {
265  return (iter.pos_ == pos_);
266 }
267 
268 
269 inline bool Foam::bitSet::const_iterator::operator!=
270 (
271  const const_iterator& iter
272 ) const noexcept
273 {
274  return (iter.pos_ != pos_);
275 }
276 
277 
279 {
280  return const_iterator(this);
281 }
282 
283 
285 {
286  return const_iterator(this);
287 }
288 
289 
291 {
292  return const_iterator(this, pos);
293 }
294 
295 
297 {
298  return const_iterator(this, pos);
299 }
300 
301 
303 {
304  return const_iterator();
305 }
306 
307 
309 {
310  return const_iterator();
311 }
312 
313 
315 {
316  // Process block-wise, detecting any '1' bits
317 
318  const label nblocks = num_blocks(size());
319  for (label blocki = 0; blocki < nblocks; ++blocki)
320  {
321  label pos = (blocki * elem_per_block);
322 
323  for
324  (
325  unsigned int blockval = blocks_[blocki];
326  blockval;
327  blockval >>= 1u
328  )
329  {
330  if (blockval & 1u)
331  {
332  return pos;
333  }
334  ++pos;
335  }
336  }
337 
338  return -1;
339 }
340 
341 
343 {
344  const label blocki = first_not_block();
345 
346  if (blocki >= 0)
347  {
348  label pos = (blocki * elem_per_block);
349 
350  // Detect first '0' bit by checking the complement.
351 
352  // No special masking for the final block, that was already checked
353  // in the first_not_block() call.
354 
355  for
356  (
357  unsigned int blockval = ~(blocks_[blocki]);
358  blockval;
359  blockval >>= 1u
360  )
361  {
362  if (blockval & 1u)
363  {
364  return pos;
365  }
366  ++pos;
367  }
368  }
369 
370  return -1;
371 }
372 
373 
375 {
376  // Process block-wise, detecting any '1' bits
377 
378  for (label blocki = num_blocks(size())-1; blocki >= 0; --blocki)
379  {
380  unsigned int blockval = blocks_[blocki];
381 
382  if (blockval)
383  {
384  label pos = (blocki * elem_per_block) - 1;
385 
386  while (blockval)
387  {
388  blockval >>= 1u;
389  ++pos;
390  }
391 
392  return pos;
393  }
394  }
395 
396  return -1;
397 }
398 
399 
401 {
402  ++pos;
403  if (pos < 0 || pos >= size())
404  {
405  return -1;
406  }
407 
408  // The corresponding block/offset
409  label blocki = pos / elem_per_block;
410  unsigned int off = pos % elem_per_block;
411 
412  for
413  (
414  unsigned int blockval = (blocks_[blocki] >> off);
415  blockval;
416  blockval >>= 1u
417  )
418  {
419  if (blockval & 1u)
420  {
421  return pos;
422  }
423  ++pos;
424  }
425 
426  // Normal block-wise search. Starting at the next block
427 
428  const label nblocks = num_blocks(size());
429  for (++blocki; blocki < nblocks; ++blocki)
430  {
431  label pos = (blocki * elem_per_block);
432 
433  for
434  (
435  unsigned int blockval = blocks_[blocki];
436  blockval;
437  blockval >>= 1u
438  )
439  {
440  if (blockval & 1u)
441  {
442  return pos;
443  }
444  ++pos;
445  }
446  }
447 
448  return -1;
449 }
450 
451 
452 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
453 
454 inline bool Foam::bitSet::all() const
455 {
456  return -1 == first_not_block();
457 }
458 
459 
460 inline bool Foam::bitSet::any() const
461 {
462  if (size())
463  {
464  const label nblocks = num_blocks(size());
465 
466  for (label blocki=0; blocki < nblocks; ++blocki)
467  {
468  if (blocks_[blocki])
469  {
470  return true;
471  }
472  }
473  }
474 
475  return false;
476 }
477 
478 
479 inline bool Foam::bitSet::none() const
480 {
481  return !any();
482 }
483 
484 
485 inline bool Foam::bitSet::uniform() const
486 {
487  return (size() == 1 || (size() > 1 && (test(0) ? all() : none())));
488 }
489 
490 
491 inline unsigned int Foam::bitSet::count(const bool on) const
492 {
493  unsigned int total = 0;
494 
495  const label nblocks = num_blocks(size());
496 
497  for (label blocki = 0; blocki < nblocks; ++blocki)
498  {
499  total += BitOps::bit_count(blocks_[blocki]);
500  }
501 
502  if (!on)
503  {
504  // Return the number of bits that are OFF.
505  return (unsigned(size()) - total);
506  }
507 
508  return total;
509 }
510 
511 
512 inline bool Foam::bitSet::test(const label pos) const
513 {
514  return get(pos);
515 }
516 
517 
519 {
520  return toc();
521 }
522 
523 
525 {
527 }
528 
529 
531 {
533 }
534 
535 
536 inline void Foam::bitSet::assign(const bool val)
537 {
538  if (empty())
539  {
540  return; // Trivial case
541  }
542 
543  const label nblocks = num_blocks(size());
544 
545  if (val)
546  {
547  for (label blocki=0; blocki < nblocks; ++blocki)
548  {
549  blocks_[blocki] = (~0u);
550  }
552  }
553  else
554  {
555  for (label blocki=0; blocki < nblocks; ++blocki)
556  {
557  blocks_[blocki] = (0u);
558  }
559  }
560 }
561 
562 
563 inline void Foam::bitSet::set(const bitSet& bitset)
564 {
565  orEq(bitset, false); // Non-strict: Lets the set size grow.
566 }
567 
568 
569 inline Foam::label Foam::bitSet::set(const labelUList& locations)
570 {
571  return setMany(locations.begin(), locations.end());
572 }
573 
574 
575 template<class Addr>
577 (
578  const IndirectListBase<label, Addr>& locations
579 )
580 {
581  return setMany(locations.begin(), locations.end());
582 }
583 
584 
586 {
587  return unset(locations.begin(), locations.end());
588 }
589 
590 
591 template<class Addr>
593 (
594  const IndirectListBase<label, Addr>& locations
595 )
596 {
597  return unset(locations.begin(), locations.end());
598 }
599 
600 
602 {
603  return minusEq(other);
604 }
605 
606 
607 inline void Foam::bitSet::flip()
608 {
609  if (size())
610  {
611  const label nblocks = num_blocks(size());
612 
613  for (label blocki=0; blocki < nblocks; ++blocki)
614  {
615  blocks_[blocki] = ~(blocks_[blocki]);
616  }
618  }
619 }
620 
621 
622 inline void Foam::bitSet::flip(const label i)
623 {
624  if (i >= 0 && i < size())
625  {
626  reference(this, i).flip();
627  }
628 }
629 
630 
631 inline Foam::bitSet& Foam::bitSet::bound(const label maxSize)
632 {
633  if (maxSize < size())
634  {
635  resize(maxSize);
636  }
637 
638  return *this;
639 }
640 
641 
643 {
644  return bound(other.size());
645 }
646 
647 
649 {
650  if (size() < minSize)
651  {
652  resize(minSize);
653  }
654 
655  return *this;
656 }
657 
658 
660 {
661  return extend(other.size());
662 }
663 
664 
665 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
666 
667 inline bool Foam::bitSet::operator()(const label pos) const
668 {
669  return test(pos);
670 }
671 
672 
673 inline unsigned int Foam::bitSet::operator[](const label i) const
674 {
675  return get(i);
676 }
677 
678 
680 {
681  #ifdef FULLDEBUG
682  checkIndex(i);
683  #endif
684  return reference(this, i);
685 }
686 
687 
689 {
691  return *this;
692 }
693 
694 
696 {
698  return *this;
699 }
700 
701 
703 {
704  transfer(bitset);
705  return *this;
706 }
707 
708 
710 {
711  return andEq(other);
712 }
713 
714 
716 {
717  return orEq(other);
718 }
719 
720 
722 {
723  return xorEq(other);
724 }
725 
726 
728 {
729  return minusEq(other);
730 }
731 
732 
733 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
734 
736 {
737  bitSet result(bitset);
738  result.flip();
739  return result;
740 }
741 
742 
743 inline Foam::bitSet Foam::operator&(const bitSet& a, const bitSet& b)
744 {
745  bitSet result(a);
746  return (result &= b);
747 }
748 
749 
750 inline Foam::bitSet Foam::operator|(const bitSet& a, const bitSet& b)
751 {
752  bitSet result(a);
753  return (result |= b);
754 }
755 
756 
757 inline Foam::bitSet Foam::operator^(const bitSet& a, const bitSet& b)
758 {
759  bitSet result(a);
760  return (result ^= b);
761 }
762 
763 
764 inline Foam::bitSet Foam::operator-(const bitSet& a, const bitSet& b)
765 {
766  bitSet result(a);
767  return (result -= b);
768 }
769 
770 
771 // ************************************************************************* //
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::bitSet::andEq
bitSet & andEq(const bitSet &other)
The set logical AND.
Definition: bitSet.C:77
Foam::bitSet::operator-=
bitSet & operator-=(const bitSet &other)
Remove entries from this list - identical to the unset() method.
Definition: bitSetI.H:727
Foam::bitSet::operator[]
unsigned int operator[](const label i) const
Identical to get() - get value at index.
Definition: bitSetI.H:673
Foam::IndirectListBase::end
iterator end()
Return an iterator at end of list.
Definition: IndirectListBase.H:337
Foam::bitSet::end
const_iterator end() const noexcept
Iterator beyond the end of the bitSet.
Definition: bitSetI.H:302
Foam::val
label ListType::const_reference val
Definition: ListOps.H:407
Foam::bitSet::find_first
label find_first() const
Locate the first bit that is set.
Definition: bitSetI.H:314
Foam::bitSet::bitSet
bitSet() noexcept
Construct an empty, zero-sized set.
Definition: bitSetI.H:77
Foam::HashSetOps::bools
List< bool > bools(const labelHashSet &locations)
Definition: HashOps.C:81
Foam::PackedList::reference::ref_
block_type & ref_
Reference to the block.
Definition: PackedList.H:457
Foam::bitSet::all
bool all() const
True if all bits in this bitset are set or if the set is empty.
Definition: bitSetI.H:454
Foam::bitSet::xorEq
bitSet & xorEq(const bitSet &other, const bool strict=true)
The set logical XOR.
Definition: bitSet.C:205
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:64
Foam::operator&
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
Foam::bitSet::bound
bitSet & bound(const label maxSize)
Ensure the addressable range does not exceed maxSize.
Definition: bitSetI.H:631
Foam::BitOps::bit_count
unsigned int bit_count(UIntType x)
Count arbitrary number of bits (of an integral type)
Definition: BitOps.H:103
Foam::bitSet::clone
autoPtr< bitSet > clone() const
Clone.
Definition: bitSetI.H:170
Foam::bitSet::reference
A reference supporting read/write access to an entry.
Definition: bitSet.H:435
Foam::bitSet::unset
bitSet & unset(const bitSet &other)
Definition: bitSetI.H:601
Foam::bitSet::any
bool any() const
True if any bits in this bitset are set.
Definition: bitSetI.H:460
Foam::operator-
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Foam::bitSet::cend
const_iterator cend() const noexcept
Iterator beyond the end of the bitSet.
Definition: bitSetI.H:308
Foam::bitSet::const_iterator::operator++
const_iterator & operator++()
Move to the next on position.
Definition: bitSetI.H:253
Foam::bitSet::set
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition: bitSetI.H:563
Foam::bitSet::setMany
label setMany(InputIter first, InputIter last)
Set the locations listed by the iterator range,.
Foam::PackedList< 1 >::clear_trailing_bits
void clear_trailing_bits()
Clear any partial rubbish in the last addressable block.
Definition: PackedListI.H:83
Foam::PackedList< 1 >::empty
bool empty() const noexcept
True if the list is empty (ie, size() is zero).
Definition: PackedListI.H:373
Foam::bitSet::operator|=
bitSet & operator|=(const bitSet &other)
Bitwise-OR operator - similar to the set() method.
Definition: bitSetI.H:715
Foam::bitSet::test
bool test(const label pos) const
Test value at specified position, never auto-vivify entries.
Definition: bitSetI.H:512
Foam::HashSetOps::bitset
bitSet bitset(const labelHashSet &locations)
Transform the on locations to a bitSet.
Definition: HashOps.C:72
Foam::bitSet::const_iterator::operator*
label operator*() const noexcept
Return the current on position.
Definition: bitSetI.H:247
Foam::PackedList< 1 >::checkIndex
void checkIndex(const label i) const
Check index is within valid range [0,size)
Definition: PackedListI.H:348
Foam::PackedList< 1 >::resize
void resize(const label nElem, const unsigned int val=0u)
Reset addressable list size, does not shrink the allocated size.
Definition: PackedListI.H:388
Foam::bitSet::count
unsigned int count(const bool on=true) const
Count number of bits set.
Definition: bitSetI.H:491
Foam::UList::begin
iterator begin()
Return an iterator to begin traversing the UList.
Definition: UListI.H:276
Foam::PackedList::swap
void swap(PackedList< Width > &rhs)
Swap contents with argument.
Definition: PackedListI.H:558
Foam::PackedList< 1 >::get
unsigned int get(const label i) const
Get value at index i or 0 for out-of-range.
Definition: PackedListI.H:585
Foam::PackedList< 1 >::mask_lower
static constexpr block_type mask_lower(unsigned elementOffset)
Masking for all bits below the element offset.
Definition: PackedList.H:171
Foam::bitSet::operator()
bool operator()(const label pos) const
Test value at specified position, same as test()
Definition: bitSetI.H:667
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::bitSet::reference::flip
void flip()
Flip the bit at the position, no range-checking.
Definition: bitSetI.H:188
Foam::PackedList< 1 >::blocks_
block_container blocks_
The blocks of raw data.
Definition: PackedList.H:185
Foam::bitSet::toc
labelList toc() const
The indices of the on bits as a sorted labelList.
Definition: bitSet.C:527
Foam::bitSet::cbegin
const_iterator cbegin() const
Iterator set to the position of the first on bit.
Definition: bitSetI.H:284
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:62
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::bitSet::find_last
label find_last() const
Locate the last bit set.
Definition: bitSetI.H:374
Foam::bitSet::reference::reference
reference(bitSet *parent, const label index)
Definition: bitSetI.H:179
Foam::PackedList::operator=
void operator=(const unsigned int val)
Assignment of all entries to the given value. Takes linear time.
Definition: PackedListI.H:742
Foam::bitSet::const_iterator
A const_iterator for iterating across on values.
Definition: bitSet.H:466
Foam::bitSet::find_first_not
label find_first_not() const
Locate the first bit that is unset.
Definition: bitSetI.H:342
Foam::bitSet::operator&=
bitSet & operator&=(const bitSet &other)
Bitwise-AND all the bits in other with the bits in this bitset.
Definition: bitSetI.H:709
Foam::bitSet::minusEq
bitSet & minusEq(const bitSet &other)
The set difference.
Definition: bitSet.C:42
Foam::bitSet::begin
const_iterator begin() const
Iterator set to the position of the first on bit.
Definition: bitSetI.H:278
Foam::PackedList< 1 >::num_blocks
static constexpr label num_blocks(label numElem)
Definition: PackedList.H:164
Foam::bitSet::flip
void flip()
Invert all bits in the addressable region.
Definition: bitSetI.H:607
Foam::bitSet::orEq
bitSet & orEq(const bitSet &other, const bool strict=true)
The set logical OR.
Definition: bitSet.C:118
Foam::bitSet::find_next
label find_next(label pos) const
Locate the next bit set, starting one beyond the specified position.
Definition: bitSetI.H:400
Foam::PackedList::transfer
void transfer(PackedList< Width > &rhs)
Transfer the contents of the argument list into this list.
Definition: PackedListI.H:571
Foam::IndirectListBase::begin
iterator begin()
Return an iterator at begin of list.
Definition: IndirectListBase.H:331
Foam::PackedList< 1 >::max_value
static constexpr block_type max_value
Definition: PackedList.H:153
Foam::bitSet::none
bool none() const
True if no bits in this bitset are set.
Definition: bitSetI.H:479
Foam::autoPtr< Foam::bitSet >
Foam::operator~
bitSet operator~(const bitSet &bitset)
Bitset complement, returns a copy of the bitset with all its bits flipped.
Definition: bitSetI.H:735
Foam::PackedList< 1 >::elem_per_block
static constexpr unsigned elem_per_block
The number of elements stored per data block.
Definition: PackedList.H:148
Foam::bitSet::swap
void swap(bitSet &bitset)
Swap contents.
Definition: bitSetI.H:524
Foam::List< label >
Foam::bitSet::extend
bitSet & extend(const label minSize)
Ensure that minSize is covered by the bitSet.
Definition: bitSetI.H:648
Foam::PackedList
A dynamic list of packed unsigned integers, with the number of bits per item specified by the <Width>...
Definition: PackedList.H:108
Foam::bitSet::operator=
bitSet & operator=(const bool val)
Assignment of all entries to the given value.
Definition: bitSetI.H:688
Foam::PackedList< 1 >::size
label size() const noexcept
Number of entries.
Definition: PackedListI.H:366
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::bitSet::operator^=
bitSet & operator^=(const bitSet &other)
Bitwise-XOR operator - retains unique entries.
Definition: bitSetI.H:721
Foam::IndirectListBase
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
Definition: IndirectListBase.H:57
Foam::bitSet::assign
void assign(const bool val)
Assign all entries to the given value.
Definition: bitSetI.H:536
Foam::operator^
bitSet operator^(const bitSet &a, const bitSet &b)
Bitwise-XOR of two bitsets to form a unique bit-set.
Definition: bitSetI.H:757
Foam::UList::end
iterator end()
Return an iterator to end traversing the UList.
Definition: UListI.H:297
Foam::PackedList::reference::shift_
unsigned shift_
The bit shift to access the given sub-portion.
Definition: PackedList.H:460
Foam::operator|
bitSet operator|(const bitSet &a, const bitSet &b)
Bitwise-OR of two bitsets.
Definition: bitSetI.H:750
Foam::bitSet::uniform
bool uniform() const
True if all entries have identical values, and the set is non-empty.
Definition: bitSetI.H:485
Foam::bitSet::sortedToc
labelList sortedToc() const
The indices of the on bits as a sorted labelList.
Definition: bitSetI.H:518
Foam::bitSet::transfer
void transfer(bitSet &bitset)
Definition: bitSetI.H:530
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177