1#ifndef _KITTY_STATIC_TT_H_
2#define _KITTY_STATIC_TT_H_
15template<u
int32_t NumVars,
bool = ( NumVars <= 6 )>
16struct static_truth_table;
20template<u
int32_t NumVars>
26 NumBits = uint64_t( 1 ) << NumVars
50 inline uint64_t *
begin() noexcept {
return &_bits; }
54 inline uint64_t *
end() noexcept {
return ( &_bits ) + 1; }
58 inline const uint64_t *
begin()
const noexcept {
return &_bits; }
62 inline const uint64_t *
end()
const noexcept {
return ( &_bits ) + 1; }
66 inline uint64_t *
rbegin() noexcept {
return &_bits; }
70 inline uint64_t *
rend() noexcept {
return ( &_bits ) + 1; }
74 inline const uint64_t *
cbegin()
const noexcept {
return &_bits; }
78 inline const uint64_t *
cend()
const noexcept {
return ( &_bits ) + 1; }
82 inline const uint64_t *
crbegin()
const noexcept {
return &_bits; }
86 inline const uint64_t *
crend()
const noexcept {
return ( &_bits ) + 1; }
99 if ( other.num_vars() ==
num_vars() )
101 std::copy( other.begin(), other.end(),
begin() );
113 inline void mask_bits() noexcept { _bits &= detail::masks[NumVars]; }
123template<u
int32_t NumVars>
129 NumBlocks = ( NumVars <= 6 ) ? 1u : ( 1u << ( NumVars - 6 ) )
134 NumBits = uint64_t( 1 ) << NumVars
169 inline typename std::array<uint64_t, NumBlocks>::iterator
begin() noexcept {
return _bits.begin(); }
173 inline typename std::array<uint64_t, NumBlocks>::iterator
end() noexcept {
return _bits.end(); }
177 inline typename std::array<uint64_t, NumBlocks>::const_iterator
begin()
const noexcept {
return _bits.begin(); }
181 inline typename std::array<uint64_t, NumBlocks>::const_iterator
end()
const noexcept {
return _bits.end(); }
185 inline typename std::array<uint64_t, NumBlocks>::reverse_iterator
rbegin() noexcept {
return _bits.rbegin(); }
189 inline typename std::array<uint64_t, NumBlocks>::reverse_iterator
rend() noexcept {
return _bits.rend(); }
193 inline typename std::array<uint64_t, NumBlocks>::const_iterator
cbegin()
const noexcept {
return _bits.cbegin(); }
197 inline typename std::array<uint64_t, NumBlocks>::const_iterator
cend()
const noexcept {
return _bits.cend(); }
201 inline typename std::array<uint64_t, NumBlocks>::const_reverse_iterator
crbegin()
const noexcept {
return _bits.crbegin(); }
205 inline typename std::array<uint64_t, NumBlocks>::const_reverse_iterator
crend()
const noexcept {
return _bits.crend(); }
218 if ( other.num_bits() ==
num_bits() )
220 std::copy( other.begin(), other.end(),
begin() );
235 std::array<uint64_t, NumBlocks> _bits;
#define ABC_NAMESPACE_CXX_HEADER_START
#define ABC_NAMESPACE_CXX_HEADER_END
std::array< uint64_t, NumBlocks >::iterator end() noexcept
End iterator to bits.
static_truth_table< NumVars > construct() const
std::array< uint64_t, NumBlocks >::const_iterator cend() const noexcept
Constant end iterator to bits.
std::array< uint64_t, NumBlocks >::reverse_iterator rend() noexcept
Reverse end iterator to bits.
std::array< uint64_t, NumBlocks >::const_reverse_iterator crend() const noexcept
Constant teverse end iterator to bits.
std::array< uint64_t, NumBlocks >::iterator begin() noexcept
Begin iterator to bits.
static_truth_table< NumVars > & operator=(const TT &other)
Assign other truth table if number of variables match.
std::array< uint64_t, NumBlocks >::reverse_iterator rbegin() noexcept
Reverse begin iterator to bits.
std::array< uint64_t, NumBlocks >::const_reverse_iterator crbegin() const noexcept
Constant reverse begin iterator to bits.
void mask_bits() noexcept
uint32_t num_vars() const noexcept
uint32_t num_blocks() const noexcept
std::array< uint64_t, NumBlocks >::const_iterator begin() const noexcept
Begin iterator to bits.
uint32_t num_bits() const noexcept
std::array< uint64_t, NumBlocks >::const_iterator end() const noexcept
End iterator to bits.
std::array< uint64_t, NumBlocks >::const_iterator cbegin() const noexcept
Constant begin iterator to bits.
uint32_t num_vars() const noexcept
const uint64_t * crend() const noexcept
Constant everse end iterator to bits.
uint64_t * begin() noexcept
Begin iterator to bits.
uint64_t * rbegin() noexcept
Reverse begin iterator to bits.
uint32_t num_bits() const noexcept
void mask_bits() noexcept
const uint64_t * crbegin() const noexcept
Constant reverse begin iterator to bits.
const uint64_t * begin() const noexcept
Begin iterator to bits.
uint64_t * rend() noexcept
Reverse end iterator to bits.
uint64_t * end() noexcept
End iterator to bits.
static_truth_table< NumVars > & operator=(const TT &other)
Assign other truth table if number of variables match.
const uint64_t * end() const noexcept
End iterator to bits.
static_truth_table< NumVars > construct() const
const uint64_t * cbegin() const noexcept
Constant begin iterator to bits.
uint32_t num_blocks() const noexcept
const uint64_t * cend() const noexcept
Constant end iterator to bits.