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

Layer with neurons placed in a grid. More...

#include <grid_layer.h>

Inheritance diagram for nest::GridLayer< D >:
[legend]
Collaboration diagram for nest::GridLayer< D >:
[legend]

Classes

class  masked_iterator
 Iterator iterating over the nodes inside a Mask. More...

Public Types

typedef Position< D > key_type
typedef size_t mapped_type
typedef std::pair< Position< D >, size_t > value_type
typedef value_type & reference
typedef const value_type & const_reference

Public Member Functions

 GridLayer ()
 GridLayer (const GridLayer &layer)
Position< D > get_position (size_t sind) const override
 Get position of node.
Position< D > lid_to_position (size_t lid) const
 Get position of node.
size_t gridpos_to_lid (Position< D, int > pos) const
Position< D > gridpos_to_position (Position< D, int > gridpos) const
std::vector< std::pair< Position< D >, size_t > > get_global_positions_vector (const AbstractMask &mask, const Position< D > &anchor, bool allow_oversized, NodeCollectionPTR node_collection)
masked_iterator masked_begin (const Mask< D > &mask, const Position< D > &anchor)
masked_iterator masked_end ()
Position< D, size_t > get_dims () const
void set_status (const Dictionary &d) override
 Change properties of the layer according to the entries in the dictionary.
void get_status (Dictionary &d, NodeCollection const *const) const override
 Export properties of the layer by setting entries in the status dictionary, respects slicing of given NodeCollection.
Public Member Functions inherited from nest::Layer< D >
 Layer ()
 Creates an empty layer.
 Layer (const Layer &other_layer)
 ~Layer () override
void set_status (const Dictionary &) override
 Change properties of the layer according to the entries in the dictionary.
void get_status (Dictionary &, NodeCollection const *const) const override
 Retrieve status, slice according to node collection if given.
unsigned int get_num_dimensions () const override
const Position< D > & get_lower_left () const
const Position< D > & get_extent () const
Position< D > get_center () const
std::bitset< D > get_periodic_mask () const
std::vector< double > get_position_vector (const size_t sind) const override
Position< D > compute_displacement (const Position< D > &from_pos, const Position< D > &to_pos) const
 Returns displacement of a position from another position.
double compute_displacement (const std::vector< double > &from_pos, const std::vector< double > &to_pos, const unsigned int dimension) const override
Position< D > compute_displacement (const Position< D > &from_pos, const size_t to) const
 Returns displacement of node from given position.
std::vector< double > compute_displacement (const std::vector< double > &from_pos, const size_t to) const override
 Returns displacement of node from given position.
double compute_distance (const Position< D > &from_pos, const size_t lid) const
 Returns distance to node from given position.
double compute_distance (const std::vector< double > &from_pos, const size_t lid) const override
 Returns distance to node from given position.
double compute_distance (const std::vector< double > &from_pos, const std::vector< double > &to_pos) const override
std::shared_ptr< Ntree< D, size_t > > get_global_positions_ntree (NodeCollectionPTR node_collection)
 Get positions for all nodes in layer, including nodes on other MPI processes.
std::shared_ptr< Ntree< D, size_t > > get_global_positions_ntree (std::bitset< D > periodic, Position< D > lower_left, Position< D > extent, NodeCollectionPTR node_collection)
 Get positions globally, overriding the dimensions of the layer and the periodic flags.
std::vector< std::pair< Position< D >, size_t > > * get_global_positions_vector (NodeCollectionPTR node_collection)
virtual std::vector< std::pair< Position< D >, size_t > > get_global_positions_vector (const MaskPTR mask, const Position< D > &anchor, bool allow_oversized, NodeCollectionPTR node_collection)
std::vector< size_t > get_global_nodes (const MaskPTR mask, const std::vector< double > &anchor, bool allow_oversized, NodeCollectionPTR node_collection) override
 Return a vector with the node IDs of the nodes inside the mask.
void connect (NodeCollectionPTR source_nc, AbstractLayerPTR target, NodeCollectionPTR target_nc, ConnectionCreator &connector) override
 Connect this layer to the given target layer.
void dump_nodes (std::ostream &os) const override
 Write layer data to stream.
void dump_connections (std::ostream &out, NodeCollectionPTR node_collection, AbstractLayerPTR target_layer, const std::string &syn_model) override
 Dumps information about all connections of the given type having their source in the given layer to the given output stream.
Public Member Functions inherited from nest::AbstractLayer
 AbstractLayer ()
virtual ~AbstractLayer ()
void set_node_collection (NodeCollectionPTR)
NodeCollectionPTR get_node_collection ()

Protected Member Functions

template<class Ins>
void insert_global_positions_ (Ins iter, NodeCollectionPTR node_collection)
void insert_global_positions_ntree_ (Ntree< D, size_t > &tree, NodeCollectionPTR node_collection) override
 Insert global position info into ntree.
void insert_global_positions_vector_ (std::vector< std::pair< Position< D >, size_t > > &vec, NodeCollectionPTR node_collection) override
 Insert global position info into vector.
Protected Member Functions inherited from nest::Layer< D >
void clear_ntree_cache_ () const override
 Clear the cache for global position information.
void clear_vector_cache_ () const override
 Clear the cache for global position information.
std::shared_ptr< Ntree< D, size_t > > do_get_global_positions_ntree_ (NodeCollectionPTR node_collection)
Protected Member Functions inherited from nest::AbstractLayer
NodeCollectionMetadataPTR get_metadata () const
 Gets metadata of the NodeCollection to which this layer belongs.

Protected Attributes

Position< D, size_t > dims_
 number of nodes in each direction.
Protected Attributes inherited from nest::Layer< D >
Position< D > lower_left_
 lower left corner (minimum coordinates) of layer
Position< D > extent_
 size of layer
std::bitset< D > periodic_
 periodic b.c.
Protected Attributes inherited from nest::AbstractLayer
NodeCollectionPTR node_collection_
 The NodeCollection to which the layer belongs.

Additional Inherited Members

Static Public Member Functions inherited from nest::AbstractLayer
static NodeCollectionPTR create_layer (const Dictionary &)
 Factory function for layers.
Static Protected Attributes inherited from nest::Layer< D >
static std::shared_ptr< Ntree< D, size_t > > cached_ntree_
 Global position information for a single layer.
static std::vector< std::pair< Position< D >, size_t > > * cached_vector_
Static Protected Attributes inherited from nest::AbstractLayer
static NodeCollectionMetadataPTR cached_ntree_md_ = NodeCollectionMetadataPTR( nullptr )
 Metadata for the layer for which we cache global position information.
static NodeCollectionMetadataPTR cached_vector_md_ = NodeCollectionMetadataPTR( nullptr )
 Metadata for the layer for which we cache global position information.

Detailed Description

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

Layer with neurons placed in a grid.

Member Typedef Documentation

◆ const_reference

template<int D>
typedef const value_type& nest::GridLayer< D >::const_reference

◆ key_type

template<int D>
typedef Position< D > nest::GridLayer< D >::key_type

◆ mapped_type

template<int D>
typedef size_t nest::GridLayer< D >::mapped_type

◆ reference

template<int D>
typedef value_type& nest::GridLayer< D >::reference

◆ value_type

template<int D>
typedef std::pair< Position< D >, size_t > nest::GridLayer< D >::value_type

Constructor & Destructor Documentation

◆ GridLayer() [1/2]

template<int D>
nest::GridLayer< D >::GridLayer ( )
inline

References nest::Layer< D >::Layer().

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

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

◆ GridLayer() [2/2]

template<int D>
nest::GridLayer< D >::GridLayer ( const GridLayer< D > & layer)
inline

References dims_, GridLayer(), and nest::Layer< D >::Layer().

Here is the call graph for this function:

Member Function Documentation

◆ get_dims()

template<int D>
Position< D, size_t > nest::GridLayer< D >::get_dims ( ) const

References dims_.

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

Here is the caller graph for this function:

◆ get_global_positions_vector()

template<int D>
std::vector< std::pair< Position< D >, size_t > > nest::GridLayer< D >::get_global_positions_vector ( const AbstractMask & mask,
const Position< D > & anchor,
bool allow_oversized,
NodeCollectionPTR node_collection )

References masked_begin(), and masked_end().

Here is the call graph for this function:

◆ get_position()

template<int D>
Position< D > nest::GridLayer< D >::get_position ( size_t sind) const
overridevirtual

Get position of node.

Only possible for local nodes.

Parameters
sindindex of node
Returns
position of node.

Implements nest::Layer< D >.

References lid_to_position().

Here is the call graph for this function:

◆ get_status()

template<int D>
void nest::GridLayer< D >::get_status ( Dictionary & ,
NodeCollection const * const  ) const
overridevirtual

Export properties of the layer by setting entries in the status dictionary, respects slicing of given NodeCollection.

Parameters
dDictionary.
Note
If passing nullptr-valued NodeCollectionPTR, full metadata irrespective of any slicing is returned.

Implements nest::AbstractLayer.

References dims_, nest::Layer< D >::get_status(), and nest::names::shape().

Here is the call graph for this function:

◆ gridpos_to_lid()

template<int D>
size_t nest::GridLayer< D >::gridpos_to_lid ( Position< D, int > pos) const

◆ gridpos_to_position()

template<int D>
Position< D > nest::GridLayer< D >::gridpos_to_position ( Position< D, int > gridpos) const

References dims_, nest::Layer< D >::extent_, and nest::Layer< D >::lower_left_.

Referenced by lid_to_position().

Here is the caller graph for this function:

◆ insert_global_positions_()

template<int D>
template<class Ins>
void nest::GridLayer< D >::insert_global_positions_ ( Ins iter,
NodeCollectionPTR node_collection )
protected

References lid_to_position().

Referenced by insert_global_positions_ntree_(), and insert_global_positions_vector_().

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

◆ insert_global_positions_ntree_()

template<int D>
void nest::GridLayer< D >::insert_global_positions_ntree_ ( Ntree< D, size_t > & tree,
NodeCollectionPTR node_collection )
overrideprotectedvirtual

Insert global position info into ntree.

Implements nest::Layer< D >.

References insert_global_positions_().

Here is the call graph for this function:

◆ insert_global_positions_vector_()

template<int D>
void nest::GridLayer< D >::insert_global_positions_vector_ ( std::vector< std::pair< Position< D >, size_t > > & ,
NodeCollectionPTR  )
overrideprotectedvirtual

Insert global position info into vector.

Implements nest::Layer< D >.

References insert_global_positions_().

Here is the call graph for this function:

◆ lid_to_position()

template<int D>
Position< D > nest::GridLayer< D >::lid_to_position ( size_t lid) const

Get position of node.

Also allowed for non-local nodes.

Parameters
lidglobal index of node within layer
Returns
position of node.

References dims_, and gridpos_to_position().

Referenced by get_position(), and insert_global_positions_().

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

◆ masked_begin()

template<int D>
GridLayer< D >::masked_iterator nest::GridLayer< D >::masked_begin ( const Mask< D > & mask,
const Position< D > & anchor )
inline

Referenced by get_global_positions_vector().

Here is the caller graph for this function:

◆ masked_end()

template<int D>
GridLayer< D >::masked_iterator nest::GridLayer< D >::masked_end ( )
inline

Referenced by get_global_positions_vector().

Here is the caller graph for this function:

◆ set_status()

template<int D>
void nest::GridLayer< D >::set_status ( const Dictionary & )
overridevirtual

Change properties of the layer according to the entries in the dictionary.

Parameters
dDictionary with named parameter settings.

Implements nest::AbstractLayer.

References nest::names::center(), dims_, nest::names::extent(), nest::Layer< D >::extent_, nest::Layer< D >::get_center(), nest::Layer< D >::lower_left_, nest::AbstractLayer::node_collection_, nest::Layer< D >::set_status(), and nest::names::shape().

Here is the call graph for this function:

Member Data Documentation

◆ dims_

template<int D>
Position< D, size_t > nest::GridLayer< D >::dims_
protected

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