40 void append(
bool value) {
insert(myBitCount, value); }
44 void cycle(
exint shift_offset);
47 void setSize(
exint new_size);
59 exint numBitsSet()
const;
60 exint numBitsClear()
const;
62 bool allBitsSet()
const;
63 bool allBitsClear()
const;
77 void setAllBits(
bool value);
81 int save(std::ostream &os,
bool binary =
false)
const;
90 exint iterateInit()
const;
101 exint findFirstBit()
const;
102 exint findLastBit()
const;
116 {
return !(*
this == in_map); }
125 int64 mem = inclusive ?
sizeof(*this) : 0;
130 uint computeHash()
const;
158 return myArray == i.myArray
159 && myIndex == i.myIndex
160 && mySize == i.mySize;
164 return !(*
this == i);
168 return myIndex >= mySize;
177 myIndex = myArray->iterateInit();
184 myIndex = myArray->iterateNext(myIndex);
191 , mySize(array->
size())
213 myBitCount = bit_count;
228 return (size_in_bits + (myBitsPerWord - 1)) / myBitsPerWord;
232 static const int myBitsPerWord =
sizeof(
BlockType)*8;
233 static const int myWordShift =
SYS_LOG2F(myBitsPerWord);
234 static const int myWordMask = (1 << myWordShift) - 1;
249 return (bit >> myWordShift);
256 return (
BlockType(1) << (bit & myWordMask));
259 void outTo(std::ostream &os)
const;
283 word = myBits + indexWord(index);
284 return ((*word & indexBit(index)) != 0);
300 word = myBits + indexWord(index);
301 mask = indexBit(index);
302 previous = *word &
mask;
304 if( value ) *word |=
mask;
307 return (previous != 0);
323 word = myBits + indexWord(index);
324 mask = indexBit(index);
325 previous = *word &
mask;
329 return (previous != 0);
336 BlockType word = myBits[indexWord(index)];
337 int bit = index & myWordMask;
345 BlockType &word = myBits[indexWord(index)];
346 int bit = index & myWordMask;
354 BlockType &word = myBits[indexWord(index)];
355 int bit = index & myWordMask;
360 UT_BitArray::iterateFromWord(
uint64 word_index)
const
362 for (; word_index < myWordCount; word_index++)
364 if (myBits[word_index])
366 exint bit_index = SYSfirstBitSet(myBits[word_index]);
368 return bit_index + (word_index << myWordShift);
379 return iterateFromWord(0);
387 return iterateFromWord(0);
390 if (current_bit >= (myBitCount - 1))
393 int bit_index = current_bit & myWordMask;
394 exint word_index = current_bit >> myWordShift;
397 bit_index = SYSnextBitSet(*word, bit_index);
401 return bit_index + (word_index << myWordShift);
405 return iterateFromWord(word_index);
int64 getMemoryUsage(bool inclusive=true) const
GLenum GLuint GLsizei bufsize
bool getBit(exint index) const
#define SYS_DEPRECATED(__V__)
bool getBitFast(exint index) const
bool toggleBit(exint index)
OrtDmlDeviceFilter & operator^=(OrtDmlDeviceFilter &a, OrtDmlDeviceFilter b)
const GLuint GLenum const void * binary
exint iterateNext(exint current_bit) const
void swap(T &lhs, T &rhs)
bool operator!=(const iterator &i) const
bool operator[](exint index) const
unsigned long long uint64
OIIO_FORCEINLINE vbool4 insert(const vbool4 &a, bool val)
Helper: substitute val for a[i].
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
std::ptrdiff_t difference_type
void toggleBitFast(exint index)
bool operator==(const iterator &i) const
void unsafeShareData(BlockType *bits, exint bit_count)
void setBitFast(exint index, bool value)
GLboolean GLboolean GLboolean b
Iterate over bits that are turned on.
const BlockType * data() const
friend std::ostream & operator<<(std::ostream &os, const UT_BitArray &map)
bool setBit(exint index, bool value)
static exint numWords(exint size_in_bits)
void iterateInit(exint &i) const
bool operator!=(const UT_BitArray &in_map) const
OrtDmlDeviceFilter & operator&=(OrtDmlDeviceFilter &a, OrtDmlDeviceFilter b)
ImageBuf OIIO_API resize(const ImageBuf &src, string_view filtername="", float filterwidth=0.0f, ROI roi={}, int nthreads=0)
exint getBit() const
Get the current iteration state.
UT_API size_t format(char *buffer, size_t bufsize, const UT_BitArray &b)
Overload for custom formatting of a UT_BitArray. with UTformat.
LeafData & operator=(const LeafData &)=delete
exint iterateInit() const
IMATH_HOSTDEVICE IMATH_CONSTEXPR14 bool intersects(const Box< Vec3< T >> &b, const Line3< T > &r, Vec3< T > &ip) IMATH_NOEXCEPT
OIIO_FORCEINLINE const vint4 & operator-=(vint4 &a, const vint4 &b)
bool operator()(exint index) const
std::forward_iterator_tag iterator_category
OrtDmlDeviceFilter & operator|=(OrtDmlDeviceFilter &a, OrtDmlDeviceFilter b)