00001 #ifndef INDII_ML_AUX_PARTITIONFUNCTOR_HPP
00002 #define INDII_ML_AUX_PARTITIONFUNCTOR_HPP
00003
00004 #include "DiracMixturePdf.hpp"
00005
00006 namespace indii {
00007 namespace ml {
00008 namespace aux {
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 class PartitionFunctor {
00019 public:
00020
00021
00022
00023
00024
00025
00026
00027 PartitionFunctor(const DiracMixturePdf& p, const unsigned int index,
00028 const double value);
00029
00030
00031
00032
00033 virtual ~PartitionFunctor();
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043 bool operator()(const unsigned int i);
00044
00045 private:
00046
00047
00048
00049 const DiracMixturePdf& p;
00050
00051
00052
00053
00054 const unsigned int index;
00055
00056
00057
00058
00059 const double value;
00060
00061 };
00062
00063 }
00064 }
00065 }
00066
00067 inline bool indii::ml::aux::PartitionFunctor::operator()(
00068 const unsigned int i) {
00069 return p.get(i)[index] < value;
00070 }
00071
00072 #endif
00073