kdtreeleafnode.hpp

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

HPP
100
字号
#ifndef INDII_ML_AUX_KDTREELEAFNODE_HPP#define INDII_ML_AUX_KDTREELEAFNODE_HPP#include "KDTreeNode.hpp"#include "DiracMixturePdf.hpp"namespace indii {  namespace ml {    namespace aux {/** * Leaf node of a KD-tree. * * @author Lawrence Murray <lawrence@indii.org> * @version $Rev: 404 $ * @date $Date: 2008-03-05 14:52:55 +0000 (Wed, 05 Mar 2008) $ * * @param P Degree of the normed vector space (as in \f$\|\cdot\|_p\f$) on * which the tree is defined. * * @section PartitionTreeInternal_serialization Serialization * * This class supports serialization through the Boost.Serialization * library. */class KDTreeLeafNode : public KDTreeNode {public:  /**   * Default constructor.   *   * This should generally only be used when the object is to be   * restored from a serialization.   */  KDTreeLeafNode();  /**   * Constructor.   *   * @param x Sample point.   * @param w Weight.   */  KDTreeLeafNode(const vector& x, const double w);  /**   * Destructor.   */  virtual ~KDTreeLeafNode();  virtual double getWeight();  virtual vector& getLower();  virtual vector& getUpper();  virtual vector nearestTo(const vector& x);  virtual double densityAt(const vector& x, Norm& N, Kernel& K);  virtual vector sample(const double u, Norm& N, Kernel& K);  private:  /**   * The point.   */  vector x;    /**   * The weight.   */  double w;  /**   * 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::KDTreeLeafNode::serialize(Archive& ar,    const unsigned int version) {  ar & boost::serialization::base_object<KDTreeNode>(*this);  ar & x;  ar & w;}#endif

⌨️ 快捷键说明

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