gpdtsolve.h
Go to the documentation of this file.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
00032 class QPproblem : public CSGObject
00033 {
00034
00035 public:
00037 int32_t chunk_size;
00039 int32_t ell;
00041 int32_t *y;
00043 float64_t DELTAsv;
00045 int32_t q;
00047 int32_t maxmw;
00049 float64_t c_const;
00051 float64_t bee;
00053 float64_t delta;
00055 bool linadd;
00056
00058 sKernel* KER;
00060 int32_t ker_type;
00062 int32_t projection_solver;
00064 int32_t projection_projector;
00066 int32_t PreprocessMode;
00068 int32_t preprocess_size;
00070 int32_t verbosity;
00072 float64_t tau_proximal;
00074 float64_t objective_value;
00075
00076
00078 QPproblem ();
00079 ~QPproblem();
00080
00086 int32_t ReadSVMFile (char *fInput);
00087
00093 int32_t ReadGPDTBinary(char *fName);
00094
00099 int32_t Check2Class (void);
00100
00107 void Subproblem (QPproblem &ker, int32_t len, int32_t *perm);
00108
00110 void PrepMP (void);
00111
00117 float64_t gpdtsolve (float64_t *solution);
00118
00124 float64_t pgpdtsolve (float64_t *solution);
00125
00130 inline bool get_linadd_enabled()
00131 {
00132 return linadd;
00133 }
00134
00135
00136 private:
00137 int32_t dim;
00138 int32_t *index_in, *index_out;
00139 int32_t *ing, *inaux, *inold, *incom;
00140 int32_t *cec;
00141 int32_t nb;
00142 int32_t *bmem, *bmemrid, *pbmr;
00143 int32_t my_chunk_size;
00144 int32_t my_spD_offset;
00145 int32_t recvl[32], displ[32];
00146 float64_t kktold;
00147 float64_t DELTAvpm, InitialDELTAvpm, DELTAkin;
00148 float64_t *alpha;
00149 float64_t *grad, *st;
00150
00151
00152 private:
00153 int32_t Preprocess0 (int32_t *aux, int32_t *sv);
00154 int32_t Preprocess1 (sKernel* KER, int32_t *aux, int32_t *sv);
00155 int32_t optimal (void);
00156
00157 bool is_zero(int32_t i) { return (alpha[i] < DELTAsv); }
00158 bool is_free(int32_t i)
00159 { return (alpha[i] > DELTAsv && alpha[i] < (c_const - DELTAsv)); }
00160 bool is_bound(int32_t i) { return (alpha[i] > (c_const - DELTAsv)); }
00161
00162 };