Layer with free positioning of neurons, positions specified by user. More...
#include <free_layer.h>
Classes | |
| class | NodePositionData |
| Class to be used when communicating positions across MPI processes. More... | |
Public Member Functions | |
| Position< D > | get_position (size_t sind) const override |
| Get position of node. | |
| 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 |
| 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 | communicate_positions_ (Ins iter, NodeCollectionPTR node_collection) |
| Communicate positions across MPI processes. | |
| 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. | |
| size_t | lid_to_position_id_ (size_t lid) const |
| Calculate the index in the position vector on this MPI process based on the local ID. | |
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 | |
| std::vector< Position< D > > | positions_ |
| Vector of positions. | |
| size_t | num_local_nodes_ = 0 |
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 free positioning of neurons, positions specified by user.
|
protected |
Communicate positions across MPI processes.
| iter | Insert iterator which will receive pairs of Position,node ID |
| node_collection | NodeCollection of the layer |
References nest::MPIManager::communicate(), nest::FreeLayer< D >::NodePositionData::get_node_id(), nest::FreeLayer< D >::NodePositionData::get_position(), nest::get_position(), nest::kernel(), and nest::KernelManager::mpi_manager.
|
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::NodeCollection::end(), nest::MPIManager::get_num_processes(), nest::Layer< D >::get_status(), nest::kernel(), nest::KernelManager::mpi_manager, nest::names::positions(), and nest::NodeCollection::rank_local_begin().
|
overrideprotectedvirtual |
Insert global position info into ntree.
Implements nest::Layer< D >.
|
overrideprotectedvirtual |
Insert global position info into vector.
Implements nest::Layer< D >.
|
protected |
Calculate the index in the position vector on this MPI process based on the local ID.
| lid | global index of node within layer |
References nest::MPIManager::get_num_processes(), nest::kernel(), and nest::KernelManager::mpi_manager.
|
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::extent(), nest::NodeManager::get_mpi_local_node_or_device_head(), nest::get_rank_synced_rng(), nest::kernel(), nest::KernelManager::node_manager, nest::names::positions(), and nest::Layer< D >::set_status().
|
protected |
|
protected |
Vector of positions.