⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 neurongroup.h

📁 amygdata的神经网络算法源代码
💻 H
字号:
/***************************************************************************                          neurongroup.h  -  description                             -------------------    copyright            : (C) 2003 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 NEURONGROUP_H#define NEURONGROUP_H#include <amygdala/amygdalaclass.h>#include <vector>#include <string>namespace Amygdala {class NetworkPartition;class Neuron;class NeuronGroup: public AmygdalaClass{public:    NeuronGroup() {};    NeuronGroup(const std::string& name):groupName(name) {}    virtual ~NeuronGroup() = 0;    virtual void AddNeuron(Neuron* nrn);    const std::string& GetName() const { return groupName; }    void SetName(std::string name) { groupName = name; }    unsigned int GetGroupId() const { return groupId; }    void SetGroupId(unsigned int id) { groupId = id; }    /** Add all of the neurons in this group to the specified output group.     * @see OutputManager::AddNeuronToGroup((Neuron* nrn, AmGroupInt group) */    void AddToOutputGroup(AmGroupInt groupId) const;	/** @returns The size of the group. */    unsigned int size() const { return nrnGroup.size(); }    typedef std::vector<Neuron*>::iterator iterator;    typedef std::vector<Neuron*>::const_iterator const_iterator;    typedef std::vector<Neuron*>::reverse_iterator reverse_iterator;    typedef std::vector<Neuron*>::const_reverse_iterator const_reverse_iterator;    /** @returns An iterator (vector<Neuron*>) pointing to the first neuron in the group. */    iterator begin() { return nrnGroup.begin(); }    /** @returns An iterator (vector<Neuron*>) pointing to the last neuron in the group. */    iterator end() { return nrnGroup.end(); }    /** @returns An iterator (vector<Neuron*>) pointing to the first neuron in the group. */    const_iterator begin() const { return nrnGroup.begin(); }    /** @returns An iterator (vector<Neuron*>) pointing to the last neuron in the group. */    const_iterator end() const { return nrnGroup.end(); }    /** @returns A reverse iterator (vector<Neuron*>) pointing to the first neuron in the group. */    reverse_iterator rbegin() { return nrnGroup.rbegin(); }    /** @returns A reverse iterator (vector<Neuron*>) pointing to the last neuron in the group. */    reverse_iterator rend() { return nrnGroup.rend(); }    /** @returns A reverse iterator (vector<Neuron*>) pointing to the first neuron in the group. */    const_reverse_iterator rbegin() const { return nrnGroup.rbegin(); }    /** @returns A reverse iterator (vector<Neuron*>) pointing to the last neuron in the group. */    const_reverse_iterator rend() const { return nrnGroup.rend(); }    /** @returns A pointer to a member Neuron.  The index is not related     * to the NeuronID. */    Neuron* operator[](unsigned int& index) { return nrnGroup[index]; }    Neuron* GetNeuron(const unsigned int& index) const { return nrnGroup[index]; }protected:    std::string groupName;    unsigned int groupId;    std::vector<Neuron*> nrnGroup;};}   // namespace Amygdala#endif // NEURONGROUP_H

⌨️ 快捷键说明

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