neuronproperties.cpp

来自「amygdata的神经网络算法源代码」· C++ 代码 · 共 64 行

CPP
64
字号
#include "neuronproperties.h"#include "physicalproperties.h"using namespace Amygdala;using namespace std;NeuronProperties::NeuronProperties():Properties(),physProps(0){}NeuronProperties::NeuronProperties(bool initializePhysicalProps):    Properties(){    if (initializePhysicalProps) {        physProps = new PhysicalProperties();    }    else {        physProps = 0;    }}NeuronProperties::NeuronProperties(const NeuronProperties& rhs):    Properties(rhs){       if (rhs.physProps) {        physProps = new PhysicalProperties(*(rhs.physProps));    }    else {        physProps = 0;    }}NeuronProperties::~NeuronProperties(  ){    if(physProps)        delete physProps;}void NeuronProperties::SetProperty(const string& name, const string& value){    // No intrinsic properties, so just pass this on physProps    if (physProps) {        physProps->SetProperty(name, value);    }    else {        // create a new PhysicalProperties and pass on        // if the property is not found in PhysicalProperties,        // memory leaks are not an issue because an exception will be        // thrown which will alert the user        physProps = new PhysicalProperties();        physProps->SetProperty(name, value);    }}map< string, string > NeuronProperties::GetPropertyMap() const{    if(physProps)        return physProps->GetPropertyMap();    else {        map< string, string > empty;        return empty;    }}

⌨️ 快捷键说明

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