PetaVision  Alpha
AbstractNormProbe.hpp
1 /*
2  * AbstractNormProbe.hpp
3  *
4  * Created on: Aug 11, 2015
5  * Author: pschultz
6  */
7 
8 #ifndef ABSTRACTNORMPROBE_HPP_
9 #define ABSTRACTNORMPROBE_HPP_
10 
11 #include "LayerProbe.hpp"
12 
13 namespace PV {
14 
28 class AbstractNormProbe : public LayerProbe {
29  public:
30  AbstractNormProbe(const char *name, HyPerCol *hc);
31  virtual ~AbstractNormProbe();
32 
37  HyPerLayer *getMaskLayer() { return maskLayer; }
38 
43  char const *getMaskLayerName() { return maskLayerName; }
44 
45  protected:
47  int initialize(const char *name, HyPerCol *hc);
48 
58  virtual int setNormDescription();
59 
66  int setNormDescriptionToString(char const *s);
67 
68  virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override;
69 
90  virtual void ioParam_maskLayerName(enum ParamsIOFlag ioFlag);
97  virtual void calcValues(double timeValue) override;
98 
108  virtual double getValueInternal(double timevalue, int index) = 0;
109 
114  virtual Response::Status
115  communicateInitInfo(std::shared_ptr<CommunicateInitInfoMessage const> message) override;
116 
123  bool maskHasSingleFeature() { return singleFeatureMask; }
124 
132  virtual Response::Status outputState(double timevalue) override;
133 
134  char const *getNormDescription() { return normDescription; }
135 
136  private:
137  int initialize_base();
138 
139  private:
140  char *normDescription;
141  char *maskLayerName;
142  HyPerLayer *maskLayer;
143  bool singleFeatureMask;
144 
145  double timeLastComputed; // the value of the input argument timevalue for the
146  // most recent
147  // getValues() call. Calls to getValue() do not set or refer to this
148  // time.
149 
150 }; // end class AbstractNormProbe
151 
152 } // end namespace PV
153 
154 #endif /* ABSTRACTNORMPROBE_HPP_ */
virtual void calcValues(double timeValue) override
char const * getMaskLayerName()
virtual Response::Status communicateInitInfo(std::shared_ptr< CommunicateInitInfoMessage const > message) override
virtual Response::Status outputState(double timevalue) override
virtual double getValueInternal(double timevalue, int index)=0
virtual void ioParam_maskLayerName(enum ParamsIOFlag ioFlag)
maskLayerName: Specifies a masking layer to use when calculating the norm. When blank (the default)...
virtual int ioParamsFillGroup(enum ParamsIOFlag ioFlag) override
int setNormDescriptionToString(char const *s)
virtual int setNormDescription()