00001 #ifndef INDII_ML_AUX_KDTREELEAFNODE_HPP
00002 #define INDII_ML_AUX_KDTREELEAFNODE_HPP
00003
00004 #include "KDTreeNode.hpp"
00005 #include "DiracMixturePdf.hpp"
00006
00007 namespace indii {
00008 namespace ml {
00009 namespace aux {
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 class KDTreeLeafNode : public KDTreeNode {
00026 public:
00027
00028
00029
00030
00031
00032
00033 KDTreeLeafNode();
00034
00035
00036
00037
00038
00039
00040
00041 KDTreeLeafNode(const vector& x, const double w);
00042
00043
00044
00045
00046 virtual ~KDTreeLeafNode();
00047
00048 virtual double getWeight();
00049
00050 virtual vector& getLower();
00051
00052 virtual vector& getUpper();
00053
00054 virtual vector nearestTo(const vector& x);
00055
00056 virtual double densityAt(const vector& x, Norm& N, Kernel& K);
00057
00058 virtual vector sample(const double u, Norm& N, Kernel& K);
00059
00060 private:
00061
00062
00063
00064 vector x;
00065
00066
00067
00068
00069 double w;
00070
00071
00072
00073
00074 template<class Archive>
00075 void serialize(Archive& ar, const unsigned int version);
00076
00077
00078
00079
00080 friend class boost::serialization::access;
00081
00082 };
00083
00084 }
00085 }
00086 }
00087
00088 #include "boost/serialization/base_object.hpp"
00089
00090 template<class Archive>
00091 void indii::ml::aux::KDTreeLeafNode::serialize(Archive& ar,
00092 const unsigned int version) {
00093 ar & boost::serialization::base_object<KDTreeNode>(*this);
00094 ar & x;
00095 ar & w;
00096 }
00097
00098 #endif
00099