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

Layer with free positioning of neurons, positions specified by user. More...

#include <free_layer.h>

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

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_
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::FreeLayer< D >

Layer with free positioning of neurons, positions specified by user.

Member Function Documentation

◆ communicate_positions_()

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

Communicate positions across MPI processes.

Parameters
iterInsert iterator which will receive pairs of Position,node ID
node_collectionNodeCollection 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(), nest::KernelManager::mpi_manager, and num_local_nodes_.

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:

◆ get_position()

template<int D>
Position< D > nest::FreeLayer< 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_id_(), and positions_.

Here is the call graph for this function:

◆ get_status()

template<int D>
void nest::FreeLayer< 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 nest::NodeCollection::end(), nest::MPIManager::get_num_processes(), nest::Layer< D >::get_status(), nest::kernel(), nest::KernelManager::mpi_manager, nest::names::positions(), positions_, and nest::NodeCollection::rank_local_begin().

Here is the call graph for this function:

◆ insert_global_positions_ntree_()

template<int D>
void nest::FreeLayer< 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 communicate_positions_().

Here is the call graph for this function:

◆ insert_global_positions_vector_()

template<int D>
void nest::FreeLayer< 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 communicate_positions_(), and nest::node_id_less().

Here is the call graph for this function:

◆ lid_to_position_id_()

template<int D>
size_t nest::FreeLayer< D >::lid_to_position_id_ ( size_t lid) const
protected

Calculate the index in the position vector on this MPI process based on the local ID.

Parameters
lidglobal index of node within layer
Returns
index in the local position vector

References nest::MPIManager::get_num_processes(), nest::kernel(), nest::KernelManager::mpi_manager, and nest::AbstractLayer::node_collection_.

Referenced by get_position().

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

◆ set_status()

template<int D>
void nest::FreeLayer< 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::extent(), nest::Layer< D >::extent_, nest::NodeManager::get_mpi_local_node_or_device_head(), nest::get_rank_synced_rng(), nest::kernel(), nest::Layer< D >::lower_left_, nest::AbstractLayer::node_collection_, nest::KernelManager::node_manager, num_local_nodes_, nest::names::positions(), positions_, and nest::Layer< D >::set_status().

Here is the call graph for this function:

Member Data Documentation

◆ num_local_nodes_

template<int D>
size_t nest::FreeLayer< D >::num_local_nodes_ = 0
protected

◆ positions_

template<int D>
std::vector< Position< D > > nest::FreeLayer< D >::positions_
protected

Vector of positions.

Referenced by get_position(), get_status(), and set_status().


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