60 using iterator_category = std::input_iterator_tag;
61 using value_type = std::vector<bool>;
62 using reference = value_type
const &;
63 using pointer = value_type
const *;
64 using difference_type = ptrdiff_t;
84 explicit operator bool()
const {
return !
vector_.empty(); }
86 pointer operator->()
const {
return &
vector_; }
87 reference operator*()
const {
return vector_; }
98 bool operator[](std::size_t i)
const;
160 bool Learn(std::size_t i,
bool value);
184 [[nodiscard]]
bool IsDone()
const;
201std::vector<bool> &operator++(std::vector<bool> &vector);
202std::vector<bool> &operator--(std::vector<bool> &vector);
207#ifdef DLINEAR_INCLUDE_FMT
209#include "dlinear/util/logging.h"
BitIncrementIterator class.
std::vector< bool > starting_vector_
Vector to store the starting value of the iterator.
void ResetNonFixedLeft(std::size_t start_pos)
Reset all the non-fixed bits to the left of start_pos to their starting value.
bool IsDone() const
Check if the iterator is done.
bool Learn(std::size_t i)
Learn the value of the bit at position i by inverting the bit.
void ResetNonFixedRight(std::size_t start_pos=0)
Reset all the non-fixed bits to the right of start_pos to their starting value.
void ResetNonFixed()
Reset all the non-fixed bits in the vector to their starting value.
std::vector< bool > ending_vector_
Vector to store the ending value of the iterator.
void SetFixed(std::size_t i, bool fixed)
Set whether the i 'th bit of the vector is fixed.
std::vector< bool > vector_
The bit vector that will assume all the possible values.
void Set(std::size_t i, bool value, bool force=false)
Set the i 't bit of the vector to value.
BitIncrementIterator(std::size_t n)
Construct a new BitIncrementIterator object.
bool IsFixed(std::size_t i) const
Check if the bit at position i is fixed.
bool Learn(std::size_t i, bool value)
Learn the value of the bit at position i by setting the bit to value.
void UpdateVector(std::size_t i, bool value)
After a Learn operation to set the i 'th bit to value, update the vector.
std::vector< bool > fixed_
Vector to indicate the fixed bits.
Global namespace for the dlinear library.