72 if (ndx >=
m_mask.size()) {
73 throw std::out_of_range (
"ThinningDecisionBase::thin");
86 if (ndx >=
m_mask.size()) {
87 throw std::out_of_range (
"ThinningDecisionBase::thin");
104 if (ndx >=
m_mask.size()) {
105 throw std::out_of_range (
"ThinningDecisionBase::thin");
126 if (ndx >=
m_mask.size()) {
127 throw std::out_of_range (
"ThinningDecisionBase::thin");
149 if (
sz != v.size()) {
150 throw std::out_of_range (
"ThinningDecisionBase::thin(): inconsistent vector sizes.");
152 for (
size_t i = 0; i <
sz; i++) {
175 if (
sz != v.size()) {
176 throw std::out_of_range (
"ThinningDecisionBase::keep(): inconsistent vector sizes.");
178 for (
size_t i = 0; i <
sz; i++) {
201 if (
sz != other.size()) {
202 throw std::out_of_range (
"ThinningDecisionBase::thin(): inconsistent vector sizes.");
225 if (
sz != other.size()) {
226 throw std::out_of_range (
"ThinningDecisionBase::keep(): inconsistent vector sizes.");
246 for (
size_t i = 0; i <
sz; i++) {
Hold thinning decisions for one container.
static const std::size_t RemovedIdx
Flag used to show that an index has been thinned away.
std::vector< size_t > m_indexMap
Mapping from original indices to thinned indices.
ThinningDecisionBase(size_t sz=0)
Constructor.
void thinAll()
Mark that all elements should be thinned away.
void keepAll()
Mark that all elements should be kept (not thinned).
void keep(size_t ndx)
Mark that index ndx in the container should be kept (not thinned away).
void thin(size_t ndx)
Mark that index ndx in the container should be thinned away.
bool thinned(size_t ndx) const
Return true if element ndx should be thinned.
void buildIndexMap()
Build the index map.
size_t size() const
Return the total size of the container being thinned.
size_t thinnedSize() const
Return the size of the container being thinned after thinning.
boost::dynamic_bitset m_mask
Thinning map. Set to 1 for thinned elements.
void resize(const size_t size)
Change the number of elements.