📄 functionlookup.h
字号:
/*************************************************************************** functionlookup.h - description ------------------- copyright : (C) 2001 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 FUNCTIONLOOKUP_H#define FUNCTIONLOOKUP_Husing namespace std;#include <vector>#include <string>#include <amygdala/neuron.h>class Neuron;/** @class FunctionLookup functionlookup.h amygdala/functionlookup.h * @brief FunctionLookup is a container class for the lookup tables * used by the Neuron classes. * * Since a large number of Neurons in a given Network will have identical * lookup tables, the tables can be shared to save space and improve caching * performance. FunctionLookup manages the creation of tables by querying Neurons * after a request for a table has been made. If a suitable table has already been * filled, then a pointer will be returned. Otherwise, FunctionLookup will * instruct the Neuron to fill a table and pass a pointer back. * * The current method of filling lookup tables is convoluted and limits * their use to the Neuron classes. Amygdala 0.4 will feature a revised * FunctionLookup API that simplifies the process and allows any class to * request a table. * @author Matt Grover */class FunctionLookup {public: FunctionLookup(); ~FunctionLookup(); /** This will check to see * if a table with the given parameters (and some additional * parameters in reqNrn) already exists. If a matching table * does not exist, a new one will be created. * @returns Pointer to a lookup table. */ float* GetLookupTable(Neuron* reqNrn, int tableIdx, int tableSize, int stepSize); private: int stepSize; int tableSize; // Storage for a pointer to a table and its associated // parameters struct tableData { int index; int size; int stepSize; int numParams; string nrnType; float* data; float* params; }; // vector of lookup tables vector<tableData> lookup;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -