Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
AllToAllConnection.h
Go to the documentation of this file.
1 /*
2 * Copyright 2014-2018 Friedemann Zenke
3 *
4 * This file is part of Auryn, a simulation package for plastic
5 * spiking neural networks.
6 *
7 * Auryn is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * Auryn is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with Auryn. If not, see <http://www.gnu.org/licenses/>.
19 *
20 * If you are using Auryn or parts of it for your work please cite:
21 * Zenke, F. and Gerstner, W., 2014. Limits to high-speed simulations
22 * of spiking neural networks using general-purpose computers.
23 * Front Neuroinform 8, 76. doi: 10.3389/fninf.2014.00076
24 */
25 
26 #ifndef ALLTOALLCONNECTION_H_
27 #define ALLTOALLCONNECTION_H_
28 
29 #include "auryn_definitions.h"
30 #include "AurynVector.h"
31 #include "Connection.h"
32 #include "System.h"
33 
34 #include <sstream>
35 #include <fstream>
36 #include <stdio.h>
37 
38 #include <boost/random/mersenne_twister.hpp>
39 #include <boost/random/uniform_int.hpp>
40 #include <boost/random/variate_generator.hpp>
41 #include <boost/random/exponential_distribution.hpp>
42 #include <boost/random/normal_distribution.hpp>
43 
44 namespace auryn {
45 
48 {
49 private:
50  SpikeContainer * spikes;
51  void init(AurynWeight weight);
52  AurynWeight connection_weight;
53 
54 protected:
55  void free();
56 
57 
58 public:
61  SpikingGroup * source,
62  NeuronGroup * destination,
63  AurynWeight weight = 1.0,
64  TransmitterType transmitter = GLUT,
65  string name = "Default AllToAllConnection"
66  );
67  virtual ~AllToAllConnection();
68 
69  virtual AurynWeight get(NeuronID i, NeuronID j);
70  virtual AurynWeight * get_ptr(NeuronID i, NeuronID j);
71  virtual AurynWeight get_data(NeuronID i);
72  virtual AurynLong get_nonzero();
73 
74  virtual void set_data(NeuronID i, AurynWeight value);
75  virtual void set(NeuronID i, NeuronID j, AurynWeight value);
76  void finalize();
77 
78  virtual void propagate();
79 
83  virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid = 0);
84  virtual bool write_to_file(string filename);
85  virtual bool load_from_file(string filename);
86 
88  std::vector<neuron_pair> get_block(NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col);
89 
90 };
91 
92 }
93 
94 #endif /*ALLTOALLCONNECTION_H_*/
void finalize()
Finalize Connection after initialization to prepare for use in simulation.
Definition: AllToAllConnection.cpp:59
Provides all to all connectivity.
Definition: AllToAllConnection.h:47
Standard Glutamatergic (excitatory) transmission.
Definition: auryn_definitions.h:139
virtual AurynWeight * get_ptr(NeuronID i, NeuronID j)
Return pointer to weight element i,j if it exists, otherwise return NULL.
Definition: AllToAllConnection.cpp:87
The abstract base class for all Connection objects in Auryn.
Definition: Connection.h:53
void free()
Definition: AllToAllConnection.cpp:55
std::vector< NeuronID > SpikeContainer
Spike container type. Used for storing spikes.
Definition: auryn_definitions.h:161
virtual ~AllToAllConnection()
Definition: AllToAllConnection.cpp:42
std::vector< neuron_pair > get_block(NeuronID lo_row, NeuronID lo_col, NeuronID hi_row, NeuronID hi_col)
Returns a vector of ConnectionsID of a block specified by the arguments.
Definition: AllToAllConnection.cpp:119
virtual void stats(AurynDouble &mean, AurynDouble &std, StateID zid=0)
Return stats for connection.
Definition: AllToAllConnection.cpp:97
STL namespace.
Abstract base class of all objects producing spikes.
Definition: SpikingGroup.h:67
double AurynDouble
Higher precision floating point datatype.
Definition: auryn_definitions.h:158
AurynFloat AurynWeight
Unit of synaptic weights.
Definition: auryn_definitions.h:159
virtual AurynLong get_nonzero()
Return number of nonzero elements in this Connection.
Definition: AllToAllConnection.cpp:113
Definition: ABSConnection.h:38
unsigned long AurynLong
An unsigned long type used to count synapses or similar.
Definition: auryn_definitions.h:154
TransmitterType
Specifies the different transmitter types that Auryn knows.
Definition: auryn_definitions.h:138
virtual void set_data(NeuronID i, AurynWeight value)
Definition: AllToAllConnection.cpp:77
virtual void propagate()
Propagate method to propagate spikes. Called by System run method.
Definition: AllToAllConnection.cpp:63
Abstract base class for all neuron groups.
Definition: NeuronGroup.h:45
virtual AurynWeight get_data(NeuronID i)
Return weight element as index in data array.
Definition: AllToAllConnection.cpp:72
virtual bool load_from_file(string filename)
Implements load from file functionality. Also called in save_network_state from System class...
Definition: AllToAllConnection.cpp:108
unsigned int StateID
StateID is an unsigned integeger type used to index synaptic states in Auryn.
Definition: auryn_definitions.h:153
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
virtual bool write_to_file(string filename)
Implements save to file functionality. Also called in save_network_state from System class...
Definition: AllToAllConnection.cpp:103