SHOGUN
v3.2.0
|
00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Written (W) 2013 Heiko Strathmann 00008 */ 00009 00010 #ifndef PROBABILITYDISTRIBUTION_H 00011 #define PROBABILITYDISTRIBUTION_H 00012 00013 #include <shogun/base/SGObject.h> 00014 #include <shogun/lib/SGMatrix.h> 00015 00016 namespace shogun 00017 { 00018 00019 template <class T> class SGVector; 00020 00025 class CProbabilityDistribution: public CSGObject 00026 { 00027 public: 00029 CProbabilityDistribution(); 00030 00032 CProbabilityDistribution(int32_t dimension); 00033 00035 virtual ~CProbabilityDistribution(); 00036 00045 virtual SGMatrix<float64_t> sample(int32_t num_samples, 00046 SGMatrix<float64_t> pre_samples=SGMatrix<float64_t>()) const; 00047 00053 virtual SGVector<float64_t> sample() const; 00054 00060 virtual SGVector<float64_t> log_pdf_multiple(SGMatrix<float64_t> samples) const; 00061 00068 virtual float64_t log_pdf(SGVector<float64_t> sample_vec) const; 00069 00071 virtual const char* get_name() const=0; 00072 00073 private: 00074 00076 void init(); 00077 00078 protected: 00080 int32_t m_dimension; 00081 }; 00082 00083 } 00084 00085 #endif // PROBABILITYDISTRIBUTION_H