Rosetta
|
This struct condenses N boolean values into roughly N bits, saving roughly 4x memory. NUM_ELEMS parameter takes in the number of boolean values. BASE_INDEX parameter takes in the index of the first value. The recommended way to use this struct is with an enum. See core::scoring::hbonds::graph::AtomInfo for an example. More...
#include <DenseBoolMap.hh>
Public Member Functions | |
DenseBoolMap () | |
void | set (unsigned int const element, bool const setting) |
template<unsigned int const element> | |
void | set (bool const setting) |
templated equivalent to set( element, setting ). I personally like this one better because it does bounds-checking at compile time and not just in debug mode. Of course, this only works if you know the value for "element" when calling set(). More... | |
bool | get (unsigned int const element) const |
template<unsigned int const element> | |
constexpr bool | get () const |
templated equivalent to get( element ). I personally like this one better because it does bounds-checking at compile time and not just in debug mode. Of course, this only works if you know the value for "element" when calling get(). More... | |
Static Public Member Functions | |
static constexpr unsigned int | num_bytes () |
static constexpr unsigned int | byte_for_element (unsigned int const element) |
static constexpr unsigned char | mask_for_element (unsigned int const element) |
Private Attributes | |
std::array< unsigned char,(NUM_ELEMS+3)/4 > | data_ |
This struct condenses N boolean values into roughly N bits, saving roughly 4x memory. NUM_ELEMS parameter takes in the number of boolean values. BASE_INDEX parameter takes in the index of the first value. The recommended way to use this struct is with an enum. See core::scoring::hbonds::graph::AtomInfo for an example.
|
inline |
|
inlinestaticconstexpr |
|
inlineconstexpr |
templated equivalent to get( element ). I personally like this one better because it does bounds-checking at compile time and not just in debug mode. Of course, this only works if you know the value for "element" when calling get().
References utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::byte_for_element(), utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::data_, and utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::mask_for_element().
Referenced by pyrosetta.distributed.cluster.logging_handlers.MultiSocketHandler::emit(), pyrosetta.distributed.cluster.logging_handlers.MultiSocketHandler::pop_masked_key(), and pyrosetta.distributed.cluster.logging_handlers.MultiSocketHandler::set_masked_key().
|
inline |
References utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::byte_for_element(), utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::data_, utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::mask_for_element(), numeric::interpolation::to_string(), and utility_exit_with_message.
Referenced by pyrosetta.distributed.cluster.logging_handlers.MultiSocketHandler::emit(), pyrosetta.distributed.cluster.logging_handlers.MultiSocketHandler::pop_masked_key(), and pyrosetta.distributed.cluster.logging_handlers.MultiSocketHandler::set_masked_key().
|
inlinestaticconstexpr |
|
inlinestaticconstexpr |
|
inline |
templated equivalent to set( element, setting ). I personally like this one better because it does bounds-checking at compile time and not just in debug mode. Of course, this only works if you know the value for "element" when calling set().
References utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::byte_for_element(), utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::data_, and utility::DenseBoolMap< NUM_ELEMS, BASE_INDEX >::mask_for_element().
|
inline |
|
private |