2 This file is part of the CSDP 5.0 package developed by Dr. Brian Borchers.
3 Which can be distributed under the LGPL licence. The source code and
4 manual can be downloaded at http://euler.nmt.edu/~brian/csdp.html.
6 Other important includes that we need.
11 #include "parameters.h"
17 void triu(struct blockmatrix A);
19 void store_packed(struct blockmatrix A, struct blockmatrix B);
21 void store_unpacked(struct blockmatrix A, struct blockmatrix B);
23 void alloc_mat_packed(struct blockmatrix A, struct blockmatrix *pB);
25 void free_mat_packed(struct blockmatrix A);
27 int structnnz(int n, int k, struct blockmatrix C, struct constraintmatrix *constraints);
29 int actnnz(int n, int lda, double *A);
31 int bandwidth(int n, int lda, double *A);
33 void qreig(int n, double *maindiag, double *offdiag);
35 void sort_entries(int k, struct blockmatrix C, struct constraintmatrix *constraints);
37 double norm2(int n, double *x);
39 double norm1(int n, double *x);
41 double norminf(int n, double *x);
43 double Fnorm(struct blockmatrix A);
45 double Knorm(struct blockmatrix A);
47 double mat1norm(struct blockmatrix A);
49 double matinfnorm(struct blockmatrix A);
51 double calc_pobj(struct blockmatrix C, struct blockmatrix X,
52 double constant_offset);
54 double calc_dobj(int k, double *a, double *y, double constant_offset);
56 double trace_prod(struct blockmatrix A, struct blockmatrix B);
58 double linesearch(int n, struct blockmatrix dX,
59 struct blockmatrix work1, struct blockmatrix work2,
60 struct blockmatrix work3, struct blockmatrix cholinv,
61 double *q, double *oldq, double *z, double *workvec,
62 double stepfrac,double start, int printlevel);
64 double pinfeas(int k, struct constraintmatrix *constraints,
65 struct blockmatrix X, double *a, double *workvec);
67 double dinfeas(int k, struct blockmatrix C,
68 struct constraintmatrix *constraints, double *y,
69 struct blockmatrix Z, struct blockmatrix work1);
71 double dimacserr3(int k, struct blockmatrix C,
72 struct constraintmatrix *constraints, double *y,
73 struct blockmatrix Z, struct blockmatrix work1);
75 void op_a(int k, struct constraintmatrix *constraints,
76 struct blockmatrix X, double *result);
78 void op_at(int k, double *y, struct constraintmatrix *constraints,
79 struct blockmatrix result);
81 void makefill(int k, struct blockmatrix C,
82 struct constraintmatrix *constraints,
83 struct constraintmatrix *pfill, struct blockmatrix work1,
86 void op_o(int k, struct constraintmatrix *constraints,
87 struct sparseblock **byblocks, struct blockmatrix Zi,
88 struct blockmatrix X, double *O, struct blockmatrix work1,
89 struct blockmatrix work2);
91 void addscaledmat(struct blockmatrix A, double scale, struct blockmatrix B,
92 struct blockmatrix C);
94 void zero_mat(struct blockmatrix A);
96 void add_mat(struct blockmatrix A,struct blockmatrix B);
98 void sym_mat(struct blockmatrix A);
100 void make_i(struct blockmatrix A);
102 void copy_mat(struct blockmatrix A, struct blockmatrix B);
104 void mat_mult(double scale1, double scale2, struct blockmatrix A,
105 struct blockmatrix B, struct blockmatrix C);
107 void mat_multspa(double scale1, double scale2, struct blockmatrix A,
108 struct blockmatrix B, struct blockmatrix C,
109 struct constraintmatrix fill);
111 void mat_multspb(double scale1, double scale2, struct blockmatrix A,
112 struct blockmatrix B, struct blockmatrix C,
113 struct constraintmatrix fill);
115 void mat_multspc(double scale1, double scale2, struct blockmatrix A,
116 struct blockmatrix B, struct blockmatrix C,
117 struct constraintmatrix fill);
119 void mat_mult_raw(int n, double scale1, double scale2, double *ap,
120 double *bp, double *cp);
122 void matvec(struct blockmatrix A, double *x, double *y);
124 void alloc_mat(struct blockmatrix A, struct blockmatrix *pB);
126 void free_mat(struct blockmatrix A);
128 void initparams(struct paramstruc *params, int *pprintlevel);
130 void initsoln(int n, int k, struct blockmatrix C, double *a,
131 struct constraintmatrix *constraints, struct blockmatrix *pX0,
132 double **py0, struct blockmatrix *pZ0);
134 void trans(struct blockmatrix A);
136 void chol_inv(struct blockmatrix A, struct blockmatrix B);
138 int chol(struct blockmatrix A);
140 int solvesys(int m, int ldam, double *A, double *rhs);
142 int user_exit(int n, int k, struct blockmatrix C, double *a, double dobj,
143 double pobj, double constant_offset,
144 struct constraintmatrix *constraints, struct blockmatrix X,
145 double *y, struct blockmatrix Z, struct paramstruc params);
147 int read_sol(char *fname, int n, int k, struct blockmatrix C,
148 struct blockmatrix *pX, double **py, struct blockmatrix *pZ);
150 int read_prob(char *fname, int *pn, int *pk, struct blockmatrix *pC,
151 double **pa, struct constraintmatrix **pconstraints,
154 int write_prob(char *fname, int n, int k, struct blockmatrix C,
155 double *a, struct constraintmatrix *constraints);
157 int write_sol(char *fname, int n, int k, struct blockmatrix X,
158 double *y, struct blockmatrix Z);
160 void free_prob(int n, int k, struct blockmatrix C, double *a,
161 struct constraintmatrix *constraints, struct blockmatrix X,
162 double *y, struct blockmatrix Z);
164 int sdp(int n, int k, struct blockmatrix C, double *a, double constant_offset,
165 struct constraintmatrix *constraints, struct sparseblock **byblocks,
166 struct constraintmatrix fill, struct blockmatrix X, double *y,
167 struct blockmatrix Z, struct blockmatrix cholxinv,
168 struct blockmatrix cholzinv, double *pobj, double *dobj,
169 struct blockmatrix work1, struct blockmatrix work2,
170 struct blockmatrix work3,
171 double *workvec1, double *workvec2,
172 double *workvec3, double *workvec4, double *workvec5,
173 double *workvec6, double *workvec7, double *workvec8,
174 double *diagO, struct blockmatrix bestx, double *besty,
175 struct blockmatrix bestz, struct blockmatrix Zi, double *O,
176 double *rhs, struct blockmatrix dZ, struct blockmatrix dX,
177 double *dy, double *dy1, double *Fp, int nfree, int *freevarblocks,
178 int *freevarin, int printlevel, struct paramstruc parameters);
180 int easy_sdp(int n, int k, struct blockmatrix C, double *a,
181 struct constraintmatrix *constraints, double constant_offset,
182 struct blockmatrix *pX, double **py, struct blockmatrix *pZ,
183 double *ppobj, double *pdobj);
185 void tweakgap(int n, int k, double *a, struct constraintmatrix *constraints,
186 double gap, struct blockmatrix Z, struct blockmatrix dZ,
187 double *y, double *dy, struct blockmatrix work1,
188 struct blockmatrix work2, struct blockmatrix work3,
189 struct blockmatrix work4, double *workvec1, double *workvec2,
190 double *workvec3, double *workvec4, int printlevel);
192 int bisect_(int *n, double *eps1, double *d, double *e, double *e2,
193 double *lb, double *ub, int *mm, int *m, double *w, int *ind,
194 int *ierr, double *rv4, double *rv5);
197 BLAS and LINPACK stuff.
201 First, BLAS routines.