NEST  2.6.0,not_revisioned_source_dir@0
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
nest::MaskedLayer< D > Class Template Reference

Class for applying masks to layers. More...

#include <connection_creator.h>

Public Member Functions

 MaskedLayer (Layer< D > &layer, Selector filter, const MaskDatum &mask, bool include_global, bool allow_oversized)
 Regular constructor. More...
 
 MaskedLayer (Layer< D > &layer, Selector filter, const MaskDatum &mask, bool include_global, bool allow_oversized, Layer< D > &target)
 Constructor for applying "converse" mask to layer. More...
 
 ~MaskedLayer ()
 
Ntree< D, index >::masked_iterator begin (const Position< D > &anchor)
 Iterate over nodes inside mask. More...
 
Ntree< D, index >::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. More...
 

Protected Attributes

lockPTR< Ntree< D, index > > ntree_
 
MaskDatum 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

template<int D>
nest::MaskedLayer< D >::MaskedLayer ( Layer< D > &  layer,
Selector  filter,
const MaskDatum mask,
bool  include_global,
bool  allow_oversized 
)
inline

Regular constructor.

Parameters
layerThe layer to mask
filterOptionally select subset of neurons
maskThe mask to apply to the layer
include_globalIf true, include all nodes, otherwise only local to MPI process
allow_oversizedIf true, allow larges masks than layers when using periodic b.c.

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

template<int D>
nest::MaskedLayer< D >::MaskedLayer ( Layer< D > &  layer,
Selector  filter,
const MaskDatum mask,
bool  include_global,
bool  allow_oversized,
Layer< D > &  target 
)
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)
filterOptionally select subset of neurons
maskThe mask to apply to the layer
include_globalIf true, include all nodes, otherwise only local to MPI process
allow_oversizedIf true, allow larges masks than layers when using periodic b.c.
targetThe layer which the given mask is defined for (target layer)

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

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

Member Function Documentation

template<int D>
Ntree< D, index >::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

References numerics::e.

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

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::Mask< D >::get_bbox(), 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::names::layer, nest::names::lower_left, nest::Box< D >::lower_left, nest::names::mask, nest::names::upper_right, nest::Box< D >::upper_right, and nest::names::y.

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

template<int D>
Ntree< D, index >::masked_iterator nest::MaskedLayer< D >::end ( void  )
inline

Member Data Documentation

template<int D>
MaskDatum nest::MaskedLayer< D >::mask_
protected
template<int D>
lockPTR<Ntree<D,index> > nest::MaskedLayer< D >::ntree_
protected

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