00001 /* 00002 * This program is free software; you can redistribute it and/or modify 00003 * it under the terms of the GNU General Public License as published by 00004 * the Free Software Foundation; either version 3 of the License, or 00005 * (at your option) any later version. 00006 * 00007 * Purpose: solves quadratic programming problem for pattern recognition 00008 * for support vectors 00009 * 00010 * Written (W) 1997-1998 Alex J. Smola 00011 * Written (W) 1999-2008 Soeren Sonnenburg 00012 * Written (W) 1999-2008 Gunnar Raetsch 00013 * Copyright (C) 1997-2008 Fraunhofer Institute FIRST and Max-Planck-Society 00014 */ 00015 00016 00017 /* verbosity levels */ 00018 00019 #define QUIET 0 00020 #define STATUS 1 00021 #define FLOOD 2 00022 00023 /* status outputs */ 00024 00025 #define STILL_RUNNING 0 00026 #define OPTIMAL_SOLUTION 1 00027 #define SUBOPTIMAL_SOLUTION 2 00028 #define ITERATION_LIMIT 3 00029 #define PRIMAL_INFEASIBLE 4 00030 #define DUAL_INFEASIBLE 5 00031 #define PRIMAL_AND_DUAL_INFEASIBLE 6 00032 #define INCONSISTENT 7 00033 #define PRIMAL_UNBOUNDED 8 00034 #define DUAL_UNBOUNDED 9 00035 #define TIME_LIMIT 10 00036 00037 /* 00038 * solve the quadratic programming problem 00039 * 00040 * minimize c' * x + 1/2 x' * H * x 00041 * subject to A*x = b 00042 * l <= x <= u 00043 * 00044 * for a documentation see R. Vanderbei, LOQO: an Interior Point Code 00045 * for Quadratic Programming 00046 */ 00047 00048 /* 00049 * n : number of primal variables 00050 * m : number of constraints (typically 1) 00051 * h_x : dot product matrix (n.n) 00052 * a : constraint matrix (n.m) 00053 * b : constant term (m) 00054 * l : lower bound (n) 00055 * u : upper bound (m) 00056 * 00057 * primal : workspace for primal variables, has to be of size 3 n 00058 * 00059 * x = primal; n 00060 * g = x + n; n 00061 * t = g + n; n 00062 * 00063 * dual : workspace for dual variables, has to be of size m + 2 n 00064 * 00065 * y = dual; m 00066 * z = y + m; n 00067 * s = z + n; n 00068 * 00069 * verb : verbosity level 00070 * sigfig_max : number of significant digits 00071 * counter_max: stopping criterion 00072 * restart : 1 if restart desired 00073 * 00074 */ 00075 00076 int32_t pr_loqo( 00077 int32_t n, int32_t m, float64_t c[], float64_t h_x[], float64_t a[], 00078 float64_t b[], float64_t l[], float64_t u[], float64_t primal[], 00079 float64_t dual[], int32_t verb, float64_t sigfig_max, int32_t counter_max, 00080 float64_t margin, float64_t bound, int32_t restart); 00081 00082 /* 00083 * compile with 00084 cc -O4 -c pr_loqo.c 00085 cc -xO4 -fast -xarch=v8plus -xchip=ultra -xparallel -c pr_loqo.c 00086 mex pr_loqo_c.c pr_loqo.o 00087 cmex4 pr_loqo_c.c pr_loqo.o -DMATLAB4 -o pr_loqo_c4 00088 * 00089 */ 00090 00091 00092 00093