MorphologicalAttributeFilters
Public API documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mmcfilters::NodePruningMask Class Reference

Dense Boolean decisions where true means prune the node. More...

#include <NodeDecisionMasks.hpp>

Public Member Functions

 NodePruningMask ()=default
 Creates an empty pruning mask.
 
 NodePruningMask (std::vector< bool > decisions)
 Creates a pruning mask from explicit decisions.
 
 NodePruningMask (std::size_t size, bool pruneNode)
 Creates a pruning mask whose entries share one decision.
 
std::size_t size () const noexcept
 Returns the number of dense node slots.
 
bool empty () const noexcept
 Tests whether the mask contains no decisions.
 
bool operator[] (std::size_t index) const
 Returns one pruning decision.
 
const std::vector< bool > & decisions () const noexcept
 Returns all pruning decisions.
 

Detailed Description

Dense Boolean decisions where true means prune the node.

The polarity is the Boolean complement of NodePreservationMask, but the two types require an explicit conversion.

Definition at line 59 of file NodeDecisionMasks.hpp.

Constructor & Destructor Documentation

◆ NodePruningMask() [1/2]

mmcfilters::NodePruningMask::NodePruningMask ( std::vector< bool decisions)
inlineexplicit

Creates a pruning mask from explicit decisions.

Parameters
decisionsDense decisions where true prunes the corresponding node.

Definition at line 71 of file NodeDecisionMasks.hpp.

◆ NodePruningMask() [2/2]

mmcfilters::NodePruningMask::NodePruningMask ( std::size_t  size,
bool  pruneNode 
)
inline

Creates a pruning mask whose entries share one decision.

Parameters
sizeNumber of dense node slots represented by the mask.
pruneNodeDecision assigned to every slot.

Definition at line 78 of file NodeDecisionMasks.hpp.

Member Function Documentation

◆ decisions()

const std::vector< bool > & mmcfilters::NodePruningMask::decisions ( ) const
inlinenoexcept

Returns all pruning decisions.

Returns
Read-only dense decision buffer.

Definition at line 94 of file NodeDecisionMasks.hpp.

◆ empty()

bool mmcfilters::NodePruningMask::empty ( ) const
inlinenoexcept

Tests whether the mask contains no decisions.

Returns
True when the mask is empty.

Definition at line 84 of file NodeDecisionMasks.hpp.

◆ operator[]()

bool mmcfilters::NodePruningMask::operator[] ( std::size_t  index) const
inline

Returns one pruning decision.

Parameters
indexDense node-slot index.
Returns
True when the indexed node must be pruned.

Definition at line 91 of file NodeDecisionMasks.hpp.

◆ size()

std::size_t mmcfilters::NodePruningMask::size ( ) const
inlinenoexcept

Returns the number of dense node slots.

Returns
Number of decisions.

Definition at line 81 of file NodeDecisionMasks.hpp.


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