|
CNum 0.2.1
CPU-optimized ML library for C++
|
A bit mask used for representing subsets of elements in a container. More...
#include <BinaryMask.h>
Public Member Functions | |
| BinaryMask ()=delete | |
| BinaryMask (BitMask mask, size_t size, size_t n_set) | |
| Overloaded constructor. | |
| BinaryMask (const BinaryMask &other) noexcept | |
| Copy constructor. | |
| BinaryMask & | operator= (const BinaryMask &other) noexcept |
| Copy equals operator. | |
| BinaryMask (BinaryMask &&other) noexcept | |
| Move constructor. | |
| BinaryMask & | operator= (BinaryMask &&other) noexcept |
| Move equals operator. | |
| template<typename T> | |
| ::CNum::DataStructs::Matrix< T > | mask (const ::CNum::DataStructs::Matrix< T > &m) const |
| apply the mask to a Matrix | |
| template<typename T> | |
| ::CNum::DataStructs::Matrix< T > | mask (const CNum::DataStructs::Matrix< T > &m) const |
Static Public Member Functions | |
| template<typename T, typename U, typename CompareFunction> | |
| static BinaryMask | create_binary_mask (const T &m, U val) |
| Create a binary mask. | |
| template<typename T, typename CompareFunction> | |
| static BinaryMask | create_binary_mask_matrix (const ::CNum::DataStructs::Matrix< T > &m, T val) |
| Create a BinaryMask for a Matrix. | |
A bit mask used for representing subsets of elements in a container.
A BinaryMask at its core is a bit mask where the nth bit represents index n in a container of elements. The nth bit being set means the subset that the mask represents preserves that element (or row of elements) at the nth index in the container.
|
delete |
| CNum::DataStructs::BinaryMask::BinaryMask | ( | BitMask | mask, |
| size_t | size, | ||
| size_t | n_set ) |
Overloaded constructor.
| mask | The actual BitMask |
| size | The number of bits in the mask (excluding excess) |
|
noexcept |
Copy constructor.
|
noexcept |
Move constructor.
|
static |
Create a binary mask.
| T | The type of container (holds data type U) |
| U | The data type stored in the container |
| CompareFunction | The function to use for comparison |
|
static |
Create a BinaryMask for a Matrix.
| T | The type of the Matrix |
| CompareFunction | The function to use for comparison |
| ::CNum::DataStructs::Matrix< T > CNum::DataStructs::BinaryMask::mask | ( | const ::CNum::DataStructs::Matrix< T > & | m | ) | const |
| ::CNum::DataStructs::Matrix< T > CNum::DataStructs::BinaryMask::mask | ( | const CNum::DataStructs::Matrix< T > & | m | ) | const |
|
noexcept |
Move equals operator.
|
noexcept |
Copy equals operator.