-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathpr_loqo.h
93 lines (82 loc) · 2.33 KB
/
pr_loqo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
* File: pr_loqo.h
* Purpose: solves quadratic programming problem for pattern recognition
* for support vectors
*
* Author: Alex J. Smola
* Created: 10/14/97
* Updated: 11/08/97
*
*
* Copyright (c) 1997 GMD Berlin - All rights reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE of GMD Berlin
* The copyright notice above does not evidence any
* actual or intended publication of this work.
*
* Unauthorized commercial use of this software is not allowed
*/
/* verbosity levels */
#define QUIET 0
#define STATUS 1
#define FLOOD 2
/* status outputs */
#define STILL_RUNNING 0
#define OPTIMAL_SOLUTION 1
#define SUBOPTIMAL_SOLUTION 2
#define ITERATION_LIMIT 3
#define PRIMAL_INFEASIBLE 4
#define DUAL_INFEASIBLE 5
#define PRIMAL_AND_DUAL_INFEASIBLE 6
#define INCONSISTENT 7
#define PRIMAL_UNBOUNDED 8
#define DUAL_UNBOUNDED 9
#define TIME_LIMIT 10
/*
* solve the quadratic programming problem
*
* minimize c' * x + 1/2 x' * H * x
* subject to A*x = b
* l <= x <= u
*
* for a documentation see R. Vanderbei, LOQO: an Interior Point Code
* for Quadratic Programming
*/
/*
* n : number of primal variables
* m : number of constraints (typically 1)
* h_x : dot product matrix (n.n)
* a : constraint matrix (n.m)
* b : constant term (m)
* l : lower bound (n)
* u : upper bound (m)
*
* primal : workspace for primal variables, has to be of size 3 n
*
* x = primal; n
* g = x + n; n
* t = g + n; n
*
* dual : workspace for dual variables, has to be of size m + 2 n
*
* y = dual; m
* z = y + m; n
* s = z + n; n
*
* verb : verbosity level
* sigfig_max : number of significant digits
* counter_max: stopping criterion
* restart : 1 if restart desired
*
*/
int pr_loqo(int n, int m, double c[], double h_x[], double a[], double b[],
double l[], double u[], double primal[], double dual[],
int verb, double sigfig_max, int counter_max,
double margin, double bound, int restart);
/*
* compile with
cc -O4 -c pr_loqo.c
cc -xO4 -fast -xarch=v8plus -xchip=ultra -xparallel -c pr_loqo.c
mex pr_loqo_c.c pr_loqo.o
cmex4 pr_loqo_c.c pr_loqo.o -DMATLAB4 -o pr_loqo_c4
*
*/