|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Contiguous array of bits. More...
#include <bitArray.H>
Classes | |
| class | BitProxy |
| class | Iterator |
Public Types | |
| using | Item_Type = unsigned int |
| Type returned by Iterator::get_curr() - individual bits as unsigned int. | |
| using | iterator = __iterator< BitArray > |
| using | const_iterator = __const_iterator< BitArray > |
Public Member Functions | |
| BitArray (const size_t dim=0) | |
| Bit array constructor. | |
| BitArray (const size_t dim, const unsigned int value) | |
| Build a BitArray of size dim with all bits set to value. | |
| void | reserve (const size_t dim) |
| Reserve memory in advance for the bit array dim dimension. | |
| constexpr size_t | size () const noexcept |
| Returns the dimension of the bit array. | |
| void | set_size (const size_t sz) |
| Resets the dimension of the array. | |
| int | operator[] (const size_t i) const |
| BitProxy | operator[] (const size_t i) noexcept |
| int | read_bit_ne (const size_t i) const noexcept |
| int | read_bit (const size_t i) const |
| Read bit i. | |
| int | operator() (const size_t i) const |
| void | write_bit (const size_t i, const unsigned int value) |
| Write bit i with the value. | |
| int | read (const size_t i) const |
| Quick read of bit i. | |
| void | write (const size_t i, const unsigned int value) |
| Writes bit i with value without memory check. | |
| int | fast_read (const size_t i) const noexcept |
| void | fast_write (const size_t i, const unsigned int value) |
| void | push (const unsigned int value) |
| Inserts the value at the end of the array. | |
| void | pop () |
| Removes the last bit of the array. | |
| void | empty () noexcept |
| Delete all inserted bits. | |
| BitArray (const BitArray &array) | |
| Copy constructor. | |
| void | swap (BitArray &array) noexcept |
| BitArray (BitArray &&array) noexcept | |
| BitArray & | operator= (BitArray &&array) noexcept |
| DynList< char > | bits_list () const |
| Converts it to a list. | |
| BitArray & | operator= (const BitArray &array) |
| Bit array allocation. | |
| void | save (std::ostream &output) const |
| Saves the bit sequence in a text file. | |
| void | load (std::istream &input) |
| Loads an array of bits from a file. | |
| BitArray (std::ifstream &input) | |
| Build a new array of bits from a file constructed using the save() method. | |
| void | save_in_array_of_chars (const std::string &name, std::ostream &output) const |
| Saves a static string declaration to a text file. | |
| void | load_from_array_of_chars (const unsigned char str[], const size_t num_bits) |
| Reads an array of bits saved in a character array. | |
| void | left_shift (const size_t n=1) |
| Shifts the bits n positions to the left. | |
| void | right_shift (const size_t n=1) |
| Shifts the bits n positions to the right. | |
| void | dyn_left_shift (const size_t n=1) |
| Shifts bits n positions to the left dynamically. | |
| void | dyn_right_shift (const size_t n=1) |
| Shifts bits n positions to the right dynamically. | |
| void | circular_left_shift (const size_t n=1) |
| Shifts the bits n positions to the left circularly. | |
| void | circular_right_shift (const size_t n=1) |
| Shifts the bits n positions to the right circularly. | |
| template<typename T > | |
| void | set_num (T n) |
| void | set_num (const char &c) |
| void | set_num (const short &c) |
| void | set_num (const int &c) |
| void | set_num (const long &c) |
| unsigned long | get_unum () const noexcept |
| long | get_num () const noexcept |
| void | set_bit_str (const std::string &str) |
| std::string | get_bit_str () const |
| std::string | to_string () const |
| BitArray (const unsigned char str[], const size_t num_bits) | |
| Constructs a new array of bits from an array of characters previously generated with load_from_array_of_chars. | |
| BitArray & | operator|= (const BitArray &rhs) |
| BitArray & | operator&= (const BitArray &rhs) |
| bool | operator== (const BitArray &rhs) const |
| auto | get_it () const noexcept |
| template<class Operation > | |
| bool | traverse (Operation &operation) const |
| template<class Operation > | |
| bool | traverse (Operation &operation) |
| template<class Operation > | |
| bool | traverse (Operation &&operation=Operation()) const |
| template<class Operation > | |
| bool | traverse (Operation &&operation=Operation()) |
| template<template< typename > class Container = DynList> | |
| Container< unsigned int > | items () const |
| iterator | begin () noexcept |
| iterator | end () noexcept |
| const_iterator | begin () const noexcept |
| const_iterator | end () const noexcept |
| const_iterator | cbegin () const noexcept |
| const_iterator | cend () const noexcept |
| const_iterator | cbegin () noexcept |
| const_iterator | cend () noexcept |
| int | count_ones () const noexcept |
| int | count_zeros () const noexcept |
Public Member Functions inherited from Aleph::FunctionalMixin< BitArray, unsigned int > | |
| auto | for_each (Operation &operation) const -> decltype(self()) |
| Apply an operation to each element (read-only). | |
| auto | for_each (Operation &operation) -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | for_each (Operation &&operation=Operation()) const -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | for_each (Operation &&operation=Operation()) -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| auto | mutable_for_each (Operation &operation) -> decltype(self()) |
| Apply an operation to each element (mutable). | |
| auto | mutable_for_each (Operation &&operation=Operation()) -> decltype(self()) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | all (Operation &operation) const |
| Test if all elements satisfy a predicate. | |
| bool | all (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | forall (Operation &operation) const |
| Alias for all(). | |
| bool | forall (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| bool | exists (Operation &operation) const |
| Test if any element satisfies a predicate. | |
| bool | exists (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Container< __Type > | maps (Operation &operation) const |
| Transform elements using a mapping function. | |
| Container< __Type > | maps (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| __Type | foldl (const __Type &init, std::function< __Type(const __Type &, const unsigned int &)> operation) const |
| Left fold (reduce) with initial value. | |
| __Type | fold_left (std::function< __Type(const __Type &, const unsigned int &)> operation, const __Type &init) const |
| Left fold with operation first (alternative signature). | |
| unsigned int | fold (const unsigned int &init, Operation &operation) const |
| Simple fold with same type for accumulator and elements. | |
| unsigned int | fold (const unsigned int &init, Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| DynList< unsigned int > | filter (Operation &operation) const |
| Filter elements by a predicate. | |
| DynList< unsigned int > | filter (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| DynList< std::tuple< unsigned int, size_t > > | pfilter (Operation &operation) const |
| Filter with position information. | |
| DynList< std::tuple< unsigned int, size_t > > | pfilter (Operation &&operation=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::pair< DynList< unsigned int >, DynList< unsigned int > > | partition (Operation &op) const |
| Partition elements by a predicate. | |
| std::pair< DynList< unsigned int >, DynList< unsigned int > > | partition (Operation &&op=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| std::tuple< DynList< unsigned int >, DynList< unsigned int > > | tpartition (Operation &op) const |
| Partition returning tuple instead of pair. | |
| std::tuple< DynList< unsigned int >, DynList< unsigned int > > | tpartition (Operation &&op=Operation()) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| size_t | length () const noexcept |
| Count the number of elements. | |
| Container< unsigned int > | rev () const |
| Create a reversed copy. | |
| Container< unsigned int > | take (const size_t n) const |
| Take the first n elements. | |
| Container< unsigned int > | drop (const size_t n) const |
| Skip the first n elements. | |
| unsigned int | sum (const unsigned int &init=unsigned int {}) const |
| Compute the sum of all elements. | |
| unsigned int | product (const unsigned int &init) const |
| Compute the product of all elements. | |
| const unsigned int * | min () const |
| Find the minimum element. | |
| const unsigned int * | max () const |
| Find the maximum element. | |
| const unsigned int * | min_by (Compare cmp) const |
| Find the minimum element using a custom comparator. | |
| const unsigned int * | max_by (Compare cmp) const |
| Find the maximum element using a custom comparator. | |
| bool | has_value (const unsigned int &val) const |
| Check if container has a value. | |
| bool | none (Predicate &pred) const |
| Check if no element satisfies a predicate. | |
| bool | none (Predicate &&pred) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| size_t | count_if (Predicate pred) const |
| Count elements satisfying a predicate. | |
| const unsigned int * | first () const |
| Get the first element. | |
| unsigned int | first_or (const unsigned int &default_val) const |
| Get the first element or a default value. | |
| const unsigned int * | last () const |
| Get the last element. | |
| unsigned int | last_or (const unsigned int &default_val) const |
| Get the last element or a default value. | |
| Container< std::pair< size_t, unsigned int > > | enumerate () const |
| Enumerate elements with their indices. | |
| size_t | find_index (Predicate pred) const |
| Find the index of the first element satisfying a predicate. | |
| size_t | index_of (const unsigned int &val) const |
| Find the index of a specific value. | |
| Container< unsigned int > | unique () const |
| Remove consecutive duplicate elements. | |
| Container< unsigned int > | unique_by (EqPred eq) const |
| Remove consecutive duplicates using a custom equality predicate. | |
| Container< unsigned int > | intersperse (const unsigned int &sep) const |
| Intersperse a separator between elements. | |
| Container< Container< unsigned int > > | chunk (size_t n) const |
| Split into chunks of fixed size. | |
| Container< Container< unsigned int > > | sliding (size_t size, size_t step=1) const |
| Create sliding windows of fixed size. | |
| std::vector< unsigned int > | to_vector () const |
| Convert to std::vector. | |
| DynListType | to_dynlist () const |
| Convert container to DynList. | |
| StringType | join (const StringType &sep=StringType{", "}) const |
| Join elements into a string with separator. | |
| std::string | join_str (const std::string &sep=", ") const |
| Join string elements with separator. | |
| Container< std::pair< unsigned int, typename Other::Item_Type > > | zip_with (const Other &other) const |
| Zip with another container. | |
Private Member Functions | |
| void | clear_unused_bits_in_last_byte () noexcept |
| void | ensure_num_bytes (const size_t num_bytes) |
| size_t | get_num_bytes () const noexcept |
| template<class Operation > | |
| bool | __traverse (Operation &operation) |
Private Attributes | |
| size_t | current_size |
| DynArray< Byte > | array_of_bytes |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const BitArray &array) |
| BitArray | operator| (const BitArray &op1, const BitArray &op2) |
| BitArray | operator& (const BitArray &op1, const BitArray &op2) |
| const_iterator | cbegin (const BitArray &s) noexcept |
| const_iterator | cend (const BitArray &s) noexcept |
| const_iterator | begin (const BitArray &s) noexcept |
| const_iterator | end (const BitArray &s) noexcept |
| iterator | begin (BitArray &s) noexcept |
| iterator | end (BitArray &s) noexcept |
Additional Inherited Members | |
Protected Member Functions inherited from Aleph::FunctionalMixin< BitArray, unsigned int > | |
| const BitArray & | self () const noexcept |
| BitArray & | self () noexcept |
Contiguous array of bits.
BitArray defines a contiguous array of bits. The consumption of memory is proportional to n/8; where n is the number of bits that you want to manage.
The array is dynamic, which means it can expand dynamically according to need.
Access to the ith bit can be done using the operator []. However, since this kind of access is implemented using a proxy class, access may fail in some expressions where the compiler cannot carry out the appropriate type transformations.
Definition at line 188 of file bitArray.H.
Definition at line 1135 of file bitArray.H.
Type returned by Iterator::get_curr() - individual bits as unsigned int.
Definition at line 295 of file bitArray.H.
Definition at line 1135 of file bitArray.H.
Bit array constructor.
| [in] | dim | number of bits. By default, it is 256. |
| bad_alloc | if there is not enough memory for a block continuous dim/8 bytes. |
Definition at line 303 of file bitArray.H.
References array_of_bytes.
Build a BitArray of size dim with all bits set to value.
Definition at line 310 of file bitArray.H.
References dim(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and write_bit().
Copy constructor.
Instantiates an array of bits exact copy of array.
| [in] | array | the array of bits to be copied. |
| bad_alloc | if there is not enough memory for a block continuous dim/8 bytes. |
Definition at line 479 of file bitArray.H.
|
inlinenoexcept |
Definition at line 491 of file bitArray.H.
References swap().
|
inline |
Build a new array of bits from a file constructed using the save() method.
Definition at line 623 of file bitArray.H.
References load(), and Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Constructs a new array of bits from an array of characters previously generated with load_from_array_of_chars.
Definition at line 929 of file bitArray.H.
References load_from_array_of_chars().
Definition at line 1020 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and read_bit().
Referenced by traverse(), and traverse().
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
Converts it to a list.
Definition at line 506 of file bitArray.H.
References Aleph::DynList< T >::append(), current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and read_bit().
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
Shifts the bits n positions to the left circularly.
The bits are shifted without losing any, the first n bits They begin to occupy the last n positions in the arrangement.
| [in] | n | the number of positions to shift the bits. |
Definition at line 788 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), read_bit(), and write_bit().
Shifts the bits n positions to the right circularly.
The bits are shifted without losing any, the last n bits They come to occupy the first n positions in the arrangement.
| [in] | n | the number of positions to shift the bits. |
Definition at line 817 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), read_bit(), and write_bit().
|
inlineprivatenoexcept |
Definition at line 193 of file bitArray.H.
References array_of_bytes, current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and Aleph::Byte::set_int().
Referenced by dyn_right_shift(), load_from_array_of_chars(), operator&=(), Aleph::BitArray::BitProxy::operator=(), Aleph::BitArray::BitProxy::operator=(), operator|=(), pop(), set_size(), write(), and write_bit().
|
inlinenoexcept |
Definition at line 1137 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
|
inlinenoexcept |
Definition at line 1142 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Shifts bits n positions to the left dynamically.
The bits are shifted without losing any and the array grows adding n zeros to the right.
| [in] | n | the number of positions to shift the bits. |
Definition at line 747 of file bitArray.H.
References push().
Shifts bits n positions to the right dynamically.
The bits are shifted without losing any and the array is decremented. eliminating the n zeros that would be on the left
| [in] | n | the number of positions to shift the bits. |
Definition at line 760 of file bitArray.H.
References clear_unused_bits_in_last_byte(), current_size, read_bit(), set_size(), and write_bit().
|
inlinenoexcept |
Delete all inserted bits.
Definition at line 465 of file bitArray.H.
References array_of_bytes, and current_size.
Referenced by set_bit_str(), and set_num().
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
|
inlinenoexcept |
Definition at line 1135 of file bitArray.H.
Definition at line 438 of file bitArray.H.
References array_of_bytes.
Referenced by Aleph::Bloom_Filter< T >::contains().
Definition at line 443 of file bitArray.H.
References ah_out_of_range_error_if, and array_of_bytes.
Referenced by Aleph::Bloom_Filter< T >::insert().
|
inline |
Definition at line 906 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and read_bit().
Referenced by to_string().
|
inlinenoexcept |
Definition at line 1105 of file bitArray.H.
|
inlinenoexcept |
Definition at line 886 of file bitArray.H.
References get_unum().
|
inlineprivatenoexcept |
Definition at line 223 of file bitArray.H.
References current_size.
Referenced by operator&=(), operator|=(), pop(), save(), and save_in_array_of_chars().
Definition at line 874 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and read_bit_ne().
Referenced by get_num().
Definition at line 1133 of file bitArray.H.
Shifts the bits n positions to the left.
The bits are shifted and the array is considered a fixed size, that is, the first n bits are lost.
| [in] | n | the number of positions to shift the bits. |
Definition at line 711 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), read_bit(), and write_bit().
|
inline |
Loads an array of bits from a file.
load(input) takes the file opened in input, previously saved with the load() method, and restores the array to the value saved.
| [in] | input | stream where the arrangement and that must have been previously saved with save(). |
Definition at line 590 of file bitArray.H.
References ah_runtime_error_if, current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and swap().
Referenced by BitArray(), Aleph::Huffman_Encoder_Engine::load_tree(), and Aleph::load_tree().
|
inline |
Reads an array of bits saved in a character array.
load_from_array_of_chars(str, num_bits) takes an array str, previously generated with save_in_array_of_chars, of num_bits long, and loads it.
| [in] | str | the character array where the of is located bits. |
| [in] | num_bits | the number of bits in the array. Note that not is the same as the number of bytes. |
Definition at line 687 of file bitArray.H.
References array_of_bytes, clear_unused_bits_in_last_byte(), and current_size.
Referenced by BitArray(), and Aleph::load_tree_from_array().
|
inline |
Definition at line 967 of file bitArray.H.
References array_of_bytes, clear_unused_bits_in_last_byte(), current_size, get_num_bytes(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), Aleph::Byte::set_int(), and size().
|
inline |
Definition at line 383 of file bitArray.H.
References read_bit().
|
inlinenoexcept |
Definition at line 497 of file bitArray.H.
References array_of_bytes, current_size, and swap().
|
inline |
Bit array allocation.
Release all memory of this, set aside new memory for host array and exactly copies the bits of array to this.
| [in] | array | the array of bits to be copied. |
| bad_alloc | if there is not enough memory for a block continuous dim/8 bytes. |
Definition at line 525 of file bitArray.H.
References array_of_bytes, and current_size.
|
inline |
Definition at line 1006 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), read_bit(), and size().
|
inline |
Definition at line 356 of file bitArray.H.
References read_bit().
|
inlinenoexcept |
Definition at line 358 of file bitArray.H.
|
inline |
Definition at line 934 of file bitArray.H.
References array_of_bytes, clear_unused_bits_in_last_byte(), current_size, ensure_num_bytes(), get_num_bytes(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), Aleph::Byte::set_int(), and size().
|
inline |
Removes the last bit of the array.
Definition at line 456 of file bitArray.H.
References ah_underflow_error_if, array_of_bytes, clear_unused_bits_in_last_byte(), current_size, and get_num_bytes().
Referenced by Aleph::Huffman_Encoder_Engine::build_prefix_encoding().
Inserts the value at the end of the array.
Definition at line 450 of file bitArray.H.
References current_size, and write_bit().
Referenced by Aleph::Huffman_Encoder_Engine::build_prefix_encoding(), dyn_left_shift(), TEST(), and Aleph::tree_to_bits().
Quick read of bit i.
Read bit i without checking memory
| [in] | i | index of the bit to be read. |
Definition at line 411 of file bitArray.H.
References ah_out_of_range_error_if, array_of_bytes, and current_size.
Read bit i.
| [in] | i | index of the bit to be read. |
Definition at line 377 of file bitArray.H.
References ah_out_of_range_error_if, current_size, and read_bit_ne().
Referenced by __traverse(), bits_list(), Aleph::bits_to_tree_helper(), circular_left_shift(), circular_right_shift(), demo_bitwise_operations(), dyn_right_shift(), get_bit_str(), Aleph::BitArray::Iterator::get_curr(), left_shift(), operator()(), operator==(), operator[](), right_shift(), TEST(), TEST(), TEST(), TEST(), and TEST().
Definition at line 360 of file bitArray.H.
References array_of_bytes, and Aleph::Byte::read_bit().
Referenced by Aleph::BitArray::Iterator::get_curr_ne(), get_unum(), and read_bit().
Reserve memory in advance for the bit array dim dimension.
reserve() sets aside enough memory in advance to save dim bits. In this way, write or read accesses can be done directly and more quickly using the read() and write().
| bad_alloc | if not enough memory |
Definition at line 328 of file bitArray.H.
References dim(), and set_size().
Referenced by Aleph::Bloom_Filter< T >::Bloom_Filter(), set_bit_str(), and set_num().
Shifts the bits n positions to the right.
The bits are shifted and the array is considered a fixed size, that is, the last n bits are lost.
| [in] | n | the number of positions to shift the bits. |
Definition at line 729 of file bitArray.H.
References current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), read_bit(), and write_bit().
|
inline |
Saves the bit sequence in a text file.
save() stores the sequence in the output text file, already opened, of bits in decimal format.
The first line always saves the size in bytes and in bits. The sequential bytes are then saved as a decimal value. corresponding to the arrangement.
| [in] | output | open output stream where the arrangement. |
Definition at line 548 of file bitArray.H.
References ah_runtime_error_if, array_of_bytes, current_size, get_num_bytes(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and output.
|
inline |
Saves a static string declaration to a text file.
characters representing the arrangement.
save_in_array_of_chars(name, output) generates a declaration of the guy:
char name [ size ] = { comma-separated array values };
The declaration is saved in the output stream and the array name is name.
| [in] | name | name of the array variable. |
| [in] | output | output stream where you want to save the statement. |
Definition at line 643 of file bitArray.H.
References array_of_bytes, current_size, get_num_bytes(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and output.
Definition at line 891 of file bitArray.H.
References empty(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), reserve(), and write_bit().
Definition at line 854 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 864 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 869 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 859 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 840 of file bitArray.H.
References current_size, empty(), Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), reserve(), and write_bit().
Resets the dimension of the array.
Definition at line 337 of file bitArray.H.
References array_of_bytes, clear_unused_bits_in_last_byte(), current_size, Aleph::FunctionalMixin< BitArray, unsigned int >::maps(), and write_bit().
Referenced by dyn_right_shift(), reserve(), and Aleph::Bit_Mat_Graph< GT, SA >::set_list_graph().
Returns the dimension of the bit array.
Definition at line 334 of file bitArray.H.
References current_size.
Referenced by Aleph::bits_to_tree_helper(), Aleph::code(), Aleph::Bloom_Filter< T >::contains(), demo_bitwise_operations(), Aleph::BitArray::Iterator::end(), Aleph::Bloom_Filter< T >::get_m(), Aleph::Bloom_Filter< T >::get_x(), Aleph::BitArray::Iterator::has_curr(), Aleph::Bloom_Filter< T >::hashes(), Aleph::Bloom_Filter< T >::insert(), Aleph::BitArray::Iterator::next(), operator&=(), operator==(), operator|=(), Aleph::BitArray::Iterator::reset_last(), Aleph::Bloom_Filter< T >::set_bits(), TEST(), and TEST().
Definition at line 485 of file bitArray.H.
References array_of_bytes, and current_size.
Referenced by BitArray(), load(), operator=(), and Aleph::Bloom_Filter< T >::swap().
|
inline |
Definition at line 915 of file bitArray.H.
References get_bit_str().
Definition at line 1126 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 1120 of file bitArray.H.
References Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 1114 of file bitArray.H.
References __traverse(), and Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Definition at line 1108 of file bitArray.H.
References __traverse(), and Aleph::FunctionalMixin< BitArray, unsigned int >::maps().
Writes bit i with value without memory check.
| [in] | i | index of the bit to be written. |
| [in] | value | value to be written at position i. |
Definition at line 426 of file bitArray.H.
References ah_out_of_range_error_if, array_of_bytes, clear_unused_bits_in_last_byte(), and current_size.
Write bit i with the value.
| [in] | i | index of the bit to be written. |
| [in] | value | value to be written at position i. |
Definition at line 392 of file bitArray.H.
References ah_out_of_range_error_if, array_of_bytes, clear_unused_bits_in_last_byte(), and current_size.
Referenced by BitArray(), circular_left_shift(), circular_right_shift(), demo_bitwise_operations(), dyn_right_shift(), left_shift(), push(), right_shift(), set_bit_str(), set_num(), set_size(), TEST(), TEST(), TEST(), and TEST().
Definition at line 1135 of file bitArray.H.
|
friend |
Definition at line 1135 of file bitArray.H.
|
friend |
Definition at line 1135 of file bitArray.H.
|
friend |
Definition at line 1135 of file bitArray.H.
Definition at line 1135 of file bitArray.H.
|
friend |
Definition at line 1135 of file bitArray.H.
Definition at line 999 of file bitArray.H.
Definition at line 920 of file bitArray.H.
Definition at line 992 of file bitArray.H.
Definition at line 191 of file bitArray.H.
Referenced by BitArray(), Aleph::BitArray::BitProxy::BitProxy(), clear_unused_bits_in_last_byte(), empty(), ensure_num_bytes(), fast_read(), fast_write(), load_from_array_of_chars(), operator&=(), operator=(), operator=(), Aleph::BitArray::BitProxy::operator=(), Aleph::BitArray::BitProxy::operator=(), operator|=(), pop(), read(), read_bit_ne(), save(), save_in_array_of_chars(), set_size(), swap(), write(), and write_bit().
|
private |
Definition at line 190 of file bitArray.H.
Referenced by __traverse(), bits_list(), circular_left_shift(), circular_right_shift(), clear_unused_bits_in_last_byte(), dyn_right_shift(), empty(), get_bit_str(), get_num_bytes(), get_unum(), left_shift(), load(), load_from_array_of_chars(), Aleph::BitArray::BitProxy::operator int(), operator&=(), operator=(), operator=(), Aleph::BitArray::BitProxy::operator=(), Aleph::BitArray::BitProxy::operator=(), operator|=(), pop(), push(), read(), read_bit(), right_shift(), save(), save_in_array_of_chars(), set_num(), set_size(), size(), swap(), write(), and write_bit().