Abstract base class for Layer of given dimension (D=2 or 3). More...
#include <layer.h>
Public Member Functions | |
| 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 |
| virtual Position< D > | get_position (size_t sind) const =0 |
| Get position of node. | |
| 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 | |
| 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) |
| virtual void | insert_global_positions_ntree_ (Ntree< D, size_t > &tree, NodeCollectionPTR node_collection)=0 |
| Insert global position info into ntree. | |
| virtual void | insert_global_positions_vector_ (std::vector< std::pair< Position< D >, size_t > > &, NodeCollectionPTR)=0 |
| Insert global position info into vector. | |
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 > | 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. | |
Static Protected Attributes | |
| 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. | |
Friends | |
| class | MaskedLayer< D > |
Additional Inherited Members | |
Static Public Member Functions inherited from nest::AbstractLayer | |
| static NodeCollectionPTR | create_layer (const Dictionary &) |
| Factory function for layers. | |
Abstract base class for Layer of given dimension (D=2 or 3).
|
inline |
Creates an empty layer.
|
inline |
|
inlineoverride |
|
inlineoverrideprotectedvirtual |
Clear the cache for global position information.
Implements nest::AbstractLayer.
|
inlineoverrideprotectedvirtual |
Clear the cache for global position information.
Implements nest::AbstractLayer.
| Position< D > nest::Layer< D >::compute_displacement | ( | const Position< D > & | from_pos, |
| const Position< D > & | to_pos | ||
| ) | const |
Returns displacement of a position from another position.
When using periodic boundary conditions, will return minimum displacement.
| from_pos | position vector in layer |
| to_pos | position to which displacement is to be computed |
|
inline |
Returns displacement of node from given position.
When using periodic boundary conditions, will return minimum displacement.
| from_pos | position vector in layer |
| to | node in layer to which displacement is to be computed |
References nest::get_position().
|
inlineoverridevirtual |
Returns displacement of node from given position.
When using periodic boundary conditions, will return minimum displacement.
| from_pos | position vector in layer |
| to | node in layer to which displacement is to be computed |
Implements nest::AbstractLayer.
|
overridevirtual |
Implements nest::AbstractLayer.
References nest::displacement().
|
inline |
Returns distance to node from given position.
When using periodic boundary conditions, will return minimum distance.
| from_pos | position vector in layer |
| to | node in layer to which displacement is to be computed |
|
inlineoverridevirtual |
Returns distance to node from given position.
When using periodic boundary conditions, will return minimum distance.
| from_pos | position vector in layer |
| to | node in layer to which displacement is to be computed |
Implements nest::AbstractLayer.
|
inlineoverridevirtual |
Implements nest::AbstractLayer.
References nest::displacement().
|
overridevirtual |
Connect this layer to the given target layer.
The actual connections are made in class ConnectionCreator.
| source_nc | NodeCollection to the source layer. |
| target | target layer to connect to. Must have same dimension as this layer. |
| target_nc | NodeCollection to the target layer. |
| connector | connection properties |
Implements nest::AbstractLayer.
References nest::ConnectionCreator::connect().
|
protected |
|
overridevirtual |
Dumps information about all connections of the given type having their source in the given layer to the given output stream.
For distributed simulations this function will dump the connections with local targets only.
| out | output stream |
| node_collection | NodeCollection of the layer |
| target_layer | Target layer |
| synapse_id | type of connection |
Implements nest::AbstractLayer.
References nest::KernelManager::connection_manager, nest::names::delay(), Dictionary::get(), nest::ConnectionManager::get_connections(), nest::ConnectionManager::get_synapse_status(), nest::kernel(), nest::AbstractLayer::node_collection_, nest::names::source(), nest::names::synapse_model(), nest::names::target(), and nest::names::weight().
|
overridevirtual |
Write layer data to stream.
For each node in layer, write one line to stream containing: node ID x-position y-position [z-position]
| os | output stream |
Implements nest::AbstractLayer.
References nest::get_position().
|
inline |
References nest::Layer< D >::extent_, and nest::Layer< D >::lower_left_.
|
inline |
References nest::Layer< D >::extent_.
Referenced by nest::MaskedLayer< D >::check_mask_().
|
overridevirtual |
Return a vector with the node IDs of the nodes inside the mask.
Implements nest::AbstractLayer.
References nest::MaskedLayer< D >::begin(), and nest::MaskedLayer< D >::end().
| std::shared_ptr< Ntree< D, size_t > > nest::Layer< D >::get_global_positions_ntree | ( | NodeCollectionPTR | node_collection | ) |
Get positions for all nodes in layer, including nodes on other MPI processes.
The positions will be cached so that subsequent calls for the same layer are fast. One one layer is cached at the time, so the user should group together all ConnectLayers calls using the same pool layer.
Referenced by nest::MaskedLayer< D >::MaskedLayer(), and nest::MaskedLayer< D >::MaskedLayer().
| std::shared_ptr< Ntree< D, size_t > > nest::Layer< D >::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.
The supplied lower left corner and extent coordinates are only used for the dimensions where the supplied periodic flag is set.
|
virtual |
References nest::MaskedLayer< D >::begin(), and nest::MaskedLayer< D >::end().
| std::vector< std::pair< Position< D >, size_t > > * nest::Layer< D >::get_global_positions_vector | ( | NodeCollectionPTR | node_collection | ) |
|
inline |
References nest::Layer< D >::lower_left_.
|
inlineoverridevirtual |
Implements nest::AbstractLayer.
|
inline |
References nest::Layer< D >::periodic_.
Referenced by nest::MaskedLayer< D >::check_mask_().
|
pure virtual |
Get position of node.
Only possible for local nodes.
| sind | index of node |
Implemented in nest::FreeLayer< D >, and nest::GridLayer< D >.
|
inlineoverridevirtual |
| sind | index of node |
Implements nest::AbstractLayer.
References nest::get_position().
|
overridevirtual |
Retrieve status, slice according to node collection if given.
Implements nest::AbstractLayer.
References nest::names::center(), nest::names::edge_wrap(), nest::names::extent(), nest::names::network_size(), and nest::NodeCollection::size().
Referenced by nest::FreeLayer< D >::get_status(), and nest::GridLayer< D >::get_status().
|
protectedpure virtual |
Insert global position info into ntree.
Implemented in nest::FreeLayer< D >, and nest::GridLayer< D >.
|
protectedpure virtual |
Insert global position info into vector.
Implemented in nest::FreeLayer< D >, and nest::GridLayer< D >.
|
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::edge_wrap().
Referenced by nest::FreeLayer< D >::set_status(), and nest::GridLayer< D >::set_status().
|
friend |
|
staticprotected |
Global position information for a single layer.
|
staticprotected |
|
protected |
size of layer
Referenced by nest::Layer< D >::get_center(), nest::Layer< D >::get_extent(), and nest::GridLayer< D >::masked_iterator::masked_iterator().
|
protected |
lower left corner (minimum coordinates) of layer
Referenced by nest::Layer< D >::get_center(), nest::Layer< D >::get_lower_left(), and nest::GridLayer< D >::masked_iterator::masked_iterator().
|
protected |
periodic b.c.
Referenced by nest::Layer< D >::get_periodic_mask(), and nest::GridLayer< D >::masked_iterator::masked_iterator().