浏览该文件的文档。00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "base/SGObject.h"
00030
00031 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00032 namespace shogun
00033 {
00035 class QPproblem : public CSGObject
00036 {
00037
00038 public:
00040 int32_t chunk_size;
00042 int32_t ell;
00044 int32_t *y;
00046 float64_t DELTAsv;
00048 int32_t q;
00050 int32_t maxmw;
00052 float64_t c_const;
00054 float64_t bee;
00056 float64_t delta;
00058 bool linadd;
00059
00061 sKernel* KER;
00063 int32_t ker_type;
00065 int32_t projection_solver;
00067 int32_t projection_projector;
00069 int32_t PreprocessMode;
00071 int32_t preprocess_size;
00073 int32_t verbosity;
00075 float64_t tau_proximal;
00077 float64_t objective_value;
00078
00079
00081 QPproblem ();
00082 ~QPproblem();
00083
00089 int32_t ReadSVMFile (char *fInput);
00090
00096 int32_t ReadGPDTBinary(char *fName);
00097
00102 int32_t Check2Class (void);
00103
00110 void Subproblem (QPproblem &ker, int32_t len, int32_t *perm);
00111
00113 void PrepMP (void);
00114
00120 float64_t gpdtsolve (float64_t *solution);
00121
00127 float64_t pgpdtsolve (float64_t *solution);
00128
00133 inline bool get_linadd_enabled()
00134 {
00135 return linadd;
00136 }
00137
00139 inline virtual const char* get_name() const { return "QProblem"; }
00140
00141
00142 private:
00143 int32_t dim;
00144 int32_t *index_in, *index_out;
00145 int32_t *ing, *inaux, *inold, *incom;
00146 int32_t *cec;
00147 int32_t nb;
00148 int32_t *bmem, *bmemrid, *pbmr;
00149 int32_t my_chunk_size;
00150 int32_t my_spD_offset;
00151 int32_t recvl[32], displ[32];
00152 float64_t kktold;
00153 float64_t DELTAvpm, InitialDELTAvpm, DELTAkin;
00154 float64_t *alpha;
00155 float64_t *grad, *st;
00156
00157
00158 private:
00159 int32_t Preprocess0 (int32_t *aux, int32_t *sv);
00160 int32_t Preprocess1 (sKernel* KER, int32_t *aux, int32_t *sv);
00161 int32_t optimal (void);
00162
00163 bool is_zero(int32_t i) { return (alpha[i] < DELTAsv); }
00164 bool is_free(int32_t i)
00165 { return (alpha[i] > DELTAsv && alpha[i] < (c_const - DELTAsv)); }
00166 bool is_bound(int32_t i) { return (alpha[i] > (c_const - DELTAsv)); }
00167
00168 };
00169 }
00170 #endif // DOXYGEN_SHOULD_SKIP_THIS