12 #ifndef MLPACK_METHODS_FASTMKS_FASTMKS_STAT_HPP
13 #define MLPACK_METHODS_FASTMKS_FASTMKS_STAT_HPP
45 template<
typename TreeType>
58 (node.NumChildren() > 0) &&
59 (node.Point(0) == node.Child(0).Point(0)))
61 selfKernel = node.Child(0).Stat().SelfKernel();
65 selfKernel = sqrt(node.Metric().Kernel().Evaluate(
66 node.Dataset().col(node.Point(0)),
67 node.Dataset().col(node.Point(0))));
76 selfKernel = sqrt(node.Metric().Kernel().Evaluate(center, center));
86 double Bound()
const {
return bound; }
88 double&
Bound() {
return bound; }
102 template<
typename Archive>
109 if (Archive::is_loading::value)
112 lastKernelNode = NULL;
128 void* lastKernelNode;
double SelfKernel() const
Get the self-kernel.
FirstShim< T > CreateNVP(T &t, const std::string &name, typename boost::enable_if< HasSerialize< T >>::type *=0)
Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function.
FastMKSStat(const TreeType &node)
Initialize this statistic for the given tree node.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double & SelfKernel()
Modify the self-kernel.
void Serialize(Archive &ar, const unsigned int)
Serialize the statistic.
double LastKernel() const
Get the last kernel evaluation.
double Bound() const
Get the bound.
double & LastKernel()
Modify the last kernel evaluation.
double & Bound()
Modify the bound.
void *& LastKernelNode()
Modify the address of the node corresponding to the last distance evaluation.
The TreeTraits class provides compile-time information on the characteristics of a given tree type...
void * LastKernelNode() const
Get the address of the node corresponding to the last distance evaluation.
The statistic used in trees with FastMKS.
FastMKSStat()
Default initialization.