CARLsim  6.1.0
CARLsim: a GPU-accelerated SNN simulator
poisson_rate.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014 Regents of the University of California. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the distribution.
14  *
15  * 3. The names of its contributors may not be used to endorse or promote
16  * products derived from this software without specific prior written
17  * permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
23  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30  *
31  * *********************************************************************************************** *
32  * CARLsim
33  * created by: (MDR) Micah Richert, (JN) Jayram M. Nageswaran
34  * maintained by: (MA) Mike Avery <averym@uci.edu>, (MB) Michael Beyeler <mbeyeler@uci.edu>,
35  * (KDC) Kristofor Carlson <kdcarlso@uci.edu>
36  * (TSC) Ting-Shuo Chou <tingshuc@uci.edu>
37  *
38  * CARLsim6: LN, JX, KC, KW
39  *
40  * CARLsim available from http://socsci.uci.edu/~jkrichma/CARLsim/
41  * Ver 11/26/2014
42  */
43 
44 #ifndef _POISSON_RATE_H_
45 #define _POISSON_RATE_H_
46 
47 #include <carlsim_api.h>
48 
49 #include <vector>
50 
89 public:
98  PoissonRate(int nNeur, bool onGPU=false);
99 
106  ~PoissonRate();
107 
116  int getNumNeurons();
117 
127  float getRate(int neurId);
128 
136  std::vector<float> getRates();
137 
147  float* getRatePtrCPU();
148 
158  float* getRatePtrGPU();
159 
167  bool isOnGPU();
168 
178  void setRate(int neurId, float rate);
179 
188  void setRates(float rate);
189 
198  void setRates(const std::vector<float>& rates);
199 
200 
201 private:
202  // This class provides a pImpl for the CARLsim User API.
203  // \see https://marcmutz.wordpress.com/translated-articles/pimp-my-pimpl/
204  class Impl;
205  Impl* _impl;
206 };
207 
208 #endif
Class for generating Poisson spike trains.
Definition: poisson_rate.h:88
#define CARLSIM_API
Definition: carlsim_api.h:14