2 Other important includes that we need.
7 #include "parameters.h"
13 void triu(struct blockmatrix A);
15 void store_packed(struct blockmatrix A, struct blockmatrix B);
17 void store_unpacked(struct blockmatrix A, struct blockmatrix B);
19 void alloc_mat_packed(struct blockmatrix A, struct blockmatrix *pB);
21 void free_mat_packed(struct blockmatrix A);
23 int structnnz(int n, int k, struct blockmatrix C, struct constraintmatrix *constraints);
25 int actnnz(int n, int lda, double *A);
27 int bandwidth(int n, int lda, double *A);
29 void qreig(int n, double *maindiag, double *offdiag);
31 void sort_entries(int k, struct blockmatrix C, struct constraintmatrix *constraints);
33 double norm2(int n, double *x);
35 double norm1(int n, double *x);
37 double norminf(int n, double *x);
39 double Fnorm(struct blockmatrix A);
41 double Knorm(struct blockmatrix A);
43 double mat1norm(struct blockmatrix A);
45 double matinfnorm(struct blockmatrix A);
47 double calc_pobj(struct blockmatrix C, struct blockmatrix X,
48 double constant_offset);
50 double calc_dobj(int k, double *a, double *y, double constant_offset);
52 double trace_prod(struct blockmatrix A, struct blockmatrix B);
54 double linesearch(int n, struct blockmatrix dX,
55 struct blockmatrix work1, struct blockmatrix work2,
56 struct blockmatrix work3, struct blockmatrix cholinv,
57 double *q, double *oldq, double *z, double *workvec,
58 double stepfrac,double start, int printlevel);
60 double pinfeas(int k, struct constraintmatrix *constraints,
61 struct blockmatrix X, double *a, double *workvec);
63 double dinfeas(int k, struct blockmatrix C,
64 struct constraintmatrix *constraints, double *y,
65 struct blockmatrix Z, struct blockmatrix work1);
67 double dimacserr3(int k, struct blockmatrix C,
68 struct constraintmatrix *constraints, double *y,
69 struct blockmatrix Z, struct blockmatrix work1);
71 void op_a(int k, struct constraintmatrix *constraints,
72 struct blockmatrix X, double *result);
74 void op_at(int k, double *y, struct constraintmatrix *constraints,
75 struct blockmatrix result);
77 void makefill(int k, struct blockmatrix C,
78 struct constraintmatrix *constraints,
79 struct constraintmatrix *pfill, struct blockmatrix work1,
82 void op_o(int k, struct constraintmatrix *constraints,
83 struct sparseblock **byblocks, struct blockmatrix Zi,
84 struct blockmatrix X, double *O, struct blockmatrix work1,
85 struct blockmatrix work2);
87 void addscaledmat(struct blockmatrix A, double scale, struct blockmatrix B,
88 struct blockmatrix C);
90 void zero_mat(struct blockmatrix A);
92 void add_mat(struct blockmatrix A,struct blockmatrix B);
94 void sym_mat(struct blockmatrix A);
96 void make_i(struct blockmatrix A);
98 void copy_mat(struct blockmatrix A, struct blockmatrix B);
100 void mat_mult(double scale1, double scale2, struct blockmatrix A,
101 struct blockmatrix B, struct blockmatrix C);
103 void mat_multspa(double scale1, double scale2, struct blockmatrix A,
104 struct blockmatrix B, struct blockmatrix C,
105 struct constraintmatrix fill);
107 void mat_multspb(double scale1, double scale2, struct blockmatrix A,
108 struct blockmatrix B, struct blockmatrix C,
109 struct constraintmatrix fill);
111 void mat_multspc(double scale1, double scale2, struct blockmatrix A,
112 struct blockmatrix B, struct blockmatrix C,
113 struct constraintmatrix fill);
115 void mat_mult_raw(int n, double scale1, double scale2, double *ap,
116 double *bp, double *cp);
118 void matvec(struct blockmatrix A, double *x, double *y);
120 void alloc_mat(struct blockmatrix A, struct blockmatrix *pB);
122 void free_mat(struct blockmatrix A);
124 void initparams(struct paramstruc *params, int *pprintlevel);
126 void initsoln(int n, int k, struct blockmatrix C, double *a,
127 struct constraintmatrix *constraints, struct blockmatrix *pX0,
128 double **py0, struct blockmatrix *pZ0);
130 void trans(struct blockmatrix A);
132 void chol_inv(struct blockmatrix A, struct blockmatrix B);
134 int chol(struct blockmatrix A);
136 int solvesys(int m, int ldam, double *A, double *rhs);
138 int user_exit(int n, int k, struct blockmatrix C, double *a, double dobj,
139 double pobj, double constant_offset,
140 struct constraintmatrix *constraints, struct blockmatrix X,
141 double *y, struct blockmatrix Z, struct paramstruc params);
143 int read_sol(char *fname, int n, int k, struct blockmatrix C,
144 struct blockmatrix *pX, double **py, struct blockmatrix *pZ);
146 int read_prob(char *fname, int *pn, int *pk, struct blockmatrix *pC,
147 double **pa, struct constraintmatrix **pconstraints,
150 int write_prob(char *fname, int n, int k, struct blockmatrix C,
151 double *a, struct constraintmatrix *constraints);
153 int write_sol(char *fname, int n, int k, struct blockmatrix X,
154 double *y, struct blockmatrix Z);
156 void free_prob(int n, int k, struct blockmatrix C, double *a,
157 struct constraintmatrix *constraints, struct blockmatrix X,
158 double *y, struct blockmatrix Z);
160 int sdp(int n, int k, struct blockmatrix C, double *a, double constant_offset,
161 struct constraintmatrix *constraints, struct sparseblock **byblocks,
162 struct constraintmatrix fill, struct blockmatrix X, double *y,
163 struct blockmatrix Z, struct blockmatrix cholxinv,
164 struct blockmatrix cholzinv, double *pobj, double *dobj,
165 struct blockmatrix work1, struct blockmatrix work2,
166 struct blockmatrix work3,
167 double *workvec1, double *workvec2,
168 double *workvec3, double *workvec4, double *workvec5,
169 double *workvec6, double *workvec7, double *workvec8,
170 double *diagO, struct blockmatrix bestx, double *besty,
171 struct blockmatrix bestz, struct blockmatrix Zi, double *O,
172 double *rhs, struct blockmatrix dZ, struct blockmatrix dX,
173 double *dy, double *dy1, double *Fp, int nfree, int *freevarblocks,
174 int *freevarin, int printlevel, struct paramstruc parameters);
176 int easy_sdp(int n, int k, struct blockmatrix C, double *a,
177 struct constraintmatrix *constraints, double constant_offset,
178 struct blockmatrix *pX, double **py, struct blockmatrix *pZ,
179 double *ppobj, double *pdobj);
181 void tweakgap(int n, int k, double *a, struct constraintmatrix *constraints,
182 double gap, struct blockmatrix Z, struct blockmatrix dZ,
183 double *y, double *dy, struct blockmatrix work1,
184 struct blockmatrix work2, struct blockmatrix work3,
185 struct blockmatrix work4, double *workvec1, double *workvec2,
186 double *workvec3, double *workvec4, int printlevel);
188 int bisect_(int *n, double *eps1, double *d, double *e, double *e2,
189 double *lb, double *ub, int *mm, int *m, double *w, int *ind,
190 int *ierr, double *rv4, double *rv5);
193 BLAS and LINPACK stuff.
197 First, BLAS routines.