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 "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) 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
00038 typedef struct {
00039 uint32_t nIter;
00040 float64_t QP;
00041 float64_t QD;
00042 int8_t exitflag;
00043
00044
00045
00046
00047
00048 } libqp_state_T;
00049
00050
00051 libqp_state_T libqp_splx_solver(const float64_t* (*get_col)(uint32_t),
00052 float64_t *diag_H,
00053 float64_t *f,
00054 float64_t *b,
00055 uint32_t *I,
00056 uint8_t *S,
00057 float64_t *x,
00058 uint32_t n,
00059 uint32_t MaxIter,
00060 float64_t TolAbs,
00061 float64_t TolRel,
00062 float64_t QP_TH,
00063 void (*print_state)(libqp_state_T state));
00064
00065
00066 libqp_state_T libqp_gsmo_solver(const float64_t* (*get_col)(uint32_t),
00067 float64_t *diag_H,
00068 float64_t *f,
00069 float64_t *a,
00070 float64_t b,
00071 float64_t *LB,
00072 float64_t *UB,
00073 float64_t *x,
00074 uint32_t n,
00075 uint32_t MaxIter,
00076 float64_t TolKKT,
00077 void (*print_state)(libqp_state_T state));
00078
00079 }
00080 #endif