NEST main@caf0ae8
 
Loading...
Searching...
No Matches
nest::MaskedLayer< D > Class Template Reference

Class for applying masks to layers. More...

#include <layer.h>

Public Member Functions

 MaskedLayer (Layer< D > &layer, const MaskPTR mask, bool allow_oversized, NodeCollectionPTR node_collection)
 Regular constructor.
 
 MaskedLayer (Layer< D > &layer, const MaskPTR mask, bool allow_oversized, Layer< D > &target, NodeCollectionPTR node_collection)
 Constructor for applying "converse" mask to layer.
 
 ~MaskedLayer ()
 
Ntree< D, size_t >::masked_iterator begin (const Position< D > &anchor)
 Iterate over nodes inside mask.
 
Ntree< D, size_t >::masked_iterator end ()
 

Protected Member Functions

void check_mask_ (Layer< D > &layer, bool allow_oversized)
 Will check that the mask can be applied to the layer.
 

Protected Attributes

std::shared_ptr< Ntree< D, size_t > > ntree_
 
MaskPTR mask_
 

Detailed Description

template<int D>
class nest::MaskedLayer< D >

Class for applying masks to layers.

Contains begin and end methods to iterate over nodes inside a mask.

Constructor & Destructor Documentation

◆ MaskedLayer() [1/2]

template<int D>
nest::MaskedLayer< D >::MaskedLayer ( Layer< D > &  layer,
const MaskPTR  mask,
bool  allow_oversized,
NodeCollectionPTR  node_collection 
)
inline

Regular constructor.

Parameters
layerThe layer to mask
maskThe mask to apply to the layer
allow_oversizedIf true, allow larges masks than layers when using periodic b.c.
node_collectionNodeCollection of the layer

References nest::MaskedLayer< D >::check_mask_(), nest::Layer< D >::get_global_positions_ntree(), and nest::MaskedLayer< D >::ntree_.

Here is the call graph for this function:

◆ MaskedLayer() [2/2]

template<int D>
nest::MaskedLayer< D >::MaskedLayer ( Layer< D > &  layer,
const MaskPTR  mask,
bool  allow_oversized,
Layer< D > &  target,
NodeCollectionPTR  node_collection 
)
inline

Constructor for applying "converse" mask to layer.

To be used for applying a mask for the target layer to the source layer. The mask will be mirrored about the origin, and settings for periodicity for the target layer will be applied to the source layer.

Parameters
layerThe layer to mask (source layer)
maskThe mask to apply to the layer
allow_oversizedIf true, allow larges masks than layers when using periodic b.c.
targetThe layer which the given mask is defined for (target layer)
node_collectionNodeCollection of the layer

References nest::MaskedLayer< D >::check_mask_(), nest::Layer< D >::get_global_positions_ntree(), nest::MaskedLayer< D >::mask_, and nest::MaskedLayer< D >::ntree_.

Here is the call graph for this function:

◆ ~MaskedLayer()

template<int D>
nest::MaskedLayer< D >::~MaskedLayer ( )
inline

Member Function Documentation

◆ begin()

template<int D>
Ntree< D, size_t >::masked_iterator nest::MaskedLayer< D >::begin ( const Position< D > &  anchor)
inline

Iterate over nodes inside mask.

Parameters
anchorPosition to apply mask to
Returns
an iterator for the nodes inside the mask centered on the anchor position

Referenced by nest::ConnectionCreator::fixed_indegree_(), nest::ConnectionCreator::fixed_outdegree_(), nest::Layer< D >::get_global_nodes(), and nest::Layer< D >::get_global_positions_vector().

Here is the caller graph for this function:

◆ check_mask_()

template<int D>
void nest::MaskedLayer< D >::check_mask_ ( Layer< D > &  layer,
bool  allow_oversized 
)
protected

Will check that the mask can be applied to the layer.

The mask must have the same dimensionality as the layer, and a grid mask may only be applied to a grid layer. Unless the allow_oversized flag is set, the mask must also not be larger than the layer in case of periodic boundary conditions. Will throw an exception if the mask does not fit.

Parameters
layerThe layer to check for
allow_oversizedIf true, oversized masks are allowed

References nest::GridLayer< D >::get_dims(), nest::Layer< D >::get_extent(), nest::GridMask< D >::get_lower_right(), nest::Layer< D >::get_periodic_mask(), nest::GridMask< D >::get_upper_left(), nest::Box< D >::lower_left, and nest::Box< D >::upper_right.

Referenced by nest::MaskedLayer< D >::MaskedLayer(), and nest::MaskedLayer< D >::MaskedLayer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ end()

template<int D>
Ntree< D, size_t >::masked_iterator nest::MaskedLayer< D >::end ( )
inline
Returns
end iterator

Referenced by nest::ConnectionCreator::fixed_indegree_(), nest::ConnectionCreator::fixed_outdegree_(), nest::Layer< D >::get_global_nodes(), and nest::Layer< D >::get_global_positions_vector().

Here is the caller graph for this function:

Member Data Documentation

◆ mask_

template<int D>
MaskPTR nest::MaskedLayer< D >::mask_
protected

◆ ntree_

template<int D>
std::shared_ptr< Ntree< D, size_t > > nest::MaskedLayer< D >::ntree_
protected

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