PetaVision  Alpha
BaseInitV.cpp
1 /*
2  * BaseInitV.cpp
3  *
4  * Created on: Oct 25, 2016
5  * Author: pschultz
6  */
7 
8 #include "BaseInitV.hpp"
9 #include "columns/HyPerCol.hpp" // To get params for setObjectType
10 
11 namespace PV {
12 
13 BaseInitV::BaseInitV() { initialize_base(); }
14 
15 BaseInitV::BaseInitV(char const *name, HyPerCol *hc) {
16  initialize_base();
17  initialize(name, hc);
18 }
19 
20 BaseInitV::~BaseInitV() {}
21 
22 int BaseInitV::initialize_base() { return PV_SUCCESS; }
23 
24 int BaseInitV::initialize(char const *name, HyPerCol *hc) {
25  return BaseObject::initialize(name, hc);
26 }
27 
28 void BaseInitV::setObjectType() {
29  auto *params = parent->parameters();
30  char const *initVTypeString = params->stringValue(name, "InitVType", false);
31  mObjectType = initVTypeString ? std::string(initVTypeString) : mDefaultInitV;
32 }
33 
34 int BaseInitV::ioParamsFillGroup(enum ParamsIOFlag ioFlag) { return PV_SUCCESS; }
35 
36 void BaseInitV::calcV(float *V, PVLayerLoc const *loc) {}
37 
38 string const BaseInitV::mDefaultInitV = "ConstantV";
39 
40 } // end namespace PV
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
Definition: BaseInitV.cpp:34