euler.h

来自「此代码经过大量使用」· C头文件 代码 · 共 87 行

H
87
字号
/***************************************************************************                          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_H/** @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 synapticTimeConst,			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 tauS;		        // synaptic time constant (in microseconds)	float tauM;		        // membrane time constant (in microseconds)};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?