Direct Graphical Models  v.1.7.0
IPDF.h
1 // Probability Density Function interface class
2 // Written by Sergey Kosov in 2015 for Project X
3 #pragma once
4 
5 #include "BaseRandomModel.h"
6 
7 namespace DirectGraphicalModels
8 {
9  // ================================ PDF Class ==============================
16  class IPDF : public CBaseRandomModel
17  {
18  friend class CTrainNodeBayes;
19 
20  public:
21  DllExport IPDF(void) : CBaseRandomModel(0), m_nPoints(0) {}
22  DllExport virtual ~IPDF(void) {}
23 
28  DllExport virtual void addPoint(Scalar point) = 0;
34  DllExport virtual double getDensity(Scalar point) = 0;
39  DllExport virtual Scalar min(void) const = 0;
44  DllExport virtual Scalar max(void) const = 0;
50  DllExport bool isEstimated(void) { return m_nPoints != 0; }
51 
52 
53  protected:
54  long m_nPoints;
55  };
56 }
bool isEstimated(void)
Checks weather the PDF was estimated.
Definition: IPDF.h:50
virtual void addPoint(Scalar point)=0
Adds a sample point for PDF estimation.
virtual double getDensity(Scalar point)=0
Returns the probability density value for the argument point.
virtual Scalar min(void) const =0
Returns the lower argument boundary of the PDF.
long m_nPoints
The number of samples, added with the addPoint() function.
Definition: IPDF.h:54
Base abstract class for random model training.
virtual Scalar max(void) const =0
Returns the upper argument boundary of the PDF.
Interface class for Probability Density Function (PDF)
Definition: IPDF.h:16
virtual ~IPDF(void)
Definition: IPDF.h:22