PetaVision  Alpha
InitVFromFile.hpp
1 /*
2  * InitVFromFile.hpp
3  *
4  * Created on: Oct 26, 2016
5  * Author: pschultz
6  */
7 
8 #ifndef INITVFROMFILE_HPP_
9 #define INITVFROMFILE_HPP_
10 
11 #include "BaseInitV.hpp"
12 #include "utils/BufferUtilsPvp.hpp"
13 
14 namespace PV {
15 
16 class InitVFromFile : public BaseInitV {
17  protected:
28  virtual void ioParam_Vfilename(enum ParamsIOFlag ioFlag);
29 
39  virtual void ioParam_frameNumber(enum ParamsIOFlag ioFlag);
41  public:
42  InitVFromFile(char const *name, HyPerCol *hc);
43  virtual ~InitVFromFile();
44  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
45  virtual void calcV(float *V, PVLayerLoc const *loc) override;
46 
47  protected:
48  InitVFromFile();
49  int initialize(char const *name, HyPerCol *hc);
50  void readDenseActivityPvp(
51  float *V,
52  PVLayerLoc const *loc,
53  FileStream &fileStream,
54  BufferUtils::ActivityHeader const &header);
55 
56  private:
57  int initialize_base();
58 
59  private:
60  char *mVfilename = nullptr;
61  int mFrameNumber = 0;
62 }; // end class InitVFromFile
63 
64 } // end namespace PV
65 
66 #endif /* INITVFROMFILE_HPP_ */
virtual void ioParam_frameNumber(enum ParamsIOFlag ioFlag)
frameNumber: selects which frame of the pvp file to use. The default value is zero. Note that this parameter is zero-indexed: for example, if a pvp file has five frames, the allowable values of this parameter are 0 through 4, inclusive. When batching, the batch element 0 loads the indicated frame, batch element 1 loads frameNumber + 1, etc. If the number of frames in the file is exhausted, the file wraps around to the beginning.
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
virtual void ioParam_Vfilename(enum ParamsIOFlag ioFlag)
VFilename: The path to the file with the initial values. Relative paths are relative to the working d...