Auryn simulator  v0.8.1-206-gb56e451
Plastic Spiking Neural Network Simulator
AurynDelayVector.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 AURYNDELAYVECTOR_H_
27 #define AURYNDELAYVECTOR_H_
28 
29 #include <ctime>
30 #include <assert.h>
31 #include <vector>
32 
33 #include "auryn_definitions.h"
34 #include "AurynVector.h"
35 
36 
37 namespace auryn {
38 
39 
53  {
54  private:
55  typedef AurynVectorFloat super;
56 
57  int delay_buffer_size_;
58  int memory_pos_;
59  std::vector< AurynVectorFloat* > memory;
60 
61  public:
63  AurynDelayVector(NeuronID n, unsigned int delay_buffer_size);
64 
66  virtual ~AurynDelayVector();
67 
69  void advance();
70 
75  AurynVectorFloat * mem_get_vector(int delay=-1);
76 
82  AurynFloat mem_get(NeuronID i, int delay=-1);
83 
88  AurynVectorFloat * mem_ptr(int delay=-1);
89 
91  void resize(NeuronID new_size);
92 
94  AurynTime get_delay_size() { return delay_buffer_size_; }
95 
96  };
97 
98 }
99 
100 
101 #endif /*AURYNDELAYVECTOR_H_*/
void advance()
Advances memory buffer by one step.
Definition: AurynDelayVector.cpp:57
AurynVectorFloat * mem_ptr(int delay=-1)
Returns pointer to delayed array element.
Definition: AurynDelayVector.cpp:79
AurynTime get_delay_size()
Returns delay buffer size in units of AurynTime.
Definition: AurynDelayVector.h:94
AurynDelayVector(NeuronID n, unsigned int delay_buffer_size)
Default constructor.
Definition: AurynDelayVector.cpp:32
int n
Definition: mkpat.py:5
Definition: ABSConnection.h:38
float AurynFloat
Low precision floating point datatype.
Definition: auryn_definitions.h:157
virtual ~AurynDelayVector()
Default destructor.
Definition: AurynDelayVector.cpp:42
void resize(NeuronID new_size)
Resizes the vector and the buffer vectors.
Definition: AurynDelayVector.cpp:49
Default AurynVectorFloat class for performance computation.
Definition: AurynVector.h:796
NeuronID AurynTime
Defines Auryns discrete time unit of the System clock. Change to AurynLong if 120h of simtime are not...
Definition: auryn_definitions.h:155
AurynDelayVector is a AurynVectorFloat which keeps its own history in a ring buffer.
Definition: AurynDelayVector.h:52
AurynVectorFloat * mem_get_vector(int delay=-1)
Returns delayed state vector.
Definition: AurynDelayVector.cpp:66
unsigned int NeuronID
NeuronID is an unsigned integeger type used to index neurons in Auryn.
Definition: auryn_definitions.h:151
AurynFloat mem_get(NeuronID i, int delay=-1)
Returns delayed element.
Definition: AurynDelayVector.cpp:74