GEOS
|
Utility class that represents a mask for included/excluded component of a mask. More...
#include <ComponentMask.hpp>
Classes | |
class | Iterator |
Forward const iterator over the set components (bits). More... | |
Public Member Functions | |
Constructors. | |
GEOS_HOST_DEVICE | ComponentMask (int const numComp, bool const includeAll) |
Constructor. More... | |
GEOS_HOST_DEVICE | ComponentMask (int const numComp=0) |
Constructor. More... | |
GEOS_HOST_DEVICE | ComponentMask (int const numComp, int const lo, int const hi) |
Range constructor, includes contiguous range of components. More... | |
template<int N, typename = std::enable_if_t< ( N < MAX_COMP ) >> | |
GEOS_HOST_DEVICE | ComponentMask (ComponentMask< N > const &other) |
Converting constructor from another mask with fewer max components. More... | |
Inspection methods. | |
GEOS_HOST_DEVICE Iterator | begin () const |
GEOS_HOST_DEVICE Iterator | end () const |
GEOS_HOST_DEVICE int | size () const |
GEOS_HOST_DEVICE int | numComp () const |
GEOS_HOST_DEVICE bool | empty () const |
GEOS_HOST_DEVICE bool | operator[] (int const i) const |
Check if a particular component is selected. More... | |
Modification methods/operators. | |
GEOS_HOST_DEVICE void | clear () |
Clear the mask, removing selected components. | |
GEOS_HOST_DEVICE void | setNumComp (int const numComp) |
Set new component limit and truncate all components above. More... | |
GEOS_HOST_DEVICE void | set (int const i) |
Add a component. More... | |
GEOS_HOST_DEVICE void | unset (int const i) |
Remove a component. More... | |
GEOS_HOST_DEVICE void | invert () |
Invert component selection. | |
GEOS_HOST_DEVICE ComponentMask & | operator+= (int const i) |
Add a component. More... | |
GEOS_HOST_DEVICE ComponentMask & | operator-= (int const i) |
Remove a component. More... | |
GEOS_HOST_DEVICE ComponentMask | operator~ () const |
Negation operator (inverts component selection). More... | |
GEOS_HOST_DEVICE friend ComponentMask | operator+ (ComponentMask const &mask, int const i) |
Make a new mask by adding a component. More... | |
GEOS_HOST_DEVICE friend ComponentMask | operator+ (int const i, ComponentMask const &mask) |
Make a new mask by adding a component. More... | |
GEOS_HOST_DEVICE friend ComponentMask | operator- (ComponentMask const &mask, int const i) |
Make a new mask by removing a component. More... | |
GEOS_HOST_DEVICE friend ComponentMask | operator- (int const i, ComponentMask const &mask) |
Make a new mask by removing a component. More... | |
Utility class that represents a mask for included/excluded component of a mask.
MAX_COMP | maximum number of components |
The main advantage over std::bitset<N> is being CUDA-friendly. In addition, it provides convenience constructors and iteration over set bits.
Class intended to be used by DofManager to specify component mappings when constructing restriction/prolongation operators and during field-vector data copying.
Definition at line 90 of file ComponentMask.hpp.
|
inline |
Constructor.
numComp | total number of components |
includeAll | if true , initializes the mask to include rather than exclude all components |
Definition at line 113 of file ComponentMask.hpp.
|
inlineexplicit |
Constructor.
numComp | total number of components |
Definition at line 124 of file ComponentMask.hpp.
|
inline |
Range constructor, includes contiguous range of components.
numComp | total number of components |
lo | first component number to include |
hi | one-past last component number to include |
Definition at line 136 of file ComponentMask.hpp.
|
inline |
Converting constructor from another mask with fewer max components.
M | number of components in source mask |
other | source mask |
Definition at line 152 of file ComponentMask.hpp.
|
inline |
Definition at line 286 of file ComponentMask.hpp.
|
inline |
true
if mask is empty (no components selected), false
otherwise. Definition at line 328 of file ComponentMask.hpp.
|
inline |
Definition at line 295 of file ComponentMask.hpp.
|
inline |
Definition at line 319 of file ComponentMask.hpp.
|
inline |
Add a component.
i | component index |
Definition at line 417 of file ComponentMask.hpp.
|
inline |
Remove a component.
i | component index |
Definition at line 429 of file ComponentMask.hpp.
|
inline |
Check if a particular component is selected.
i | component index |
true
if i-th component is selected, false
otherwise Definition at line 339 of file ComponentMask.hpp.
|
inline |
Negation operator (inverts component selection).
Definition at line 440 of file ComponentMask.hpp.
|
inline |
|
inline |
Set new component limit and truncate all components above.
numComp | new max components value |
Definition at line 366 of file ComponentMask.hpp.
|
inline |
Definition at line 304 of file ComponentMask.hpp.
|
inline |
|
friend |
Make a new mask by adding a component.
mask | the mask to append to |
i | component index |
Definition at line 454 of file ComponentMask.hpp.
|
friend |
Make a new mask by adding a component.
i | component index |
mask | the mask to append to |
Definition at line 468 of file ComponentMask.hpp.
|
friend |
Make a new mask by removing a component.
mask | the mask to remove from |
i | component index |
Definition at line 480 of file ComponentMask.hpp.
|
friend |
Make a new mask by removing a component.
i | component index |
mask | the mask to remove from |
Definition at line 494 of file ComponentMask.hpp.