Layer with neurons placed in a grid. More...
#include <grid_layer.h>
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_ = 0 |
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. | |
Layer with neurons placed in a grid.
| typedef const value_type& nest::GridLayer< D >::const_reference |
| typedef Position< D > nest::GridLayer< D >::key_type |
| typedef size_t nest::GridLayer< D >::mapped_type |
| typedef value_type& nest::GridLayer< D >::reference |
| typedef std::pair< Position< D >, size_t > nest::GridLayer< D >::value_type |
|
inline |
|
inline |
| Position< D, size_t > nest::GridLayer< D >::get_dims | ( | ) | const |
| 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 nest::GridLayer< D >::masked_begin(), and nest::GridLayer< D >::masked_end().
|
overridevirtual |
Get position of node.
Only possible for local nodes.
| sind | index of node |
Implements nest::Layer< D >.
|
overridevirtual |
Export properties of the layer by setting entries in the status dictionary, respects slicing of given NodeCollection.
| d | Dictionary. |
Implements nest::AbstractLayer.
References nest::Layer< D >::get_status(), and nest::names::shape().
| size_t nest::GridLayer< D >::gridpos_to_lid | ( | Position< D, int > | pos | ) | const |
| Position< D > nest::GridLayer< D >::gridpos_to_position | ( | Position< D, int > | gridpos | ) | const |
|
protected |
|
overrideprotectedvirtual |
Insert global position info into ntree.
Implements nest::Layer< D >.
|
overrideprotectedvirtual |
Insert global position info into vector.
Implements nest::Layer< D >.
| Position< D > nest::GridLayer< D >::lid_to_position | ( | size_t | lid | ) | const |
Get position of node.
Also allowed for non-local nodes.
| lid | global index of node within layer |
|
inline |
Referenced by nest::GridLayer< D >::get_global_positions_vector().
|
inline |
Referenced by nest::GridLayer< D >::get_global_positions_vector().
|
overridevirtual |
Change properties of the layer according to the entries in the dictionary.
| d | Dictionary with named parameter settings. |
Implements nest::AbstractLayer.
References nest::names::center(), nest::names::extent(), nest::Layer< D >::set_status(), and nest::names::shape().
|
protected |
number of nodes in each direction.
Referenced by nest::GridLayer< D >::masked_iterator::masked_iterator().