00001 #ifndef _theplu_yat_classifier_sv_index_
00002 #define _theplu_yat_classifier_sv_index_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <vector>
00026
00027 namespace theplu {
00028 namespace yat {
00029
00030 namespace utility {
00031 class Vector;
00032 }
00033
00034 namespace classifier {
00035
00043 class SVindex
00044 {
00045
00046 public:
00048 SVindex();
00049
00051 SVindex(const size_t);
00052
00054 size_t index_first(void) const;
00055
00057 size_t index_second(void) const;
00058
00060 void init(const utility::Vector& alpha, const double);
00061
00063 size_t nof_sv(void) const;
00064
00066 void nsv_first(void);
00067
00069 void nsv_second(void);
00070
00073 void shuffle(void);
00074
00076 size_t size(void) const;
00077
00079 void sv_first(void);
00080
00082 void sv_second(void);
00083
00085 void update_first(const size_t i);
00086
00088 void update_second(const size_t i);
00089
00091 size_t value_first(void) const;
00092
00094 size_t value_second(void) const;
00095
00097 size_t operator()(size_t i) const;
00098
00099 private:
00100 size_t index_first_;
00101 size_t index_second_;
00102 size_t nof_sv_;
00103 std::vector<size_t> vec_;
00104 size_t value_first_;
00105 size_t value_second_;
00106
00107 };
00108
00109 }}}
00110
00111 #endif