Molassembler  3.0.0
Molecule graph and conformer library
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Scine::Molassembler::Temple::Bitset< N > Class Template Reference

Constexpr bitset class. More...

#include <Bitset.h>

Public Member Functions

Constructor
constexpr Bitset ()
 Zeroing constructor. More...
 
Modification
constexpr void zero ()
 Zero out all bits. More...
 
constexpr void set (const std::size_t i)
 Sets a specific bit. More...
 
constexpr void unset (const std::size_t i)
 Unsets a specific bit. More...
 
constexpr void set (const std::size_t i, const bool value)
 Sets a specific bit to a specified value. More...
 
Information
constexpr bool test (const std::size_t i) const
 Test the value at a particular bit. More...
 

Private Types

Types
using Block = long long unsigned
 

Private Attributes

State
Array< Block, Bstorage
 

Static Private Attributes

Static const values
static constexpr std::size_t bitsPerBlock
 Number of bits per block. More...
 
static constexpr std::size_t B
 Number of Block types stored. More...
 

Detailed Description

template<std::size_t N>
class Scine::Molassembler::Temple::Bitset< N >

Constexpr bitset class.

Template Parameters
NNumber of bits to store.

Constructor & Destructor Documentation

template<std::size_t N>
constexpr Scine::Molassembler::Temple::Bitset< N >::Bitset ( )
inlineexplicit

Zeroing constructor.

Complexity \(\Theta(N)\)

Member Function Documentation

template<std::size_t N>
constexpr void Scine::Molassembler::Temple::Bitset< N >::set ( const std::size_t  i)
inline

Sets a specific bit.

Complexity \(\Theta(1)\)

template<std::size_t N>
constexpr void Scine::Molassembler::Temple::Bitset< N >::set ( const std::size_t  i,
const bool  value 
)
inline

Sets a specific bit to a specified value.

Complexity \(\Theta(1)\)

template<std::size_t N>
constexpr bool Scine::Molassembler::Temple::Bitset< N >::test ( const std::size_t  i) const
inline

Test the value at a particular bit.

Complexity \(\Theta(1)\)

template<std::size_t N>
constexpr void Scine::Molassembler::Temple::Bitset< N >::unset ( const std::size_t  i)
inline

Unsets a specific bit.

Complexity \(\Theta(1)\)

template<std::size_t N>
constexpr void Scine::Molassembler::Temple::Bitset< N >::zero ( )
inline

Zero out all bits.

Complexity \(\Theta(N)\)

Field Documentation

template<std::size_t N>
constexpr std::size_t Scine::Molassembler::Temple::Bitset< N >::B
staticprivate
Initial value:
= Math::ceil(
static_cast<double>(N) / static_cast<double>(bitsPerBlock)
)

Number of Block types stored.

template<std::size_t N>
constexpr std::size_t Scine::Molassembler::Temple::Bitset< N >::bitsPerBlock
staticprivate
Initial value:
= Math::floor(
Math::log(
static_cast<double>(std::numeric_limits<Block>::max()),
2.0
)
)

Number of bits per block.


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