NEST main@f146f75
Loading...
Searching...
No Matches
nest::BipartiteConnBuilder Class Referenceabstract

Abstract base class for Bipartite ConnBuilders which form the components of ConnBuilder. More...

#include <conn_builder.h>

Inheritance diagram for nest::BipartiteConnBuilder:
[legend]
Collaboration diagram for nest::BipartiteConnBuilder:
[legend]

Public Member Functions

virtual void connect ()
 Connect with or without structural plasticity.
virtual void disconnect ()
 Delete synapses with or without structural plasticity.
 BipartiteConnBuilder (NodeCollectionPTR sources, NodeCollectionPTR targets, ThirdOutBuilder *third_out, const Dictionary &conn_spec, const std::vector< Dictionary > &syn_specs)
virtual ~BipartiteConnBuilder ()
size_t get_synapse_model () const
bool get_default_delay () const
bool get_default_dendritic_delay () const
bool get_default_axonal_delay () const
void set_synaptic_element_names (const std::string &pre_name, const std::string &post_name)
bool change_connected_synaptic_elements (size_t snode_id, size_t tnode_id, const size_t tid, int update)
 Updates the number of connected synaptic elements in the target and the source.
virtual bool supports_symmetric () const
 Return true if rule allows creation of symmetric connectivity.
virtual bool is_symmetric () const
 Return true if rule automatically creates symmetric connectivity.
bool allows_autapses () const
bool allows_multapses () const
virtual bool requires_proxies () const
 Return true if rule is applicable only to nodes with proxies.

Protected Member Functions

virtual void connect_ ()=0
 Implements the actual connection algorithm.
bool all_parameters_scalar_ () const
virtual void sp_connect_ ()
virtual void disconnect_ ()
virtual void sp_disconnect_ ()
void update_param_dict_ (size_t snode_id, Node &target, size_t target_thread, RngPtr rng, size_t indx)
void single_connect_ (size_t, Node &, size_t, RngPtr)
 Create connection between given nodes, fill parameter values.
void single_disconnect_ (size_t, Node &, size_t)
void skip_conn_parameter_ (size_t, size_t n_skip=1)
 Moves pointer in parameter array.
bool loop_over_targets_ () const
 Returns true if conventional looping over targets is indicated.

Protected Attributes

NodeCollectionPTR sources_
 Population to connect from.
NodeCollectionPTR targets_
 Population to connect to.
ThirdOutBuilder * third_out_
 To be triggered when primary connection is created.
bool allow_autapses_
bool allow_multapses_
bool make_symmetric_
bool creates_symmetric_connections_
std::vector< std::exception_ptr > exceptions_raised_
 buffer for exceptions raised in threads
std::string pre_synaptic_element_name_
std::string post_synaptic_element_name_
bool use_structural_plasticity_
std::vector< ConnParameter * > parameters_requiring_skipping_
 Pointers to connection parameters specified as arrays.
std::vector< size_t > synapse_model_id_
std::vector< std::vector< Dictionary > > param_dicts_
 Dictionaries to pass to connect function, one per thread for every syn_spec.

Private Types

typedef std::map< std::string, ConnParameter * > ConnParameterMap

Private Member Functions

void register_parameters_requiring_skipping_ (ConnParameter &param)
 Collects all array parameters in a vector.
void set_synapse_model_ (const Dictionary &syn_params, const size_t indx)
 Set synapse specific parameters.
void set_default_weight_or_delays_ (const Dictionary &syn_params, const size_t indx)
void set_synapse_params (const Dictionary &syn_defaults, const Dictionary &syn_params, const size_t indx)
void set_structural_plasticity_parameters (const std::vector< Dictionary > &syn_specs)
 Set structural plasticity parameters (if provided).
void reset_weights_ ()
 Reset weight and delay pointers.
void reset_delays_ ()
void reset_dendritic_delays_ ()
void reset_axonal_delays_ ()

Private Attributes

std::vector< bool > default_weight_
 indicate that weight should not be set per synapse
std::vector< bool > default_delay_
 indicate that total delay should not be set per synapse
std::vector< bool > default_dendritic_delay_
 indicate that dendritic delay should not be set per synapse
std::vector< bool > default_axonal_delay_
 indicate that axonal delay should not be set per synapse
std::vector< ConnParameter * > weights_
std::vector< ConnParameter * > delays_
std::vector< ConnParameter * > dendritic_delays_
std::vector< ConnParameter * > axonal_delays_
std::vector< ConnParameterMap > synapse_params_
 all other parameters, mapping name to value representation
std::set< std::string > skip_syn_params_
 synapse-specific parameters that should be skipped when we set default synapse parameters

Detailed Description

Abstract base class for Bipartite ConnBuilders which form the components of ConnBuilder.

The base class extracts and holds parameters and provides the connect interface. Derived classes implement the connect method.

Note
This class is also the base class for all components of a TripartiteConnBuilder.

Member Typedef Documentation

◆ ConnParameterMap

typedef std::map< std::string, ConnParameter* > nest::BipartiteConnBuilder::ConnParameterMap
private

Constructor & Destructor Documentation

◆ BipartiteConnBuilder()

nest::BipartiteConnBuilder::BipartiteConnBuilder ( NodeCollectionPTR sources,
NodeCollectionPTR targets,
ThirdOutBuilder * third_out,
const Dictionary & conn_spec,
const std::vector< Dictionary > & syn_specs )

References nest::names::allow_autapses(), allow_autapses_, nest::names::allow_multapses(), allow_multapses_, nest::names::axonal_delay(), axonal_delays_, creates_symmetric_connections_, default_axonal_delay_, default_delay_, default_dendritic_delay_, default_weight_, nest::names::delay(), delays_, nest::names::dendritic_delay(), dendritic_delays_, exceptions_raised_, nest::ModelManager::get_connector_defaults(), nest::kernel(), nest::names::make_symmetric(), make_symmetric_, nest::names::max_delay(), nest::names::min_delay(), nest::KernelManager::model_manager, nest::names::music_channel(), nest::names::num_connections(), param_dicts_, parameters_requiring_skipping_, reset_axonal_delays_(), reset_delays_(), reset_dendritic_delays_(), reset_weights_(), set_default_weight_or_delays_(), set_structural_plasticity_parameters(), set_synapse_model_(), set_synapse_params(), skip_syn_params_, sources_, nest::names::synapse_model(), synapse_model_id_, synapse_params_, targets_, third_out_, Dictionary::update_value(), use_structural_plasticity_, nest::names::weight(), and weights_.

Referenced by nest::AllToAllBuilder::AllToAllBuilder(), nest::BernoulliBuilder::BernoulliBuilder(), nest::FixedInDegreeBuilder::FixedInDegreeBuilder(), nest::FixedOutDegreeBuilder::FixedOutDegreeBuilder(), nest::FixedTotalNumberBuilder::FixedTotalNumberBuilder(), nest::OneToOneBuilder::OneToOneBuilder(), nest::PoissonBuilder::PoissonBuilder(), nest::SPBuilder::SPBuilder(), nest::SymmetricBernoulliBuilder::SymmetricBernoulliBuilder(), nest::ThirdInBuilder::ThirdInBuilder(), and nest::ThirdOutBuilder::ThirdOutBuilder().

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

◆ ~BipartiteConnBuilder()

nest::BipartiteConnBuilder::~BipartiteConnBuilder ( )
virtual

Member Function Documentation

◆ all_parameters_scalar_()

bool nest::BipartiteConnBuilder::all_parameters_scalar_ ( ) const
protected

References axonal_delays_, delays_, dendritic_delays_, synapse_params_, and weights_.

Referenced by nest::AllToAllBuilder::is_symmetric().

Here is the caller graph for this function:

◆ allows_autapses()

bool nest::BipartiteConnBuilder::allows_autapses ( ) const
inline

References allow_autapses_.

◆ allows_multapses()

bool nest::BipartiteConnBuilder::allows_multapses ( ) const
inline

References allow_multapses_.

◆ change_connected_synaptic_elements()

bool nest::BipartiteConnBuilder::change_connected_synaptic_elements ( size_t snode_id,
size_t tnode_id,
const size_t tid,
int update )

Updates the number of connected synaptic elements in the target and the source.

Parameters
snode_idThe node ID of the source
tnode_idThe node ID of the target
tidthe thread of the target
updateAmount of connected synaptic elements to update
Returns
A bool indicating if the target node is on the local thread/process or not

References nest::NodeManager::get_node_or_proxy(), nest::kernel(), nest::KernelManager::node_manager, post_synaptic_element_name_, and pre_synaptic_element_name_.

Referenced by nest::SPBuilder::connect_(), nest::AllToAllBuilder::sp_connect_(), nest::OneToOneBuilder::sp_connect_(), nest::AllToAllBuilder::sp_disconnect_(), and nest::OneToOneBuilder::sp_disconnect_().

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

◆ connect()

void nest::BipartiteConnBuilder::connect ( )
virtual

◆ connect_()

virtual void nest::BipartiteConnBuilder::connect_ ( )
protectedpure virtual

Implements the actual connection algorithm.

Implemented in nest::AllToAllBuilder, nest::BernoulliBuilder, nest::FixedInDegreeBuilder, nest::FixedOutDegreeBuilder, nest::FixedTotalNumberBuilder, nest::OneToOneBuilder, nest::PoissonBuilder, nest::SPBuilder, nest::SymmetricBernoulliBuilder, nest::ThirdBernoulliWithPoolBuilder, and nest::ThirdInBuilder.

Referenced by connect().

Here is the caller graph for this function:

◆ disconnect()

void nest::BipartiteConnBuilder::disconnect ( )
virtual

Delete synapses with or without structural plasticity.

References disconnect_(), exceptions_raised_, sp_disconnect_(), and use_structural_plasticity_.

Referenced by nest::SPManager::disconnect().

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

◆ disconnect_()

virtual void nest::BipartiteConnBuilder::disconnect_ ( )
inlineprotectedvirtual

Reimplemented in nest::AllToAllBuilder, and nest::OneToOneBuilder.

Referenced by disconnect().

Here is the caller graph for this function:

◆ get_default_axonal_delay()

bool nest::BipartiteConnBuilder::get_default_axonal_delay ( ) const
inline

References default_axonal_delay_, and synapse_model_id_.

Referenced by nest::SPManager::set_status().

Here is the caller graph for this function:

◆ get_default_delay()

bool nest::BipartiteConnBuilder::get_default_delay ( ) const
inline

References default_delay_, and synapse_model_id_.

Referenced by nest::SPManager::set_status(), and nest::SPBuilder::update_delay().

Here is the caller graph for this function:

◆ get_default_dendritic_delay()

bool nest::BipartiteConnBuilder::get_default_dendritic_delay ( ) const
inline

References default_dendritic_delay_, and synapse_model_id_.

Referenced by nest::SPManager::set_status().

Here is the caller graph for this function:

◆ get_synapse_model()

size_t nest::BipartiteConnBuilder::get_synapse_model ( ) const
inline

References synapse_model_id_.

Referenced by nest::SPBuilder::update_delay(), and nest::SPManager::update_structural_plasticity().

Here is the caller graph for this function:

◆ is_symmetric()

virtual bool nest::BipartiteConnBuilder::is_symmetric ( ) const
inlinevirtual

Return true if rule automatically creates symmetric connectivity.

Reimplemented in nest::AllToAllBuilder.

Referenced by connect().

Here is the caller graph for this function:

◆ loop_over_targets_()

bool nest::BipartiteConnBuilder::loop_over_targets_ ( ) const
protected

Returns true if conventional looping over targets is indicated.

Conventional looping over targets must be used if

  • any connection parameter requires skipping
  • targets are not given as a simple range (lookup otherwise too slow)

Conventional looping should be used if

  • the number of targets is smaller than the number of local nodes

For background, see Ippen et al (2017).

Returns
true if conventional looping is to be used

References nest::kernel(), nest::KernelManager::node_manager, parameters_requiring_skipping_, nest::NodeManager::size(), and targets_.

Referenced by nest::AllToAllBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::OneToOneBuilder::connect_(), and nest::PoissonBuilder::connect_().

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

◆ register_parameters_requiring_skipping_()

void nest::BipartiteConnBuilder::register_parameters_requiring_skipping_ ( ConnParameter & param)
inlineprivate

Collects all array parameters in a vector.

If the inserted parameter is an array it will be added to a vector of ConnParameters. This vector will be exploited in some connection routines to ensuring thread-safety.

References nest::ConnParameter::is_array(), and parameters_requiring_skipping_.

Referenced by set_default_weight_or_delays_(), and set_synapse_params().

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

◆ requires_proxies()

virtual bool nest::BipartiteConnBuilder::requires_proxies ( ) const
inlinevirtual

Return true if rule is applicable only to nodes with proxies.

Reimplemented in nest::AllToAllBuilder, and nest::OneToOneBuilder.

Referenced by single_connect_().

Here is the caller graph for this function:

◆ reset_axonal_delays_()

void nest::BipartiteConnBuilder::reset_axonal_delays_ ( )
private

References axonal_delays_.

Referenced by BipartiteConnBuilder(), and connect().

Here is the caller graph for this function:

◆ reset_delays_()

void nest::BipartiteConnBuilder::reset_delays_ ( )
private

References delays_.

Referenced by BipartiteConnBuilder(), and connect().

Here is the caller graph for this function:

◆ reset_dendritic_delays_()

void nest::BipartiteConnBuilder::reset_dendritic_delays_ ( )
private

References dendritic_delays_.

Referenced by BipartiteConnBuilder(), and connect().

Here is the caller graph for this function:

◆ reset_weights_()

void nest::BipartiteConnBuilder::reset_weights_ ( )
private

Reset weight and delay pointers.

References weights_.

Referenced by BipartiteConnBuilder(), and connect().

Here is the caller graph for this function:

◆ set_default_weight_or_delays_()

void nest::BipartiteConnBuilder::set_default_weight_or_delays_ ( const Dictionary & syn_params,
const size_t indx )
private

References Dictionary::at(), nest::names::axonal_delay(), axonal_delays_, nest::ModelManager::check_valid_default_delay_parameters(), nest::ConnParameter::create(), default_axonal_delay_, default_delay_, default_dendritic_delay_, default_weight_, nest::names::delay(), delays_, nest::names::dendritic_delay(), dendritic_delays_, nest::ModelManager::get_connector_defaults(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, register_parameters_requiring_skipping_(), synapse_model_id_, nest::names::weight(), and weights_.

Referenced by BipartiteConnBuilder().

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

◆ set_structural_plasticity_parameters()

void nest::BipartiteConnBuilder::set_structural_plasticity_parameters ( const std::vector< Dictionary > & syn_specs)
private

Set structural plasticity parameters (if provided).

This function first checks if any of the given syn_specs contains one of the structural plasticity parameters pre_synaptic_element or post_synaptic_element. If that is the case and only a single syn_spec is given, the parameters are copied to the variables pre_synaptic_element_name_ and post_synaptic_element_name_, and the flag use_structural_plasticity_ is set to true.

An exception is thrown if either

  • only one of the structural plasticity parameter is given
  • multiple syn_specs are given and structural plasticity parameters are present

References Dictionary::get(), Dictionary::known(), nest::names::post_synaptic_element(), post_synaptic_element_name_, nest::names::pre_synaptic_element(), pre_synaptic_element_name_, and use_structural_plasticity_.

Referenced by BipartiteConnBuilder().

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

◆ set_synapse_model_()

void nest::BipartiteConnBuilder::set_synapse_model_ ( const Dictionary & syn_params,
const size_t indx )
private

Set synapse specific parameters.

References Dictionary::get(), nest::ModelManager::get_connection_model(), nest::ModelManager::get_synapse_model_id(), nest::kernel(), Dictionary::known(), nest::KernelManager::model_manager, nest::names::synapse_model(), and synapse_model_id_.

Referenced by BipartiteConnBuilder().

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

◆ set_synapse_params()

void nest::BipartiteConnBuilder::set_synapse_params ( const Dictionary & syn_defaults,
const Dictionary & syn_params,
const size_t indx )
private

References Dictionary::at(), nest::ConnParameter::create(), nest::VPManager::get_num_threads(), nest::kernel(), Dictionary::known(), param_dicts_, register_parameters_requiring_skipping_(), skip_syn_params_, synapse_params_, and nest::KernelManager::vp_manager.

Referenced by BipartiteConnBuilder().

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

◆ set_synaptic_element_names()

void nest::BipartiteConnBuilder::set_synaptic_element_names ( const std::string & pre_name,
const std::string & post_name )

References post_synaptic_element_name_, pre_synaptic_element_name_, and use_structural_plasticity_.

Referenced by nest::SPManager::disconnect().

Here is the caller graph for this function:

◆ single_connect_()

void nest::BipartiteConnBuilder::single_connect_ ( size_t snode_id,
Node & target,
size_t target_thread,
RngPtr rng )
protected

◆ single_disconnect_()

void nest::BipartiteConnBuilder::single_disconnect_ ( size_t snode_id,
Node & target,
size_t target_thread )
inlineprotected

References nest::SPManager::disconnect(), nest::kernel(), nest::KernelManager::sp_manager, and synapse_model_id_.

Referenced by nest::AllToAllBuilder::disconnect_(), nest::OneToOneBuilder::disconnect_(), nest::AllToAllBuilder::sp_disconnect_(), and nest::OneToOneBuilder::sp_disconnect_().

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

◆ skip_conn_parameter_()

void nest::BipartiteConnBuilder::skip_conn_parameter_ ( size_t target_thread,
size_t n_skip = 1 )
inlineprotected

Moves pointer in parameter array.

Calls value-function of all parameters being instantiations of ArrayDoubleParameter or ArrayIntegerParameter, thus moving the pointer to the next parameter value. The function is called when the target node is not located on the current thread or MPI-process and read of an array.

References parameters_requiring_skipping_.

Referenced by nest::AllToAllBuilder::connect_(), nest::BernoulliBuilder::connect_(), nest::FixedInDegreeBuilder::connect_(), nest::FixedOutDegreeBuilder::connect_(), nest::OneToOneBuilder::connect_(), nest::PoissonBuilder::connect_(), nest::SPBuilder::connect_(), nest::AllToAllBuilder::inner_connect_(), nest::FixedInDegreeBuilder::inner_connect_(), nest::AllToAllBuilder::sp_connect_(), and nest::OneToOneBuilder::sp_connect_().

Here is the caller graph for this function:

◆ sp_connect_()

virtual void nest::BipartiteConnBuilder::sp_connect_ ( )
inlineprotectedvirtual

Reimplemented in nest::AllToAllBuilder, and nest::OneToOneBuilder.

Referenced by connect().

Here is the caller graph for this function:

◆ sp_disconnect_()

virtual void nest::BipartiteConnBuilder::sp_disconnect_ ( )
inlineprotectedvirtual

Reimplemented in nest::AllToAllBuilder, and nest::OneToOneBuilder.

Referenced by disconnect().

Here is the caller graph for this function:

◆ supports_symmetric()

virtual bool nest::BipartiteConnBuilder::supports_symmetric ( ) const
inlinevirtual

Return true if rule allows creation of symmetric connectivity.

Reimplemented in nest::OneToOneBuilder, and nest::SymmetricBernoulliBuilder.

Referenced by connect().

Here is the caller graph for this function:

◆ update_param_dict_()

void nest::BipartiteConnBuilder::update_param_dict_ ( size_t snode_id,
Node & target,
size_t target_thread,
RngPtr rng,
size_t indx )
protected

References nest::kernel(), param_dicts_, and synapse_params_.

Referenced by single_connect_().

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

Member Data Documentation

◆ allow_autapses_

◆ allow_multapses_

◆ axonal_delays_

◆ creates_symmetric_connections_

bool nest::BipartiteConnBuilder::creates_symmetric_connections_
protected

◆ default_axonal_delay_

std::vector< bool > nest::BipartiteConnBuilder::default_axonal_delay_
private

indicate that axonal delay should not be set per synapse

Referenced by BipartiteConnBuilder(), get_default_axonal_delay(), set_default_weight_or_delays_(), and single_connect_().

◆ default_delay_

std::vector< bool > nest::BipartiteConnBuilder::default_delay_
private

indicate that total delay should not be set per synapse

Referenced by BipartiteConnBuilder(), get_default_delay(), set_default_weight_or_delays_(), and single_connect_().

◆ default_dendritic_delay_

std::vector< bool > nest::BipartiteConnBuilder::default_dendritic_delay_
private

indicate that dendritic delay should not be set per synapse

Referenced by BipartiteConnBuilder(), get_default_dendritic_delay(), set_default_weight_or_delays_(), and single_connect_().

◆ default_weight_

std::vector< bool > nest::BipartiteConnBuilder::default_weight_
private

indicate that weight should not be set per synapse

Referenced by BipartiteConnBuilder(), set_default_weight_or_delays_(), and single_connect_().

◆ delays_

◆ dendritic_delays_

◆ exceptions_raised_

◆ make_symmetric_

bool nest::BipartiteConnBuilder::make_symmetric_
protected

◆ param_dicts_

std::vector< std::vector< Dictionary > > nest::BipartiteConnBuilder::param_dicts_
protected

Dictionaries to pass to connect function, one per thread for every syn_spec.

Outer dim: syn_spec, inner dim: thread

Note
Each thread can independently modify its dictionary to pass parameters on

Referenced by BipartiteConnBuilder(), set_synapse_params(), single_connect_(), and update_param_dict_().

◆ parameters_requiring_skipping_

std::vector< ConnParameter* > nest::BipartiteConnBuilder::parameters_requiring_skipping_
protected

Pointers to connection parameters specified as arrays.

Referenced by BipartiteConnBuilder(), loop_over_targets_(), register_parameters_requiring_skipping_(), and skip_conn_parameter_().

◆ post_synaptic_element_name_

std::string nest::BipartiteConnBuilder::post_synaptic_element_name_
protected

◆ pre_synaptic_element_name_

std::string nest::BipartiteConnBuilder::pre_synaptic_element_name_
protected

◆ skip_syn_params_

std::set< std::string > nest::BipartiteConnBuilder::skip_syn_params_
private

synapse-specific parameters that should be skipped when we set default synapse parameters

Referenced by BipartiteConnBuilder(), and set_synapse_params().

◆ sources_

◆ synapse_model_id_

◆ synapse_params_

std::vector< ConnParameterMap > nest::BipartiteConnBuilder::synapse_params_
private

all other parameters, mapping name to value representation

Referenced by all_parameters_scalar_(), BipartiteConnBuilder(), connect(), set_synapse_params(), single_connect_(), update_param_dict_(), and ~BipartiteConnBuilder().

◆ targets_

◆ third_out_

ThirdOutBuilder* nest::BipartiteConnBuilder::third_out_
protected

To be triggered when primary connection is created.

Referenced by BipartiteConnBuilder(), and single_connect_().

◆ use_structural_plasticity_

bool nest::BipartiteConnBuilder::use_structural_plasticity_
protected

◆ weights_


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