Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Files containing the data structures to make the CSDP library work.
[simgrid.git] / include / csdp / declarations.h
1 /*
2   Other important includes that we need.
3  */
4
5 #include "index.h"
6 #include "blockmat.h"
7 #include "parameters.h"
8
9 /*
10   Our own routines.
11   */
12
13 void triu(struct blockmatrix A);
14
15 void store_packed(struct blockmatrix A, struct blockmatrix B);
16
17 void store_unpacked(struct blockmatrix A, struct blockmatrix B);
18
19 void alloc_mat_packed(struct blockmatrix A, struct blockmatrix *pB);
20
21 void free_mat_packed(struct blockmatrix A);
22
23 int structnnz(int n, int k, struct blockmatrix C, struct constraintmatrix *constraints);
24
25 int actnnz(int n, int lda, double *A);
26
27 int bandwidth(int n, int lda, double *A);
28
29 void qreig(int n, double *maindiag, double *offdiag);
30
31 void sort_entries(int k, struct blockmatrix C, struct constraintmatrix *constraints);
32
33 double norm2(int n, double *x);
34
35 double norm1(int n, double *x);
36
37 double norminf(int n, double *x);
38
39 double Fnorm(struct blockmatrix A);
40
41 double Knorm(struct blockmatrix A);
42
43 double mat1norm(struct blockmatrix A);
44
45 double matinfnorm(struct blockmatrix A);
46
47 double calc_pobj(struct blockmatrix C, struct blockmatrix X, 
48                  double constant_offset);
49
50 double calc_dobj(int k, double *a, double *y, double constant_offset);
51
52 double trace_prod(struct blockmatrix A, struct blockmatrix B);
53
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);
59
60 double pinfeas(int k, struct constraintmatrix *constraints,
61                struct blockmatrix X, double *a, double *workvec);
62
63 double dinfeas(int k, struct blockmatrix C, 
64                struct constraintmatrix *constraints, double *y, 
65                struct blockmatrix Z, struct blockmatrix work1);
66
67 double dimacserr3(int k, struct blockmatrix C, 
68                struct constraintmatrix *constraints, double *y, 
69                struct blockmatrix Z, struct blockmatrix work1);
70
71 void op_a(int k, struct constraintmatrix *constraints,
72           struct blockmatrix X, double *result);
73
74 void op_at(int k, double *y, struct constraintmatrix *constraints,
75            struct blockmatrix result);
76
77 void makefill(int k, struct blockmatrix C, 
78               struct constraintmatrix *constraints, 
79               struct constraintmatrix *pfill, struct blockmatrix work1, 
80               int printlevel);
81
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);
86
87 void addscaledmat(struct blockmatrix A, double scale, struct blockmatrix B,
88                   struct blockmatrix C);
89
90 void zero_mat(struct blockmatrix A);
91
92 void add_mat(struct blockmatrix A,struct blockmatrix B);
93
94 void sym_mat(struct blockmatrix A);
95
96 void make_i(struct blockmatrix A);
97
98 void copy_mat(struct blockmatrix A, struct blockmatrix B);
99
100 void mat_mult(double scale1, double scale2, struct blockmatrix A,
101               struct blockmatrix B, struct blockmatrix C);
102
103 void mat_multspa(double scale1, double scale2, struct blockmatrix A,
104                  struct blockmatrix B, struct blockmatrix C, 
105                  struct constraintmatrix fill);
106
107 void mat_multspb(double scale1, double scale2, struct blockmatrix A,
108                  struct blockmatrix B, struct blockmatrix C, 
109                  struct constraintmatrix fill);
110
111 void mat_multspc(double scale1, double scale2, struct blockmatrix A,
112                  struct blockmatrix B, struct blockmatrix C, 
113                  struct constraintmatrix fill);
114
115 void mat_mult_raw(int n, double scale1, double scale2, double *ap,
116                   double *bp, double *cp);
117
118 void matvec(struct blockmatrix A, double *x, double *y);
119
120 void alloc_mat(struct blockmatrix A, struct blockmatrix *pB);
121
122 void free_mat(struct blockmatrix A);
123
124 void initparams(struct paramstruc *params, int *pprintlevel);
125
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);
129
130 void trans(struct blockmatrix A);
131
132 void chol_inv(struct blockmatrix A, struct blockmatrix B);
133
134 int chol(struct blockmatrix A);
135
136 int solvesys(int m, int ldam, double *A, double *rhs);
137
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);
142
143 int read_sol(char *fname, int n, int k, struct blockmatrix C, 
144              struct blockmatrix *pX, double **py, struct blockmatrix *pZ);
145
146 int read_prob(char *fname, int *pn, int *pk, struct blockmatrix *pC,
147               double **pa, struct constraintmatrix **pconstraints,
148               int printlevel);
149
150 int write_prob(char *fname, int n, int k, struct blockmatrix C,
151                double *a, struct constraintmatrix *constraints);
152
153 int write_sol(char *fname, int n, int k, struct blockmatrix X,
154               double *y, struct blockmatrix Z);
155
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);
159
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);
175
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);
180
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);
187
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);
191
192 /*
193   BLAS and LINPACK stuff.
194   */
195
196 /*
197   First, BLAS routines.
198  */
199
200 #ifdef CAPSBLAS
201 #ifdef NOUNDERBLAS
202 double DNRM2();
203 double DASUM();
204 double DDOT();
205 int IDAMAX();
206 void DGEMM();
207 void DGEMV();
208 void DGER();
209 void DTRSM();
210 void DTRMV();
211 #else
212 double DNRM2_();
213 double DASUM_();
214 double DDOT_();
215 int IDAMAX_();
216 void DGEMM_();
217 void DGEMV_();
218 void DGER_();
219 void DTRSM_();
220 void DTRMV_();
221 #endif
222 #else
223 #ifdef NOUNDERBLAS
224 double dnrm2();
225 double dasum();
226 double ddot();
227 int idamax();
228 void dgemm();
229 void dgemv();
230 void dger();
231 void dtrsm();
232 void dtrmv();
233 #else
234 double dnrm2_();
235 double dasum_();
236 double ddot_();
237 int idamax_();
238 void dgemm_();
239 void dgemv_();
240 void dger_();
241 void dtrsm_();
242 void dtrmv_();
243 #endif
244 #endif
245
246 /*
247   LAPACK next.
248  */
249
250 #ifdef CAPSLAPACK
251 #ifdef NOUNDERLAPACK
252 void DPOTRF();
253 void DPOTRS();
254 void DPOTRI();
255 void DTRTRI();
256 #else
257 void DPOTRF_();
258 void DPOTRS_();
259 void DPOTRI_();
260 void DTRTRI_();
261 #endif
262 #else
263 #ifdef NOUNDERLAPACK
264 void dpotrf();
265 void dpotrs();
266 void dpotri();
267 void dtrtri();
268 #else
269 void dpotrf_();
270 void dpotrs_();
271 void dpotri_();
272 void dtrtri_();
273 #endif
274 #endif
275
276