Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::SparseBitset< IntegerType > Class Template Reference

#include <bitset.h>

Public Member Functions

 SparseBitset ()
 
 SparseBitset (IntegerType size)
 
 SparseBitset (const SparseBitset &)=delete
 This type is neither copyable nor movable.
 
SparseBitsetoperator= (const SparseBitset &)=delete
 
IntegerType size () const
 
void SparseClearAll ()
 
void ClearAll ()
 
void ClearAndResize (IntegerType size)
 
void Resize (IntegerType size)
 
bool operator[] (IntegerType index) const
 
void Set (IntegerType index)
 
void SetUnsafe (IntegerType index)
 
void Clear (IntegerType index)
 
int NumberOfSetCallsWithDifferentArguments () const
 
const std::vector< IntegerType > & PositionsSetAtLeastOnce () const
 
void NotifyAllClear ()
 
Bitset64< IntegerType >::ConstView const_view () const
 

Detailed Description

template<typename IntegerType = int64_t>
class operations_research::SparseBitset< IntegerType >

A simple utility class to set/unset integer in a range [0, size). This is optimized for sparsity.

Definition at line 822 of file bitset.h.

Constructor & Destructor Documentation

◆ SparseBitset() [1/3]

template<typename IntegerType = int64_t>
operations_research::SparseBitset< IntegerType >::SparseBitset ( )
inline

Definition at line 824 of file bitset.h.

◆ SparseBitset() [2/3]

template<typename IntegerType = int64_t>
operations_research::SparseBitset< IntegerType >::SparseBitset ( IntegerType size)
inlineexplicit

Definition at line 825 of file bitset.h.

◆ SparseBitset() [3/3]

template<typename IntegerType = int64_t>
operations_research::SparseBitset< IntegerType >::SparseBitset ( const SparseBitset< IntegerType > & )
delete

This type is neither copyable nor movable.

Member Function Documentation

◆ Clear()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::Clear ( IntegerType index)
inline

Definition at line 874 of file bitset.h.

◆ ClearAll()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::ClearAll ( )
inline

Definition at line 835 of file bitset.h.

◆ ClearAndResize()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::ClearAndResize ( IntegerType size)
inline

As of 19/03/2014, experiments show that this is a reasonable threshold.

Definition at line 839 of file bitset.h.

◆ const_view()

template<typename IntegerType = int64_t>
Bitset64< IntegerType >::ConstView operations_research::SparseBitset< IntegerType >::const_view ( ) const
inline

Definition at line 895 of file bitset.h.

◆ NotifyAllClear()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::NotifyAllClear ( )
inline

Tells the class that all its bits are cleared, so it can reset to_clear_ to the empty vector. Note that this call is "unsafe" since the fact that the class is actually all cleared is only checked in debug mode.

This is useful to iterate on the "set" positions while clearing them for instance. This way, after the loop, a client can call this for efficiency.

Definition at line 888 of file bitset.h.

◆ NumberOfSetCallsWithDifferentArguments()

template<typename IntegerType = int64_t>
int operations_research::SparseBitset< IntegerType >::NumberOfSetCallsWithDifferentArguments ( ) const
inline

Definition at line 875 of file bitset.h.

◆ operator=()

template<typename IntegerType = int64_t>
SparseBitset & operations_research::SparseBitset< IntegerType >::operator= ( const SparseBitset< IntegerType > & )
delete

◆ operator[]()

template<typename IntegerType = int64_t>
bool operations_research::SparseBitset< IntegerType >::operator[] ( IntegerType index) const
inline

Definition at line 863 of file bitset.h.

◆ PositionsSetAtLeastOnce()

template<typename IntegerType = int64_t>
const std::vector< IntegerType > & operations_research::SparseBitset< IntegerType >::PositionsSetAtLeastOnce ( ) const
inline

Definition at line 878 of file bitset.h.

◆ Resize()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::Resize ( IntegerType size)
inline

Definition at line 850 of file bitset.h.

◆ Set()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::Set ( IntegerType index)
inline

Definition at line 864 of file bitset.h.

◆ SetUnsafe()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::SetUnsafe ( IntegerType index)
inline

Definition at line 870 of file bitset.h.

◆ size()

template<typename IntegerType = int64_t>
IntegerType operations_research::SparseBitset< IntegerType >::size ( ) const
inline

Definition at line 830 of file bitset.h.

◆ SparseClearAll()

template<typename IntegerType = int64_t>
void operations_research::SparseBitset< IntegerType >::SparseClearAll ( )
inline

Definition at line 831 of file bitset.h.


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