📄 euler.h
字号:
/*************************************************************************** euler.h - description ------------------- copyright : (C) 2001, 2002 by Matt Grover email : mgrover@amygdala.org ***************************************************************************//*************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/#ifndef EULER_H#define EULER_Hnamespace Amygdala {/** @class Euler euler.h amygdala/euler.h * Used to do numerical integrations using Euler's method and * store the result in a lookup table. Designed to be used by * AlphaNeuron, but could easily be extended for use by other * classes to calculate different functions. * @see AlphaNeuron *@author Matt Grover */class Euler {public: /** @param step Step size to be used for the integration. * This should be smaller than the time step size used * for the simulation. (microseconds) * @param min Time of first element in the lookup table (microseconds). * @param max Time of the last element in the lookup table (microseconds). * @param synapticTimeConst Value of the synaptic time constant (ms). * @param membraneTimeConst Value of the membrane time constant (ms). */ Euler(unsigned int step, unsigned int min, unsigned int max, float esynapticTimeConst, float isynapticTimeConst, float membraneTimeConst); ~Euler(); /** Do the integration for the excitatory function and put the * result into tbl and the derivative into derivTbl. * @param resolution The step size to be used in the integration (us). * @param tbl Pointer to table that holds the results. * @param derivTable Table holding the derivative of the results. */ void GenExcitatoryTable(int resolution, float* tbl, float* derivTbl); /** Do the integration for the inhibitory function and put the * result into tbl and the derivative into derivTbl. * @param resolution The step size to be used in the integration (us). * @param tbl Pointer to table that holds the results. * @param derivTable Table holding the derivative of the results. */ void GenInhibitoryTable(int resolution, float* tbl, float* derivTbl); protected: /** Excitatory alpha function used for the integration. * @see AlphaNeuron */ inline void AlphaExcite(); /** Inhibitory alpha function used for the integration. * @see AlphaNeuron */ inline void AlphaInhibit(); unsigned int stepSize; // step size in microseconds unsigned int plotMin; // begining of plot (usually 0) in microseconds unsigned int plotMax; unsigned int plotSize; float* plotData; // array holding data points from integration float* plotDeriv; // derivative of plotData long time; // current time in microseconds float lastV; // milivolts float currV; // milivolts float lastSlope; float currSlope; float tauSe; // excitatory synaptic time constant (in microseconds) float tauSi; // inhibitory synaptic time constant (in microseconds) float tauM; // membrane time constant (in microseconds)};} // namespace Amygdala#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -