Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
socp.h
1 /*
2  * socp.h
3  *
4  * Second-Order Cone Programming
5  * Header file for socp.c
6  *
7  * See also README.txt
8  *
9  * mlobo@isl.stanford.edu -- 96/97
10  */
11 
12 /* basic macros */
13 
14 #define SQR(x) ((x)*(x))
15 #define MAX(x,y) ((x) > (y) ? (x) : (y))
16 #define MIN(x,y) ((x) < (y) ? (x) : (y))
17 
18 /* constants for socp algorithm */
19 
20 #define MAX_ITER_PLANE 20
21 #define MAX_LAMBDA2 1e-2 /* plane search stopping crit. */
22 #define DIV_ALPHA 2
23 #define MIN_ALPHA 1e-6 /* max. of about 20 line search iterations */
24 
25 /* #define NOUNDERSCORES */
26 #ifdef NOUNDERSCORES
27 #define ddot_ ddot
28 #define dcopy_ dcopy
29 #define daxpy_ daxpy
30 #define dscal_ dscal
31 #define dgemv_ dgemv
32 #define dsyr_ dsyr
33 #define dsyrk_ dsyrk
34 #define dposvx_ dposvx
35 #define dgelss_ dgelss
36 #endif
37 
38 /* BLAS 1 */
39 double ddot_();
40 void dcopy_();
41 void daxpy_();
42 void dscal_();
43 
44 /* BLAS 2 */
45 void dgemv_();
46 void dsyr_();
47 
48 /* BLAS 3 */
49 void dsyrk_();
50 
51 /* LAPACK */
52 void dposvx_();
53 void dgelss_();
54 
55 /* socp.c */
56 
57 void socp_getwork(
58  /* input args.: problem dimensions and max. num. of iterations */
59  int L,
60  int *N,
61  int n,
62  int max_iter,
63  int out_mode,
64  /* output args.: dimensions of history output matrix, number of */
65  /* doubles, pointers and ints required for workspace */
66  int *mhist,
67  int *nhist,
68  int *ndbl,
69  int *nint
70 );
71 
72 int socp(
73  /* problem dimensions */
74  int L,
75  int *N,
76  int n,
77  /* problem data */
78  double *f,
79  double *A,
80  double *b,
81  /* in: initial primal and dual strictly feasible points */
82  /* out: final points */
83  double *x,
84  double *z,
85  /* stopping criteria, *iter on entry is max. number of iterations, */
86  /* on exit actual number performed */
87  double abs_tol,
88  double rel_tol,
89  double target,
90  int *iter,
91  /* algorithm parameter */
92  double Nu,
93  /* reason for exit, output matrix with extra info */
94  /* out_mode specifies what will be stored in *hist */
95  int *info,
96  int out_mode,
97  double *hist,
98  /* workspace, use socp_getwork() to determine required sizes */
99  double *dblwork,
100  int *intwork
101 );