PetaVision  Alpha
ConstantV.cpp
1 /*
2  * ConstantV.cpp
3  *
4  * Created on: Oct 26, 2011
5  * Author: pschultz
6  */
7 
8 #include "ConstantV.hpp"
9 #include "columns/HyPerCol.hpp"
10 #include "include/default_params.h"
11 
12 namespace PV {
13 
14 ConstantV::ConstantV() { initialize_base(); }
15 
16 ConstantV::ConstantV(char const *name, HyPerCol *hc) {
17  initialize_base();
18  initialize(name, hc);
19 }
20 
21 ConstantV::~ConstantV() {}
22 
23 int ConstantV::initialize_base() { return PV_SUCCESS; }
24 
25 int ConstantV::initialize(char const *name, HyPerCol *hc) {
26  int status = BaseInitV::initialize(name, hc);
27  return status;
28 }
29 
30 int ConstantV::ioParamsFillGroup(enum ParamsIOFlag ioFlag) {
31  int status = BaseInitV::ioParamsFillGroup(ioFlag);
32  ioParam_valueV(ioFlag);
33  return status;
34 }
35 
36 void ConstantV::ioParam_valueV(enum ParamsIOFlag ioFlag) {
37  parent->parameters()->ioParamValue(ioFlag, name, "valueV", &mValueV, (float)V_REST);
38 }
39 
40 void ConstantV::calcV(float *V, PVLayerLoc const *loc) {
41  if (V == NULL) {
42  Fatal().printf("%s: calcV called but membrane potential V is null.\n", getDescription_c());
43  }
44  int const numNeurons = loc->nx * loc->ny * loc->nf * loc->nbatch;
45  for (int k = 0; k < numNeurons; k++) {
46  V[k] = mValueV;
47  }
48 }
49 
50 } // end namespace PV
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
Definition: ConstantV.cpp:30
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
Definition: BaseInitV.cpp:34
virtual void ioParam_valueV(enum ParamsIOFlag ioFlag)
valueV: The value to initialize the V buffer with
Definition: ConstantV.cpp:36