NEST main@caf0ae8
 
Loading...
Searching...
No Matches
connection_creator.h
Go to the documentation of this file.
1/*
2 * connection_creator.h
3 *
4 * This file is part of NEST.
5 *
6 * Copyright (C) 2004 The NEST Initiative
7 *
8 * NEST is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * NEST is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with NEST. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#ifndef CONNECTION_CREATOR_H
24#define CONNECTION_CREATOR_H
25
26// C++ includes:
27#include <vector>
28
29// Includes from nestkernel:
30#include "kernel_manager.h"
31#include "mask.h"
32#include "nest_names.h"
33#include "ntree.h"
34#include "position.h"
35
36namespace nest
37{
38template < int D >
39class Layer;
40
41template < int D >
42class MaskedLayer;
43
63{
64public:
73
94 ConnectionCreator( const Dictionary& dict );
95
104 template < int D >
105 void connect( Layer< D >& source, NodeCollectionPTR source_nc, Layer< D >& target, NodeCollectionPTR target_nc );
106
107private:
114 template < int D >
116 {
117 public:
118 PoolWrapper_();
120 void define( MaskedLayer< D >* );
121 void define( std::vector< std::pair< Position< D >, size_t > >* );
122
125
126 typename std::vector< std::pair< Position< D >, size_t > >::iterator begin() const;
127 typename std::vector< std::pair< Position< D >, size_t > >::iterator end() const;
128
129 private:
131 std::vector< std::pair< Position< D >, size_t > >* positions_;
132 };
133
134 void extract_params_( const Dictionary&, std::vector< Dictionary >& );
135
136 template < typename Iterator, int D >
137 void connect_to_target_( Iterator from,
138 Iterator to,
139 Node* tgt_ptr,
140 const Position< D >& tgt_pos,
141 size_t tgt_thread,
142 const Layer< D >& source );
143
144 template < typename Iterator, int D >
145 void connect_to_target_poisson_( Iterator from,
146 Iterator to,
147 Node* tgt_ptr,
148 const Position< D >& tgt_pos,
149 size_t tgt_thread,
150 const Layer< D >& source );
151
152 template < int D >
154 NodeCollectionPTR source_nc,
155 Layer< D >& target,
156 NodeCollectionPTR target_nc );
157
158 template < int D >
160 NodeCollectionPTR source_nc,
161 Layer< D >& target,
162 NodeCollectionPTR target_nc );
163
164 template < int D >
165 void
166 pairwise_poisson_( Layer< D >& source, NodeCollectionPTR source_nc, Layer< D >& target, NodeCollectionPTR target_nc );
167
168 template < int D >
169 void
170 fixed_indegree_( Layer< D >& source, NodeCollectionPTR source_nc, Layer< D >& target, NodeCollectionPTR target_nc );
171
172 template < int D >
173 void
174 fixed_outdegree_( Layer< D >& source, NodeCollectionPTR source_nc, Layer< D >& target, NodeCollectionPTR target_nc );
175
183 std::vector< size_t > synapse_model_;
184 std::vector< std::vector< Dictionary > > param_dicts_;
185 std::vector< ParameterPTR > weight_;
186 std::vector< ParameterPTR > delay_;
187};
188
189} // namespace nest
190
191#endif
Dictionary class for interface to Python and C++ API.
Definition dictionary.h:213
Wrapper for masked and unmasked pools.
Definition connection_creator.h:116
void define(MaskedLayer< D > *)
Definition connection_creator_impl.h:179
Ntree< D, size_t >::masked_iterator masked_begin(const Position< D > &pos) const
Definition connection_creator_impl.h:199
~PoolWrapper_()
Definition connection_creator_impl.h:169
MaskedLayer< D > * masked_layer_
Definition connection_creator.h:130
std::vector< std::pair< Position< D >, size_t > >::iterator begin() const
Definition connection_creator_impl.h:213
std::vector< std::pair< Position< D >, size_t > > * positions_
Definition connection_creator.h:131
Ntree< D, size_t >::masked_iterator masked_end() const
Definition connection_creator_impl.h:206
PoolWrapper_()
Definition connection_creator_impl.h:162
std::vector< std::pair< Position< D >, size_t > >::iterator end() const
Definition connection_creator_impl.h:220
This class is a representation of the dictionary of connection properties given as an argument to the...
Definition connection_creator.h:63
void pairwise_bernoulli_on_source_(Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
Definition connection_creator_impl.h:228
void pairwise_poisson_(Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
Definition connection_creator_impl.h:385
void connect_to_target_poisson_(Iterator from, Iterator to, Node *tgt_ptr, const Position< D > &tgt_pos, size_t tgt_thread, const Layer< D > &source)
Definition connection_creator_impl.h:118
MaskPTR mask_
Definition connection_creator.h:181
std::vector< std::vector< Dictionary > > param_dicts_
Definition connection_creator.h:184
void connect_to_target_(Iterator from, Iterator to, Node *tgt_ptr, const Position< D > &tgt_pos, size_t tgt_thread, const Layer< D > &source)
Definition connection_creator_impl.h:77
ConnectionType
Definition connection_creator.h:66
@ Pairwise_bernoulli_on_source
Definition connection_creator.h:67
@ Pairwise_poisson
Definition connection_creator.h:69
@ Pairwise_bernoulli_on_target
Definition connection_creator.h:68
@ Fixed_outdegree
Definition connection_creator.h:71
@ Fixed_indegree
Definition connection_creator.h:70
std::vector< ParameterPTR > weight_
Definition connection_creator.h:185
void extract_params_(const Dictionary &, std::vector< Dictionary > &)
Definition connection_creator.cpp:165
ParameterPTR number_of_connections_
Definition connection_creator.h:180
std::vector< ParameterPTR > delay_
Definition connection_creator.h:186
ParameterPTR kernel_
Definition connection_creator.h:182
void fixed_indegree_(Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
Definition connection_creator_impl.h:456
bool allow_autapses_
Definition connection_creator.h:177
void pairwise_bernoulli_on_target_(Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
Definition connection_creator_impl.h:299
bool allow_oversized_
Definition connection_creator.h:179
void connect(Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
Connect two layers.
Definition connection_creator_impl.h:38
ConnectionType type_
Definition connection_creator.h:176
std::vector< size_t > synapse_model_
Definition connection_creator.h:183
void fixed_outdegree_(Layer< D > &source, NodeCollectionPTR source_nc, Layer< D > &target, NodeCollectionPTR target_nc)
Definition connection_creator_impl.h:751
bool allow_multapses_
Definition connection_creator.h:178
Abstract base class for Layer of given dimension (D=2 or 3).
Definition layer.h:218
Class for applying masks to layers.
Definition layer.h:458
Base class for all NEST network objects.
Definition node.h:99
Iterator iterating the nodes in a Quadtree inside a Mask.
Definition ntree.h:153
Definition position.h:57
Namespace for the NEST simulation kernel.
Definition beta_normalization_factor.h:33
std::shared_ptr< AbstractMask > MaskPTR
Definition mask.h:44
std::shared_ptr< Parameter > ParameterPTR
Definition parameter.h:40
std::shared_ptr< NodeCollection > NodeCollectionPTR
Definition node_collection.h:50