23 #ifndef CONNECTOR_BASE_H
24 #define CONNECTOR_BASE_H
52 #pragma omp threadprivate(poormansallocpool)
59 template<
typename Tnew,
typename Told,
typename C>
65 Tnew*
p =
new (poormansallocpool[omp_get_thread_num()].
alloc(
sizeof(Tnew))) Tnew(*connector, connection);
67 Tnew* p =
new (poormansallocpool.
alloc(
sizeof(Tnew))) Tnew(*connector, connection);
71 Tnew* p =
new Tnew(*connector, connection);
103 virtual void get_connections(
size_t source_gid,
size_t target_gid,
size_t thrd,
size_t synapse_id,
ArrayDatum &conns)
const = 0;
105 virtual void send(
Event &
e,
thread t,
const std::vector<ConnectorModel*> & cm) = 0;
108 double_t t_trig,
const std::vector<ConnectorModel*> & cm) = 0;
131 template <
typename ConnectionT >
142 template <
size_t K,
typename ConnectionT >
151 for (
size_t i=0; i<K-1; i++)
163 assert (p >= 0 && static_cast<size_t>(p) < K);
172 assert (p >= 0 && static_cast<size_t>(p) < K);
192 return *suicide_and_resurrect< Connector<K+1, ConnectionT> >(
this,
c);
197 for (
size_t i=0; i<K; i++ )
204 for (
size_t i=0; i<K; i++ )
206 if (
C_[i].get_target(thrd)->get_gid() == target_gid)
213 for(
size_t i=0; i<K; i++)
224 for(
size_t i=0; i<K; i++)
232 return C_[0].get_syn_id();
235 const ConnectionT*
get_C()
const {
return C_; }
242 template<
typename ConnectionT>
262 assert (static_cast<size_t>(p) == 0);
271 assert (static_cast<size_t>(p) == 0 );
291 return *suicide_and_resurrect< Connector<2, ConnectionT> >(
this,
c);
306 if (
C_[0].get_target(thrd)->get_gid() == target_gid)
327 return C_[0].get_syn_id();
330 const ConnectionT*
get_C()
const {
return C_; }
340 template <
typename ConnectionT >
343 std::vector<ConnectionT>
C_;
349 for (
size_t i=0; i<K_cutoff-1; i++)
361 assert (p >= 0 && static_cast<size_t>(p) <
C_.size());
370 assert (p >= 0 && static_cast<size_t>(p) <
C_.size());
396 for (
size_t i=0; i<
C_.size(); i++ )
404 for (
size_t i=0; i<
C_.size(); i++ )
405 if (
C_[i].get_target(thrd)->get_gid() == target_gid)
413 for(
size_t i=0; i<
C_.size(); i++)
426 for(
size_t i=0; i<
C_.size(); i++)
433 return C_[0].get_syn_id();
452 for (
size_t i=0; i<size(); i++)
454 at(i)->~ConnectorBase();
462 for (
size_t i=0; i<size(); i++)
463 at(i)->get_synapse_status(syn_id, d, p);
468 for (
size_t i=0; i<size(); i++)
469 at(i)->set_synapse_status(syn_id, cm, d, p);
475 for (
size_t i=0; i<size(); i++)
477 n += at(i)->get_num_connections();
484 for (
size_t i=0; i<size(); i++)
485 if (syn_id == at(i)->get_syn_id())
486 return at(i)->get_num_connections();
492 for (
size_t i=0; i<size(); i++ )
493 at(i)->get_connections(source_gid,thrd,synapse_id,conns);
498 for (
size_t i=0; i<size(); i++ )
499 at(i)->get_connections(source_gid,target_gid,thrd,synapse_id,conns);
505 for (
size_t i=0; i<size(); i++)
506 at(i)->send(e, t, cm);
511 for (
size_t i=0; i<size(); i++)
512 at(i)->trigger_update_weight(vt_gid, t, dopa_spikes, t_trig, cm);
bool homogeneous_model()
Definition: connector_base.h:237
void set_synapse_status(synindex syn_id, ConnectorModel &cm, const DictionaryDatum &d, port p)
Definition: connector_base.h:267
double_t t_lastspike_
Definition: connector_base.h:124
Connector< 2, ConnectionT > & push_back(const ConnectionT &c)
Definition: connector_base.h:289
PaddedPMA poormansallocpool[]
Definition: connector_base.h:49
virtual ~ConnectorBase()
Definition: connector_base.h:117
synindex get_syn_id() const
Definition: connector_base.h:516
const Name d("d")
Specific to Izhikevich 2003.
Definition: nest_names.h:83
synindex get_syn_id() const
Definition: connector_base.h:325
~Connector()
Definition: connector_base.h:156
size_t get_num_connections()
Definition: connector_base.h:276
Declarations for base class Node.
void get_connections(size_t source_gid, size_t thrd, synindex synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:490
synindex get_syn_id() const
Definition: connector_base.h:229
Definition: connector_base.h:88
void set_synapse_status(synindex syn_id, ConnectorModel &cm, const DictionaryDatum &d, port p)
Definition: connector_base.h:366
Encapsulates information which is sent between Nodes.
Definition: event.h:73
void get_connections(size_t source_gid, size_t target_gid, size_t thrd, size_t synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:401
~Connector()
Definition: connector_base.h:255
size_t get_num_connections()
Definition: connector_base.h:472
double_t get_t_lastspike() const
Definition: connector_base.h:119
Definition: connection_id.h:32
const ConnectionT * get_C() const
Definition: connector_base.h:235
The Fujitsu compiler on K cannot handle OpenMP thread-private properly.
Definition: allocator.h:270
const synindex invalid_synindex
Definition: nest.h:116
const ConnectionT * get_C() const
Definition: connector_base.h:330
virtual void get_synapse_status(synindex syn_id, DictionaryDatum &d, port p) const =0
void push_back(const Token &t)
Definition: tokenarray.h:236
void send(Event &e, thread t, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:210
bool homogeneous_model()
Definition: connector_base.h:436
void send(Event &e, thread t, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:409
void trigger_update_weight(long_t vt_gid, thread t, const vector< spikecounter > &dopa_spikes, double_t t_trig, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:509
void trigger_update_weight(long_t vt_gid, thread t, const vector< spikecounter > &dopa_spikes, double_t t_trig, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:423
ConnectionT::CommonPropertiesType const & get_common_properties() const
Definition: connector_model.h:145
void get_synapse_status(synindex syn_id, DictionaryDatum &d, port p) const
Definition: connector_base.h:159
void get_synapse_status(synindex syn_id, DictionaryDatum &d, port p) const
Definition: connector_base.h:258
void get_connections(size_t source_gid, size_t thrd, synindex synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:394
void get_synapse_status(synindex syn_id, DictionaryDatum &d, port p) const
Definition: connector_base.h:357
bool homogeneous_model()
Definition: connector_base.h:519
Definition: connector_base.h:341
ConnectorBase()
Definition: connector_base.cpp:29
void set_port(port p)
Set the port number.
Definition: event.h:811
Time const & get_stamp() const
Return time stamp of the event.
Definition: event.h:757
Definition: connector_base.h:445
Declarations for class Network.
void get_connections(size_t source_gid, size_t target_gid, size_t thrd, size_t synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:496
void set_t_lastspike(const double_t t_lastspike)
Definition: connector_base.h:120
void send(Event &e, thread t, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:311
~Connector()
Definition: connector_base.h:354
std::vector< ConnectionT > C_
Definition: connector_base.h:343
size_t get_num_connections(synindex syn_id)
Definition: connector_base.h:482
virtual size_t get_num_connections()=0
virtual void get_connections(size_t source_gid, size_t thrd, synindex synapse_id, ArrayDatum &conns) const =0
void * alloc(size_t obj_size)
Definition: allocator.cpp:174
bool homogeneous_model()
Definition: connector_base.h:332
Definition: connector_base.h:143
long_t port
Connection port number to distinguis outgoing connections.
Definition: nest.h:155
Connector< K_cutoff, ConnectionT > & push_back(const ConnectionT &c)
Definition: connector_base.h:388
virtual void set_synapse_status(synindex syn_id, ConnectorModel &cm, const DictionaryDatum &d, port p)=0
double double_t
Double precision floating point numbers.
Definition: nest.h:93
virtual void trigger_update_weight(long_t vt_gid, thread t, const vector< spikecounter > &dopa_spikes, double_t t_trig, const std::vector< ConnectorModel * > &cm)=0
double_t get_ms() const
Definition: nest_time.h:389
The poor man's allocator is a simple pool-based allocator, used to allocate storage for connections i...
Definition: allocator.h:201
unsigned char synindex
Unsigned char type for enumerations of synapse types.
Definition: nest.h:115
Tnew * suicide_and_resurrect(Told *connector, C connection)
Definition: connector_base.h:61
void set_synapse_status(synindex syn_id, ConnectorModel &cm, const DictionaryDatum &d, port p)
Definition: connector_base.h:466
void get_connections(size_t source_gid, size_t thrd, synindex synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:294
Connector(const ConnectionT &c)
Definition: connector_base.h:250
const Name n("n")
Number of synaptic release sites (int >=0) (Tsodyks2_connection)
Definition: nest_names.h:202
void set_synapse_status(synindex syn_id, ConnectorModel &cm, const DictionaryDatum &d, port p)
Definition: connector_base.h:168
size_t get_num_connections(synindex syn_id)
Definition: connector_base.h:380
Part of definition of volume_transmitter to record and manage spike times and multiplicity of neurons...
size_t get_num_connections()
Definition: connector_base.h:177
void get_synapse_status(synindex syn_id, DictionaryDatum &d, port p) const
Definition: connector_base.h:460
void get_connections(size_t source_gid, size_t target_gid, size_t thrd, size_t synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:202
size_t get_num_connections(synindex syn_id)
Definition: connector_base.h:281
virtual ConnectorBase & push_back(const ConnectionT &c)=0
Connector(const Connector< K-1, ConnectionT > &Cm1, const ConnectionT &c)
Definition: connector_base.h:149
synindex get_syn_id() const
Definition: connector_base.h:431
size_t get_num_connections(synindex syn_id)
Definition: connector_base.h:182
void trigger_update_weight(long_t vt_gid, thread t, const vector< spikecounter > &dopa_spikes, double_t t_trig, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:318
ConnectionT C_[K]
Definition: connector_base.h:145
void get_connections(size_t source_gid, size_t thrd, synindex synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:195
AggregateDatum< nest::ConnectionID,&nest::NestModule::ConnectionType > ConnectionDatum
SLI Datum types related to the NEST kernel.
Definition: nest_datums.h:36
Connector(const Connector< K_cutoff-1, ConnectionT > &C, const ConnectionT &c)
Definition: connector_base.h:347
Connector< K+1, ConnectionT > & push_back(const ConnectionT &c)
Definition: connector_base.h:190
virtual bool homogeneous_model()=0
size_t get_num_connections()
Definition: connector_base.h:375
const Name p("p")
current release probability (Tsodyks2_connection)
Definition: nest_names.h:218
const Name c("c")
Specific to Izhikevich 2003.
Definition: nest_names.h:62
Definition: connector_model.h:38
void get_connections(size_t source_gid, size_t target_gid, size_t thrd, size_t synapse_id, ArrayDatum &conns) const
Definition: connector_base.h:302
int_t thread
Thread index type.
Definition: nest.h:133
long long_t
Integer number with at least 32 bit.
Definition: nest.h:96
Definition: connector_base.h:132
Definition: connector_model.h:113
const double e
Definition: numerics.cpp:62
virtual ~HetConnector()
Definition: connector_base.h:450
virtual synindex get_syn_id() const =0
void trigger_update_weight(long_t vt_gid, thread t, const vector< spikecounter > &dopa_spikes, double_t t_trig, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:221
void send(Event &e, thread t, const std::vector< ConnectorModel * > &cm)
Definition: connector_base.h:502
virtual void send(Event &e, thread t, const std::vector< ConnectorModel * > &cm)=0