diracpdf.hpp

来自「dysii是一款非常出色的滤波函数库」· HPP 代码 · 共 101 行

HPP
101
字号
#ifndef INDII_ML_AUX_DIRACPDF_HPP#define INDII_ML_AUX_DIRACPDF_HPP#include "Pdf.hpp"namespace indii {  namespace ml {    namespace aux {/** * Dirac \f$\delta\f$-function probability density. * * @author Lawrence Murray <lawrence@indii.org> * @version $Rev: 341 $ * @date $Date: 2007-10-31 16:07:59 +0000 (Wed, 31 Oct 2007) $ * * Supports serialization through the Boost.Serialization library. */class DiracPdf : public Pdf, public vector {public:  /**   * Default constructor.   *   * Initialises the Dirac with zero dimensions. This should generally   * only be used when the object is to be restored from a   * serialization. Indeed, there is no other way to resize the Dirac   * to nonzero dimensionality except by subsequently restoring from a   * serialization.   */  DiracPdf();  /**   * Constructor.   *   * @param x The expectation of the Dirac.   */  DiracPdf(const vector& x);  /**   * Construct Dirac given dimensionality. The expectation remains   * uninitialised, and should be set with setExpectation().   *   * @param N \f$N\f$; number of dimensions of the Dirac.   */  DiracPdf(unsigned int N);  virtual unsigned int getDimensions() const;  virtual void setDimensions(const unsigned int N,      const bool preserve = false);  /**   * Get the expected value of the Dirac.   *   * @return \f$\mathbf{\mu}\f$; expected value of the Dirac.   */  virtual const vector& getExpectation() const;  /**   * (Don't) get the covariance of the Dirac.   *   * @return \f$\mathbf{\Sigma}\f$; covariance of the Dirac.   */  virtual const symmetric_matrix& getCovariance() const;  virtual const vector& getExpectation();  virtual const symmetric_matrix& getCovariance();  virtual vector sample();  virtual double densityAt(const vector& x);private:  /**   * Serialize, or restore from serialization.   */  template<class Archive>  void serialize(Archive& ar, const unsigned int version);  /*   * Boost.Serialization requirements.   */  friend class boost::serialization::access;};          }  }}#include "boost/serialization/base_object.hpp"template<class Archive>void indii::ml::aux::DiracPdf::serialize(Archive& ar,    const unsigned int version) {  ar & boost::serialization::base_object<indii::ml::aux::vector>(*this);}#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?