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 #ifndef libqp_h
00022 #define libqp_h
00023
00024 #include <math.h>
00025
00026 #include <shogun/lib/common.h>
00027 namespace shogun
00028 {
00029 #define LIBQP_PLUS_INF (-log(0.0))
00030 #define LIBQP_CALLOC(x,y) calloc(x,y)
00031 #define LIBQP_FREE(x) SG_FREE(x)
00032 #define LIBQP_INDEX(ROW,COL,NUM_ROWS) ((COL)*(NUM_ROWS)+(ROW))
00033 #define LIBQP_MIN(A,B) ((A) > (B) ? (B) : (A))
00034 #define LIBQP_MAX(A,B) ((A) < (B) ? (B) : (A))
00035 #define LIBQP_ABS(A) ((A) < 0 ? -(A) : (A))
00036
00037 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00038
00039 typedef struct {
00041 uint32_t nIter;
00043 float64_t QP;
00045 float64_t QD;
00047 int8_t exitflag;
00048
00049
00050
00051
00052
00053 } libqp_state_T;
00054 #endif
00055
00057 libqp_state_T libqp_splx_solver(const float64_t* (*get_col)(uint32_t),
00058 float64_t *diag_H,
00059 float64_t *f,
00060 float64_t *b,
00061 uint32_t *I,
00062 uint8_t *S,
00063 float64_t *x,
00064 uint32_t n,
00065 uint32_t MaxIter,
00066 float64_t TolAbs,
00067 float64_t TolRel,
00068 float64_t QP_TH,
00069 void (*print_state)(libqp_state_T state));
00070
00072 libqp_state_T libqp_gsmo_solver(const float64_t* (*get_col)(uint32_t),
00073 float64_t *diag_H,
00074 float64_t *f,
00075 float64_t *a,
00076 float64_t b,
00077 float64_t *LB,
00078 float64_t *UB,
00079 float64_t *x,
00080 uint32_t n,
00081 uint32_t MaxIter,
00082 float64_t TolKKT,
00083 void (*print_state)(libqp_state_T state));
00084
00085 }
00086 #endif