MeshLib
 
Loading...
Searching...
No Matches
MR::TaggedBitSet< T > Class Template Reference

container of bits representing specific indices (faces, verts or edges) More...

#include <MRBitSet.h>

+ Inheritance diagram for MR::TaggedBitSet< T >:

Public Types

using IndexType = Id<T>
 
- Public Types inherited from MR::BitSet
using base = boost::dynamic_bitset<std::uint64_t>
 
using IndexType = size_t
 

Public Member Functions

TaggedBitSetset (IndexType n, size_type len, bool val)
 
TaggedBitSetset (IndexType n, bool val=true)
 
TaggedBitSetset ()
 
TaggedBitSetreset (IndexType n, size_type len)
 
TaggedBitSetreset (IndexType n)
 
TaggedBitSetreset ()
 
TaggedBitSetflip (IndexType n, size_type len)
 
TaggedBitSetflip (IndexType n)
 
TaggedBitSetflip ()
 
bool test (IndexType n) const
 
bool test_set (IndexType n, bool val=true)
 
reference operator[] (IndexType pos)
 
bool operator[] (IndexType pos) const
 
IndexType find_first () const
 
IndexType find_next (IndexType pos) const
 
IndexType find_last () const
 
IndexType nthSetBit (size_t n) const
 returns the location of nth set bit (where the first bit corresponds to n=0) or IndexType(npos) if there are less bit set
 
TaggedBitSetoperator&= (const TaggedBitSet &b)
 
TaggedBitSetoperator|= (const TaggedBitSet &b)
 
TaggedBitSetoperator^= (const TaggedBitSet &b)
 
TaggedBitSetoperator-= (const TaggedBitSet &b)
 
TaggedBitSetsubtract (const TaggedBitSet &b, int bShiftInBlocks)
 subtracts b from this, considering that bits in b are shifted right on bShiftInBlocks*bits_per_block
 
void autoResizeSet (IndexType pos, size_type len, bool val=true)
 
void autoResizeSet (IndexType pos, bool val=true)
 
bool autoResizeTestSet (IndexType pos, bool val=true)
 
template<typename M >
TaggedBitSet getMapping (const M &map) const
 constructs another bit set from this where every set bit index is transformed using given map
 
TaggedBitSet getMapping (const Vector< IndexType, IndexType > &map) const
 
TaggedBitSet getMapping (const BMap< IndexType, IndexType > &map) const
 
TaggedBitSet getMapping (const HashMap< IndexType, IndexType > &map) const
 
template<typename M >
TaggedBitSet getMapping (const M &map, size_t resSize) const
 this is a faster version if the result size is known beforehand
 
TaggedBitSet getMapping (const Vector< IndexType, IndexType > &map, size_t resSize) const
 
TaggedBitSet getMapping (const HashMap< IndexType, IndexType > &map, size_t resSize) const
 
IndexType backId () const
 returns the identifier of the back() element
 
IndexType endId () const
 
template<typename M >
TaggedBitSet< T > getMapping (const M &map) const
 
template<typename M >
TaggedBitSet< T > getMapping (const M &map, size_t resSize) const
 
- Public Member Functions inherited from MR::BitSet
 BitSet (size_t numBits, bool fillValue)
 creates bitset of given size filled with given value
 
bool test (IndexType n) const
 
bool test_set (IndexType n, bool val=true)
 
BitSetset (IndexType n, size_type len, bool val)
 
BitSetset (IndexType n, bool val=true)
 
BitSetset ()
 
BitSetreset (IndexType n, size_type len)
 
BitSetreset (IndexType n)
 
BitSetreset ()
 
BitSetflip (IndexType n, size_type len)
 
BitSetflip (IndexType n)
 
BitSetflip ()
 
MRMESH_API BitSetoperator&= (const BitSet &b)
 
MRMESH_API BitSetoperator|= (const BitSet &b)
 
MRMESH_API BitSetoperator^= (const BitSet &b)
 
MRMESH_API BitSetoperator-= (const BitSet &b)
 
MRMESH_API BitSetsubtract (const BitSet &b, int bShiftInBlocks)
 subtracts b from this, considering that bits in b are shifted right on bShiftInBlocks*bits_per_block
 
MRMESH_API IndexType find_last () const
 return the highest index i such as bit i is set, or npos if *this has no on bits.
 
MRMESH_API size_t nthSetBit (size_t n) const
 returns the location of nth set bit (where the first bit corresponds to n=0) or npos if there are less bit set
 
void resizeWithReserve (size_t newSize)
 doubles reserved memory until resize(newSize) can be done without reallocation
 
void autoResizeSet (size_t pos, size_type len, bool val=true)
 sets elements [pos, pos+len) to given value, adjusting the size of the set to include new elements
 
void autoResizeSet (size_t pos, bool val=true)
 
bool autoResizeTestSet (size_t pos, bool val=true)
 same as autoResizeSet and returns previous value of pos-bit
 
size_t heapBytes () const
 returns the amount of memory this object occupies on heap
 
IndexType backId () const
 returns the identifier of the back() element
 
IndexType endId () const
 

Static Public Member Functions

static IndexType beginId ()
 [beginId(), endId()) is the range of all bits in the set
 
- Static Public Member Functions inherited from MR::BitSet
static IndexType beginId ()
 [beginId(), endId()) is the range of all bits in the set
 

Detailed Description

template<typename T>
class MR::TaggedBitSet< T >

container of bits representing specific indices (faces, verts or edges)

Member Typedef Documentation

◆ IndexType

template<typename T >
using MR::TaggedBitSet< T >::IndexType = Id<T>

Member Function Documentation

◆ autoResizeSet() [1/2]

template<typename T >
void MR::TaggedBitSet< T >::autoResizeSet ( IndexType pos,
bool val = true )
inline

◆ autoResizeSet() [2/2]

template<typename T >
void MR::TaggedBitSet< T >::autoResizeSet ( IndexType pos,
size_type len,
bool val = true )
inline

◆ autoResizeTestSet()

template<typename T >
bool MR::TaggedBitSet< T >::autoResizeTestSet ( IndexType pos,
bool val = true )
inlinenodiscard

◆ backId()

template<typename T >
IndexType MR::TaggedBitSet< T >::backId ( ) const
inlinenodiscard

returns the identifier of the back() element

◆ beginId()

template<typename T >
static IndexType MR::TaggedBitSet< T >::beginId ( )
inlinestaticnodiscard

[beginId(), endId()) is the range of all bits in the set

◆ endId()

template<typename T >
IndexType MR::TaggedBitSet< T >::endId ( ) const
inlinenodiscard

◆ find_first()

template<typename T >
IndexType MR::TaggedBitSet< T >::find_first ( ) const
inlinenodiscard

◆ find_last()

template<typename T >
IndexType MR::TaggedBitSet< T >::find_last ( ) const
inlinenodiscard

◆ find_next()

template<typename T >
IndexType MR::TaggedBitSet< T >::find_next ( IndexType pos) const
inlinenodiscard

◆ flip() [1/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::flip ( )
inline

◆ flip() [2/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::flip ( IndexType n)
inline

◆ flip() [3/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::flip ( IndexType n,
size_type len )
inline

◆ getMapping() [1/7]

template<typename T >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const BMap< IndexType, IndexType > & map) const
inlinenodiscard

◆ getMapping() [2/7]

template<typename T >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const HashMap< IndexType, IndexType > & map) const
inlinenodiscard

◆ getMapping() [3/7]

template<typename T >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const HashMap< IndexType, IndexType > & map,
size_t resSize ) const
inlinenodiscard

◆ getMapping() [4/7]

template<typename T >
template<typename M >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const M & map) const
nodiscard

constructs another bit set from this where every set bit index is transformed using given map

◆ getMapping() [5/7]

template<typename T >
template<typename M >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const M & map,
size_t resSize ) const
nodiscard

this is a faster version if the result size is known beforehand

◆ getMapping() [6/7]

template<typename T >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const Vector< IndexType, IndexType > & map) const
inlinenodiscard

◆ getMapping() [7/7]

template<typename T >
TaggedBitSet MR::TaggedBitSet< T >::getMapping ( const Vector< IndexType, IndexType > & map,
size_t resSize ) const
inlinenodiscard

◆ nthSetBit()

template<typename T >
IndexType MR::TaggedBitSet< T >::nthSetBit ( size_t n) const
inlinenodiscard

returns the location of nth set bit (where the first bit corresponds to n=0) or IndexType(npos) if there are less bit set

◆ operator&=()

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::operator&= ( const TaggedBitSet< T > & b)
inline

◆ operator-=()

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::operator-= ( const TaggedBitSet< T > & b)
inline

◆ operator[]() [1/2]

template<typename T >
reference MR::TaggedBitSet< T >::operator[] ( IndexType pos)
inlinenodiscard

◆ operator[]() [2/2]

template<typename T >
bool MR::TaggedBitSet< T >::operator[] ( IndexType pos) const
inlinenodiscard

◆ operator^=()

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::operator^= ( const TaggedBitSet< T > & b)
inline

◆ operator|=()

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::operator|= ( const TaggedBitSet< T > & b)
inline

◆ reset() [1/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::reset ( )
inline

◆ reset() [2/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::reset ( IndexType n)
inline

◆ reset() [3/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::reset ( IndexType n,
size_type len )
inline

◆ set() [1/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::set ( )
inline

◆ set() [2/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::set ( IndexType n,
bool val = true )
inline

◆ set() [3/3]

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::set ( IndexType n,
size_type len,
bool val )
inline

◆ subtract()

template<typename T >
TaggedBitSet & MR::TaggedBitSet< T >::subtract ( const TaggedBitSet< T > & b,
int bShiftInBlocks )
inline

subtracts b from this, considering that bits in b are shifted right on bShiftInBlocks*bits_per_block

◆ test()

template<typename T >
bool MR::TaggedBitSet< T >::test ( IndexType n) const
inlinenodiscard

◆ test_set()

template<typename T >
bool MR::TaggedBitSet< T >::test_set ( IndexType n,
bool val = true )
inlinenodiscard

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