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>
 
using base
 
- 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
 returns backId() + 1
 
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
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.
 
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
 

Detailed Description

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

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

Member Typedef Documentation

◆ base

template<typename T >
using MR::BitSet::base

◆ 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 )
inline

◆ backId()

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

returns the identifier of the back() element

◆ endId()

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

returns backId() + 1

◆ find_first()

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

◆ find_last()

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

◆ find_next()

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

◆ 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
inline

◆ getMapping() [2/7]

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

◆ getMapping() [3/7]

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

◆ getMapping() [4/7]

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

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

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
inline

◆ getMapping() [7/7]

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

◆ nthSetBit()

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

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)
inline

◆ operator[]() [2/2]

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

◆ 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
inline

◆ test_set()

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

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