Merge release-5-0 into master
[alexxy/gromacs.git] / src / gromacs / linearalgebra / gmx_lapack.h
1 /*
2  * This file is part of the GROMACS molecular simulation package.
3  *
4  * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
5  * Copyright (c) 2001-2008, The GROMACS development team.
6  * Copyright (c) 2012,2013,2014, by the GROMACS development team, led by
7  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
8  * and including many others, as listed in the AUTHORS file in the
9  * top-level source directory and at http://www.gromacs.org.
10  *
11  * GROMACS is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU Lesser General Public License
13  * as published by the Free Software Foundation; either version 2.1
14  * of the License, or (at your option) any later version.
15  *
16  * GROMACS is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19  * Lesser General Public License for more details.
20  *
21  * You should have received a copy of the GNU Lesser General Public
22  * License along with GROMACS; if not, see
23  * http://www.gnu.org/licenses, or write to the Free Software Foundation,
24  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
25  *
26  * If you want to redistribute modifications to GROMACS, please
27  * consider that scientific software is very special. Version
28  * control is crucial - bugs must be traceable. We will be happy to
29  * consider code for inclusion in the official distribution, but
30  * derived work must not be called official GROMACS. Details are found
31  * in the README & COPYING files - if they are missing, get the
32  * official version at http://www.gromacs.org.
33  *
34  * To help us fund GROMACS development, we humbly ask that you cite
35  * the research papers on the package. Check out http://www.gromacs.org.
36  */
37 /*! \internal \file
38  * \brief
39  * Header definitions for the standard LAPACK library.
40  *
41  * This is the subset of LAPACK routines used for the
42  * linear algebra operations in Gromacs. Most of the execution time
43  * will be spent in the BLAS routines, which you hopefully have an
44  * optimized version of. Gromacs includes reference implementations
45  * of both BLAS and LAPACK so it compiles everywhere, but you should
46  * really try to find a vendor or otherwise optimized version at least
47  * of BLAS for better performance.
48  *
49  * Do NOT use this code for other purposes - we only provide this as a
50  * simple fallback/reference implementation when no optimized BLAS
51  * is present. If you need an implementation for your own code
52  * there are several much faster versions out there.
53  *
54  * All routines are compatible with the LAPACK/BLAS reference implementations,
55  * meaning they assume fortran-style matrix row/column organization.
56  *
57  * There is plenty of documentation for these routines available
58  * at http://www.netlib.org/lapack , so there is no point in repeating
59  * it here.
60  */
61 #ifndef GMX_LAPACK_H
62 #define GMX_LAPACK_H
63
64 /*! \cond */
65
66 #include "config.h"
67
68 /* These are not required by this file, but by the internal LAPACK
69  * implementation.  In principle, they could be included in each file
70  * that requires them, but this is simpler.  Since the header is internal
71  * to the linearyalgebra/ module, the added complexity may not be worth it. */
72 #include "gromacs/utility/basedefinitions.h"
73 #include "gromacs/utility/real.h"
74
75 #ifdef __cplusplus
76 extern "C" {
77 #endif
78 #if 0
79 }
80 #endif
81 /* Double precision */
82
83 void
84     F77_FUNC(dbdsdc, DBDSDC) (const char *uplo, const char *compq, int *n, double *d, double *e, double *u,
85                               int *ldu, double *vt, int *ldvt, double *q, int *iq, double *work,
86                               int *iwork, int *info);
87
88 void
89     F77_FUNC(dgetf2, DGETF2) (int *m, int *n, double *a, int *lda, int *ipiv, int *info);
90
91 void
92     F77_FUNC(dlamrg, DLAMRG) (int *n1, int *n2, double *a, int *dtrd1, int *dtrd2, int *index);
93
94 void
95     F77_FUNC(dlarnv, DLARNV) (int *idist, int *iseed, int *n, double *x);
96
97 void
98     F77_FUNC(dlasd0, DLASD0) (int *n, int *sqre, double *d, double *e, double *u,
99                               int *ldu, double *vt, int *ldvt, int *smlsiz, int *iwork,
100                               double *work, int *info);
101
102 void
103     F77_FUNC(dlasda, DLASDA) (int *icompq, int *smlsiz, int *n, int *sqre, double *d, double *e,
104                               double *u, int *ldu, double *vt, int *k, double *difl, double *difr,
105                               double *z, double *poles, int *givptr, int *givcol, int *ldgcol,
106                               int *perm, double *givnum, double *c, double *s,
107                               double *work, int *iwork, int *info);
108
109 void
110     F77_FUNC(dlasq6, DLASQ6) (int *i0, int *n0, double *z, int *pp, double *dmin, double *dmin1,
111                               double *dmin2, double *dn, double *dnm1, double *dnm2);
112
113 void
114     F77_FUNC(dorgl2, DORGL2) (int *m, int *n, int *k, double *a, int *lda,
115                               double *tau, double *work, int *info);
116
117 void
118     F77_FUNC(dbdsqr, DBDSQR) (const char *uplo, int *n, int *ncvt, int *nru, int *ncc, double *d,
119                               double *e, double *vt, int *ldvt, double *u, int *ldu,
120                               double *c, int *ldc, double *work, int *info);
121
122 void
123     F77_FUNC(dgetrf, DGETRF) (int *m, int *n, double *a, int *lda, int *ipiv, int *info);
124
125 void
126     F77_FUNC(dgetri, DGETRI) (int *n, double *a, int *lda, int *ipiv, double *work,
127                               int *lwork, int *info);
128
129 void
130     F77_FUNC(dgetrs, DGETRS) (const char *trans, int *n, int *nrhs,   double *a, int *lda, int *ipiv,
131                               double *b, int *ldb, int *info);
132
133 void
134     F77_FUNC(dtrtri, DTRTRI) (const char *uplo, const char *diag, int *n, double *a, int *lda, int *info);
135
136 void
137     F77_FUNC(dtrti2, DTRTI2) (const char *uplo, const char *diag, int *n, double *a, int *lda, int *info);
138
139 double
140     F77_FUNC(dlange, DLANGE) (const char *norm, int *m, int *n, double *a, int *lda, double *work);
141
142 void
143     F77_FUNC(dlarrbx, DLARRBX) (int *n, double *d, double *l, double *ld, double *lld, int *ifirst,
144                                 int *ilast, double *rtol1, double *rtol2, int *offset, double *w,
145                                 double *wgap, double *werr, double *work, int *iwork, int *info);
146
147 void
148     F77_FUNC(dlasd1, DLASD1) (int *nl, int *nr, int *sqre, double *d, double *alpha, double *beta,
149                               double *u, int *ldu, double *vt, int *ldvt, int *idxq, int *iwork,
150                               double *work, int *info);
151
152 void
153     F77_FUNC(dlasdq, DLASDQ) (const char *uplo, int *sqre, int *n, int *ncvt, int *nru, int *ncc,
154                               double *d, double *e, double *vt, int *ldvt, double *u, int *ldu,
155                               double *c, int *ldc, double *work, int *info);
156
157 void
158     F77_FUNC(dlasr, DLASR) (const char *side, const char *pivot, const char *direct, int *m, int *n, double *c,
159                             double *s, double *a, int *lda);
160
161 void
162     F77_FUNC(dorglq, DORGLQ) (int *m, int *n, int *k, double *a, int *lda,
163                               double *tau, double *work, int *lwork, int *info);
164
165 void
166     F77_FUNC(dormtr, DORMTR) (const char *side, const char *uplo, const char *trans, int *m, int *n, double *a,
167                               int *lda, double *tau, double *c, int *ldc,
168                               double *work, int *lwork, int *info);
169
170 void
171     F77_FUNC(dgebd2, DGEBD2) (int *m, int *n, double *a, int *lda, double *d, double *e,
172                               double *tauq, double *taup, double *work, int *info);
173
174 void
175     F77_FUNC(dlabrd, DLABRD) (int *m, int *n, int *nb, double *a, int *lda, double *d,
176                               double *e, double *tauq, double *taup, double *x,
177                               int *ldx, double *y, int *ldy);
178
179 double
180     F77_FUNC(dlanst, DLANST) (const char *norm, int *n, double *d, double *e);
181
182 double
183     F77_FUNC(dlansy, DLANSY) (const char *norm, const char *uplo, int *n, double *a, int *lda, double *work);
184
185 void
186     F77_FUNC(dlarrex, DLARREX) (const char *range, int *n, double *vl, double *vu, int *il, int *iu,
187                                 double *d, double *e, double *tol, int *nsplit,
188                                 int *isplit, int *m, double *w, int *iblock, int *indexw,
189                                 double *gersch, double *work, int *iwork, int *info);
190
191 void
192     F77_FUNC(dlasd2, DLASD2) (int *nl, int *nr, int *sqre, int *k, double *d, double *z,
193                               double *alpha, double *beta, double *u, int *ldu, double *vt,
194                               int *ldvt, double *dsigma, double *u2, int *ldu2, double *vt2,
195                               int *ldvt2, int *idxp, int *idx, int *idxc,
196                               int *idxq, int *coltyp, int *info);
197
198 void
199     F77_FUNC(dlasdt, DLASDT) (int *n, int *lvl, int *nd, int *inode, int *ndiml,
200                               int *ndimr, int *msub);
201
202 void
203     F77_FUNC(dlasrt, DLASRT) (const char *id, int *n, double *d, int *info);
204
205 void
206     F77_FUNC(dlasrt2, DLASRT2) (const char *id, int *n, double *d, int *key, int *info);
207
208 void
209     F77_FUNC(ilasrt2, ILASRT2) (const char *id, int *n, int *d, int *key, int *info);
210
211 void
212     F77_FUNC(dorgqr, DORGQR) (int *m, int *n, int *k, double *a, int *lda, double *tau,
213                               double *work, int *lwork, int *info);
214
215 void
216     F77_FUNC(dstebz, DSTEBZ) (const char *range, const char *order, int *n, double *vl, double *vu,
217                               int *il, int *iu, double *abstol, double *d, double *e,
218                               int *m, int *nsplit, double *w, int *iblock, int *isplit,
219                               double *work, int *iwork, int *info);
220
221 void
222     F77_FUNC(dsteqr, DSTEQR) (const char *compz, int *n, double *d__, double *e,
223                               double *z__,  int *ldz, double *work, int *info);
224
225 void
226     F77_FUNC(dgebrd, DGEBRD) (int *m, int *n, double *a, int *lda, double *d, double *e,
227                               double *tauq, double *taup, double *work, int *lwork, int *info);
228
229 void
230     F77_FUNC(dlacpy, DLACPY) (const char *uplo, int *m, int *n, double *a, int *lda, double *b, int *ldb);
231
232 double
233     F77_FUNC(dlapy2, DLAPY2) (double * x, double * y);
234
235
236 void
237     F77_FUNC(dlarrfx, DLARRFX) (int *n, double *d, double *l, double *ld, double *lld, int *ifirst,
238                                 int *ilast, double *w, double *sigma, double *dplus, double *lplus,
239                                 double *work, int *info);
240
241 void
242     F77_FUNC(dlasd3, DLASD3) (int *nl, int *nr, int *sqre, int *k, double *d, double *q, int *ldq,
243                               double *dsigma, double *u, int *ldu, double *u2, int *ldu2,
244                               double *vt, int *ldvt, double *vt2, int *ldvt2, int *idxc,
245                               int *ctot, double *z, int *info);
246
247 void
248     F77_FUNC(dlaset, DLASET) (const char *uplo, int *m, int *n, double *alpha,
249                               double *beta, double *a, int *lda);
250
251 void
252     F77_FUNC(dlassq, DLASSQ) (int *n, double *x, int *incx, double *scale, double *sumsq);
253
254 void
255     F77_FUNC(dorm2l, DORM2L) (const char *side, const char *trans, int *m, int *n, int *k, double *a, int *lda,
256                               double *tau, double *c, int *ldc, double *work, int *info);
257
258 void
259     F77_FUNC(dstegr, DSTEGR) (const char *jobz, const char *range, int *n, double *d, double *e, double *vl,
260                               double *vu, int *il, int *iu, double *abstol, int *m, double *w,
261                               double *z, int *ldz, int *isuppz, double *work,
262                               int *lwork, int *iwork, int *liwork, int *info);
263
264 void
265     F77_FUNC(ssteqr, SSTEQR) (const char *compz, int *n, float *d__, float *e,
266                               float *z__,  int *ldz, float *work, int *info);
267
268 void
269     F77_FUNC(dgelq2, DGELQ2) (int *m, int *n, double *a, int *lda, double *tau, double *work, int *info);
270
271 void
272     F77_FUNC(dlae2, DLAE2) (double *a, double *b, double *c, double *rt1, double *rt2);
273
274 void
275     F77_FUNC(dlaev2, DLAEV2) (double *a, double *b, double *c, double *rt1, double *rt2,
276                               double *cs1, double *cs2);
277
278 void
279     F77_FUNC(dlar1vx, DLAR1VX) (int *n, int *b1, int *bn, double *sigma, double *d, double *l, double *ld,
280                                 double *lld, double *eval, double *gersch, double *z, double *ztz, double *mingma,
281                                 int *r, int *isuppz, double *work);
282
283 void
284     F77_FUNC(dlarrvx, DLARRVX) (int *n, double *d, double *l, int *isplit, int *m, double *w,
285                                 int *iblock, int *indexw, double *gersch, double *tol, double *z, int *ldz,
286                                 int *isuppz, double *work, int *iwork, int *info);
287
288 void
289     F77_FUNC(dlasd4, DLASD4) (int *n, int *i, double *d, double *z, double *delta,
290                               double *rho, double *sigma, double *work, int *info);
291
292 void
293     F77_FUNC(dlasq1, DLASQ1) (int *n, double *d, double *e, double *work, int *info);
294
295
296 void
297     F77_FUNC(dlasv2, DLASV2) (double *f, double *g, double *h, double *ssmin, double *ssmax,
298                               double *snr, double *csr, double *snl, double *csl);
299
300 void
301     F77_FUNC(dorm2r, DORM2R) (const char *side, const char *trans, int *m, int *n, int *k, double *a,
302                               int *lda, double *tau, double *c, int *ldc, double *work, int *info);
303
304 void
305     F77_FUNC(dstein, DSTEIN) (int *n, double *d, double *e, int *m, double *w, int *iblock, int *isplit,
306                               double *z, int *ldz, double *work, int *iwork, int *ifail, int *info);
307
308 void
309     F77_FUNC(dgelqf, DGELQF) (int *m, int *n, double *a, int *lda, double *tau,
310                               double *work, int *lwork, int *info);
311
312 void
313     F77_FUNC(dlaebz, DLAEBZ) (int *ijob, int *nitmax, int *n, int *mmax, int *minp, int *nbmin,
314                               double *abstol, double *reltol, double *pivmin, double *d, double *e,
315                               double *e2, int *nval, double *ab, double *c, int *mout, int *nab,
316                               double *work, int *iwork, int *info);
317
318 void
319     F77_FUNC(dlarf, DLARF) (const char *side, int *m, int *n, double *v, int *incv, double *tau,
320                             double *c, int *ldc, double *work);
321
322 void
323     F77_FUNC(dlartg, DLARTG) (double *f, double *g, double *cs, double *sn, double *r);
324
325 void
326     F77_FUNC(dlasd5, DLASD5) (int *i, double *d, double *z, double *delta,
327                               double *rho, double *dsigma, double *work);
328
329 void
330     F77_FUNC(dlasq2, DLASQ2) (int *n, double *z, int *info);
331
332 void
333     F77_FUNC(dlasq3, DLASQ3) (int *i0, int *n0, double *z, int *pp, double *dmin,
334                               double *sigma, double *desig, double *qmax, int *nfail,
335                               int *iter, int *ndiv, int *ieee);
336
337 void
338     F77_FUNC(dlaswp, DLASWP) (int *n, double *a, int *lda, int *k1, int *k2, int *ipiv, int *incx);
339
340 void
341     F77_FUNC(dormbr, DORMBR) (const char *vect, const char *side, const char *trans, int *m, int *n, int *k,
342                               double *a, int *lda, double *tau, double *c, int *ldc, double *work,
343                               int *lwork, int *info);
344
345 void
346     F77_FUNC(dsterf, DSTERF) (int *n, double *d, double *e, int *info);
347
348 void
349     F77_FUNC(dgeqr2, DGEQR2) (int *m, int *n, double *a, int *lda, double *tau,
350                               double *work, int *info);
351
352 void
353     F77_FUNC(dlaed6, DLAED6) (int *kniter, int *orgati, double *rho, double *d,
354                               double *z, double *finit, double *tau, int *info);
355
356 void
357     F77_FUNC(dlarfb, DLARFB) (const char *side, const char *trans, const char *direct, const char *storev, int *m, int *n,
358                               int *k, double *v, int *ldv, double *t, int *ldt, double *c,
359                               int *ldc, double *work, int *ldwork);
360
361 void
362     F77_FUNC(dlaruv, DLARUV) (int *iseed, int *n, double *x);
363
364 void
365     F77_FUNC(dlasd6, DLASD6) (int *icompq, int *nl, int *nr, int *sqre, double *d, double *vf,
366                               double *vl, double *alpha, double *beta, int *idxq, int *perm,
367                               int *givptr, int *givcol, int *ldgcol, double *givnum, int *ldgnum,
368                               double *poles, double *difl, double *difr, double *z, int *k,
369                               double *c, double *s, double *work, int *iwork, int *info);
370
371 void
372     F77_FUNC(dlatrd, DLATRD) (const char *uplo, int *n, int *nb, double *a, int *lda, double *e,
373                               double * tau, double *w, int *ldw);
374
375 void
376     F77_FUNC(dorml2, DORML2) (const char *side, const char *trans, int *m, int *n, int *k, double *a,
377                               int *lda, double *tau, double *c, int *ldc, double *work, int *info);
378
379 void
380     F77_FUNC(dstevr, DSTEVR) (const char *jobz, const char *range, int *n, double *d, double *e, double *vl,
381                               double *vu, int *il, int *iu, double *abstol, int *m, double *w,
382                               double *z, int *ldz, int *isuppz, double *work,
383                               int *lwork, int *iwork, int *liwork, int *info);
384
385 void
386     F77_FUNC(dsytrd, DSYTRD) (const char *uplo, int *n, double *  a, int *lda, double *d,
387                               double *e, double *tau, double *work, int *lwork, int *info);
388
389 void
390     F77_FUNC(dsyevr, DSYEVR) (const char *jobz, const char *range, const char *uplo, int *n,
391                               double *a, int *lda, double *vl, double *vu, int *
392                               il, int *iu, double *abstol, int *m, double *w,
393                               double *z__, int *ldz, int *isuppz, double *work,
394                               int *lwork, int *iwork, int *liwork, int *info);
395
396 void
397     F77_FUNC(dormql, DORMQL) (const char *side, const char *trans, int *m, int *n,
398                               int *k, double *a, int *lda, double *tau, double *
399                               c, int *ldc, double *work, int *lwork, int *info);
400
401 void
402     F77_FUNC(dormqr, DORMQR) (const char *side, const char *trans, int *m, int *n, int *k, double *a,
403                               int *lda, double *tau, double *c, int *ldc,
404                               double *work, int *lwork, int *info);
405
406 void
407     F77_FUNC(dorgbr, DORGBR) (const char *vect, int *m, int *n, int *k, double *a, int *lda,
408                               double *tau, double *work, int *lwork, int *info);
409
410 void
411     F77_FUNC(dlasq5, DLASQ5) (int *i0, int *n0, double *z, int *pp, double *tau, double *dmin,
412                               double *dmin1, double *dmin2, double *dn, double *dnm1,
413                               double *dnm2, int *ieee);
414
415 void
416     F77_FUNC(dlasd8, DLASD8) (int *icompq, int *k, double *d, double *z, double *vf, double *vl,
417                               double *difl, double *difr, int *lddifr, double *dsigma,
418                               double *work, int *info);
419
420 void
421     F77_FUNC(dlascl, DLASCL) (const char *type, int *kl, int *ku, double *cfrom, double *cto, int *m,
422                               int *n, double *a, int *lda, int *info);
423
424 void
425     F77_FUNC(dlarft, DLARFT) (const char *direct, const char *storev, int *n, int *k, double *v,
426                               int *ldv, double *tau, double *t, int *ldt);
427
428 void
429     F77_FUNC(dlagts, DLAGTS) (int *job, int *n, double *a, double *b, double *c, double *d,
430                               int *in, double *y, double *tol, int *info);
431
432 void
433     F77_FUNC(dgesdd, DGESDD) (const char *jobz, int *m, int *n, double *a, int *lda, double *s, double *u,
434                               int *ldu, double *vt, int *ldvt, double *work, int *lwork,
435                               int *iwork, int *info);
436
437 void
438     F77_FUNC(dsytd2, DSYTD2) (const char *uplo, int *n, double *a, int *lda, double *d,
439                               double *e, double *tau, int *info);
440
441 void
442     F77_FUNC(dormlq, DORMLQ) (const char *side, const char *trans, int *m, int *n, int *k, double *a, int *lda,
443                               double *tau, double *c, int *ldc, double *work, int *lwork, int *info);
444
445 void
446     F77_FUNC(dorg2r, DORG2R) (int *m, int *n, int *k, double *a, int *lda, double *tau,
447                               double *work, int *info);
448
449 void
450     F77_FUNC(dlasq4, DLASQ4) (int *i0, int *n0, double *z, int *pp, int *n0in, double *dmin,
451                               double *dmin1, double *dmin2, double *dn, double *dn1,
452                               double *dn2, double *tau, int *ttype);
453
454 void
455     F77_FUNC(dlasd7, DLASD7) (int *icompq, int *nl, int *nr, int *sqre, int *k, double *d, double *z,
456                               double *zw, double *vf, double *vfw, double *vl, double *vlw,
457                               double *alpha, double *beta, double *dsigma, int *idx, int *idxp,
458                               int *idxq, int *perm, int *givptr, int *givcol, int *ldgcol,
459                               double *givnum, int *ldgnum, double *c, double *s, int *info);
460
461 void
462     F77_FUNC(dlas2, DLAS2) (double *f, double *g, double *h, double *ssmin, double *ssmax);
463
464 void
465     F77_FUNC(dlarfg, DLARFG) (int *n, double *alpha, double *x, int *incx, double *tau);
466
467 void
468     F77_FUNC(dlagtf, DLAGTF) (int *n, double *a, double *lambda, double *b, double *c,
469                               double *tol, double *d, int *in, int *info);
470
471 void
472     F77_FUNC(dgeqrf, DGEQRF) (int *m, int *n, double *a, int *lda, double *tau,
473                               double *work, int *lwork, int *info);
474
475
476
477 /* Single precision */
478
479 void
480     F77_FUNC(sbdsdc, SBDSDC) (const char *uplo, const char *compq, int *n, float *d, float *e, float *u,
481                               int *ldu, float *vt, int *ldvt, float *q, int *iq, float *work,
482                               int *iwork, int *info);
483
484 void
485     F77_FUNC(sgetf2, SGETF2) (int *m, int *n, float *a, int *lda, int *ipiv, int *info);
486
487 void
488     F77_FUNC(slamrg, SLAMRG) (int *n1, int *n2, float *a, int *dtrd1, int *dtrd2, int *index);
489
490 void
491     F77_FUNC(slarnv, SLARNV) (int *idist, int *iseed, int *n, float *x);
492
493 void
494     F77_FUNC(slasd0, SLASD0) (int *n, int *sqre, float *d, float *e, float *u,
495                               int *ldu, float *vt, int *ldvt, int *smlsiz, int *iwork,
496                               float *work, int *info);
497
498 void
499     F77_FUNC(slasda, SLASDA) (int *icompq, int *smlsiz, int *n, int *sqre, float *d, float *e,
500                               float *u, int *ldu, float *vt, int *k, float *difl, float *difr,
501                               float *z, float *poles, int *givptr, int *givcol, int *ldgcol,
502                               int *perm, float *givnum, float *c, float *s,
503                               float *work, int *iwork, int *info);
504
505 void
506     F77_FUNC(slasq6, SLASQ6) (int *i0, int *n0, float *z, int *pp, float *dmin, float *dmin1,
507                               float *dmin2, float *dn, float *dnm1, float *dnm2);
508
509 void
510     F77_FUNC(sorgl2, SORGL2) (int *m, int *n, int *k, float *a, int *lda,
511                               float *tau, float *work, int *info);
512
513 void
514     F77_FUNC(sbdsqr, SBDSQR) (const char *uplo, int *n, int *ncvt, int *nru, int *ncc, float *d,
515                               float *e, float *vt, int *ldvt, float *u, int *ldu,
516                               float *c, int *ldc, float *work, int *info);
517
518 void
519     F77_FUNC(sgetrf, SGETRF) (int *m, int *n, float *a, int *lda, int *ipiv, int *info);
520
521 void
522     F77_FUNC(sgetri, SGETRI) (int *n, float *a, int *lda, int *ipiv, float *work,
523                               int *lwork, int *info);
524
525 void
526     F77_FUNC(sgetrs, SGETRS) (const char *trans, int *n, int *nrhs,   float *a, int *lda, int *ipiv,
527                               float *b, int *ldb, int *info);
528
529 void
530     F77_FUNC(strtri, STRTRI) (const char *uplo, const char *diag, int *n, float *a, int *lda, int *info);
531
532 void
533     F77_FUNC(strti2, STRTI2) (const char *uplo, const char *diag, int *n, float *a, int *lda, int *info);
534
535 float
536     F77_FUNC(slange, SLANGE) (const char *norm, int *m, int *n, float *a, int *lda, float *work);
537
538 void
539     F77_FUNC(slarrbx, SLARRBX) (int *n, float *d, float *l, float *ld, float *lld, int *ifirst,
540                                 int *ilast, float *rtol1, float *rtol2, int *offset, float *w,
541                                 float *wgap, float *werr, float *work, int *iwork, int *info);
542
543 void
544     F77_FUNC(slasd1, SLASD1) (int *nl, int *nr, int *sqre, float *d, float *alpha, float *beta,
545                               float *u, int *ldu, float *vt, int *ldvt, int *idxq, int *iwork,
546                               float *work, int *info);
547
548 void
549     F77_FUNC(slasdq, SLASDQ) (const char *uplo, int *sqre, int *n, int *ncvt, int *nru, int *ncc,
550                               float *d, float *e, float *vt, int *ldvt, float *u, int *ldu,
551                               float *c, int *ldc, float *work, int *info);
552
553 void
554     F77_FUNC(slasr, SLASR) (const char *side, const char *pivot, const char *direct, int *m, int *n, float *c,
555                             float *s, float *a, int *lda);
556
557 void
558     F77_FUNC(sorglq, SORGLQ) (int *m, int *n, int *k, float *a, int *lda,
559                               float *tau, float *work, int *lwork, int *info);
560
561 void
562     F77_FUNC(sormtr, SORMTR) (const char *side, const char *uplo, const char *trans, int *m, int *n, float *a,
563                               int *lda, float *tau, float *c, int *ldc,
564                               float *work, int *lwork, int *info);
565
566 void
567     F77_FUNC(sgebd2, SGEBD2) (int *m, int *n, float *a, int *lda, float *d, float *e,
568                               float *tauq, float *taup, float *work, int *info);
569
570 void
571     F77_FUNC(slabrd, SLABRD) (int *m, int *n, int *nb, float *a, int *lda, float *d,
572                               float *e, float *tauq, float *taup, float *x,
573                               int *ldx, float *y, int *ldy);
574
575 float
576     F77_FUNC(slanst, SLANST) (const char *norm, int *n, float *d, float *e);
577
578 float
579     F77_FUNC(slansy, SLANSY) (const char *norm, const char *uplo, int *n, float *a, int *lda, float *work);
580
581 void
582     F77_FUNC(slarrex, SLARREX) (const char *range, int *n, float *vl, float *vu, int *il, int *iu,
583                                 float *d, float *e, float *tol, int *nsplit,
584                                 int *isplit, int *m, float *w, int *iblock, int *indexw,
585                                 float *gersch, float *work, int *iwork, int *info);
586
587 void
588     F77_FUNC(slasd2, SLASD2) (int *nl, int *nr, int *sqre, int *k, float *d, float *z,
589                               float *alpha, float *beta, float *u, int *ldu, float *vt,
590                               int *ldvt, float *dsigma, float *u2, int *ldu2, float *vt2,
591                               int *ldvt2, int *idxp, int *idx, int *idxc,
592                               int *idxq, int *coltyp, int *info);
593
594 void
595     F77_FUNC(slasdt, SLASDT) (int *n, int *lvl, int *nd, int *inode, int *ndiml,
596                               int *ndimr, int *msub);
597
598 void
599     F77_FUNC(slasrt, SLASRT) (const char *id, int *n, float *d, int *info);
600
601 void
602     F77_FUNC(slasrt2, SLASRT2) (const char *id, int *n, float *d, int *key, int *info);
603
604 void
605     F77_FUNC(sorgqr, SORGQR) (int *m, int *n, int *k, float *a, int *lda, float *tau,
606                               float *work, int *lwork, int *info);
607
608 void
609     F77_FUNC(sstebz, SSTEBZ) (const char *range, const char *order, int *n, float *vl, float *vu,
610                               int *il, int *iu, float *abstol, float *d, float *e,
611                               int *m, int *nsplit, float *w, int *iblock, int *isplit,
612                               float *work, int *iwork, int *info);
613
614 void
615     F77_FUNC(sgebrd, SGEBRD) (int *m, int *n, float *a, int *lda, float *d, float *e,
616                               float *tauq, float *taup, float *work, int *lwork, int *info);
617
618 void
619     F77_FUNC(slacpy, SLACPY) (const char *uplo, int *m, int *n, float *a, int *lda, float *b, int *ldb);
620
621 float
622     F77_FUNC(slapy2, SLAPY2) (float * x, float * y);
623
624 void
625     F77_FUNC(slarrfx, SLARRFX) (int *n, float *d, float *l, float *ld, float *lld, int *ifirst,
626                                 int *ilast, float *w, float *sigma, float *dplus, float *lplus,
627                                 float *work, int *info);
628
629 void
630     F77_FUNC(slasd3, SLASD3) (int *nl, int *nr, int *sqre, int *k, float *d, float *q, int *ldq,
631                               float *dsigma, float *u, int *ldu, float *u2, int *ldu2,
632                               float *vt, int *ldvt, float *vt2, int *ldvt2, int *idxc,
633                               int *ctot, float *z, int *info);
634
635 void
636     F77_FUNC(slaset, SLASET) (const char *uplo, int *m, int *n, float *alpha,
637                               float *beta, float *a, int *lda);
638
639 void
640     F77_FUNC(slassq, SLASSQ) (int *n, float *x, int *incx, float *scale, float *sumsq);
641
642 void
643     F77_FUNC(sorm2l, SORM2L) (const char *side, const char *trans, int *m, int *n, int *k, float *a, int *lda,
644                               float *tau, float *c, int *ldc, float *work, int *info);
645
646 void
647     F77_FUNC(sstegr, SSTEGR) (const char *jobz, const char *range, int *n, float *d, float *e, float *vl,
648                               float *vu, int *il, int *iu, float *abstol, int *m, float *w,
649                               float *z, int *ldz, int *isuppz, float *work,
650                               int *lwork, int *iwork, int *liwork, int *info);
651
652 void
653     F77_FUNC(sgelq2, SGELQ2) (int *m, int *n, float *a, int *lda, float *tau, float *work, int *info);
654
655 void
656     F77_FUNC(slae2, SLAE2) (float *a, float *b, float *c, float *rt1, float *rt2);
657
658 void
659     F77_FUNC(slaev2, SLAEV2) (float *a, float *b, float *c, float *rt1, float *rt2,
660                               float *cs1, float *cs2);
661
662 void
663     F77_FUNC(slar1vx, SLAR1VX) (int *n, int *b1, int *bn, float *sigma, float *d, float *l, float *ld,
664                                 float *lld, float *eval, float *gersch, float *z, float *ztz, float *mingma,
665                                 int *r, int *isuppz, float *work);
666
667 void
668     F77_FUNC(slarrvx, SLARRVX) (int *n, float *d, float *l, int *isplit, int *m, float *w,
669                                 int *iblock, int *indexw, float *gersch, float *tol, float *z, int *ldz,
670                                 int *isuppz, float *work, int *iwork, int *info);
671
672 void
673     F77_FUNC(slasd4, SLASD4) (int *n, int *i, float *d, float *z, float *delta,
674                               float *rho, float *sigma, float *work, int *info);
675
676 void
677     F77_FUNC(slasq1, SLASQ1) (int *n, float *d, float *e, float *work, int *info);
678
679
680 void
681     F77_FUNC(slasv2, SLASV2) (float *f, float *g, float *h, float *ssmin, float *ssmax,
682                               float *snr, float *csr, float *snl, float *csl);
683
684 void
685     F77_FUNC(sorm2r, SORM2R) (const char *side, const char *trans, int *m, int *n, int *k, float *a,
686                               int *lda, float *tau, float *c, int *ldc, float *work, int *info);
687
688 void
689     F77_FUNC(sstein, SSTEIN) (int *n, float *d, float *e, int *m, float *w, int *iblock, int *isplit,
690                               float *z, int *ldz, float *work, int *iwork, int *ifail, int *info);
691
692 void
693     F77_FUNC(sgelqf, SGELQF) (int *m, int *n, float *a, int *lda, float *tau,
694                               float *work, int *lwork, int *info);
695
696 void
697     F77_FUNC(slaebz, SLAEBZ) (int *ijob, int *nitmax, int *n, int *mmax, int *minp, int *nbmin,
698                               float *abstol, float *reltol, float *pivmin, float *d, float *e,
699                               float *e2, int *nval, float *ab, float *c, int *mout, int *nab,
700                               float *work, int *iwork, int *info);
701
702 void
703     F77_FUNC(slarf, SLARF) (const char *side, int *m, int *n, float *v, int *incv, float *tau,
704                             float *c, int *ldc, float *work);
705
706 void
707     F77_FUNC(slartg, SLARTG) (float *f, float *g, float *cs, float *sn, float *r);
708
709 void
710     F77_FUNC(slasd5, SLASD5) (int *i, float *d, float *z, float *delta,
711                               float *rho, float *dsigma, float *work);
712
713 void
714     F77_FUNC(slasq2, SLASQ2) (int *n, float *z, int *info);
715
716 void
717     F77_FUNC(slasq3, SLASQ3) (int *i0, int *n0, float *z, int *pp, float *dmin,
718                               float *sigma, float *desig, float *qmax, int *nfail,
719                               int *iter, int *ndiv, int *ieee);
720
721 void
722     F77_FUNC(slaswp, SLASWP) (int *n, float *a, int *lda, int *k1, int *k2, int *ipiv, int *incx);
723
724 void
725     F77_FUNC(sormbr, SORMBR) (const char *vect, const char *side, const char *trans, int *m, int *n, int *k,
726                               float *a, int *lda, float *tau, float *c, int *ldc, float *work,
727                               int *lwork, int *info);
728
729 void
730     F77_FUNC(ssterf, SSTERF) (int *n, float *d, float *e, int *info);
731
732 void
733     F77_FUNC(sgeqr2, SGEQR2) (int *m, int *n, float *a, int *lda, float *tau,
734                               float *work, int *info);
735
736 void
737     F77_FUNC(slaed6, SLAED6) (int *kniter, int *orgati, float *rho, float *d,
738                               float *z, float *finit, float *tau, int *info);
739
740 void
741     F77_FUNC(slarfb, SLARFB) (const char *side, const char *trans, const char *direct, const char *storev, int *m, int *n,
742                               int *k, float *v, int *ldv, float *t, int *ldt, float *c,
743                               int *ldc, float *work, int *ldwork);
744
745 void
746     F77_FUNC(slaruv, SLARUV) (int *iseed, int *n, float *x);
747
748 void
749     F77_FUNC(slasd6, SLASD6) (int *icompq, int *nl, int *nr, int *sqre, float *d, float *vf,
750                               float *vl, float *alpha, float *beta, int *idxq, int *perm,
751                               int *givptr, int *givcol, int *ldgcol, float *givnum, int *ldgnum,
752                               float *poles, float *difl, float *difr, float *z, int *k,
753                               float *c, float *s, float *work, int *iwork, int *info);
754
755 void
756     F77_FUNC(slatrd, SLATRD) (const char *uplo, int *n, int *nb, float *a, int *lda, float *e,
757                               float * tau, float *w, int *ldw);
758
759 void
760     F77_FUNC(sorml2, SORML2) (const char *side, const char *trans, int *m, int *n, int *k, float *a,
761                               int *lda, float *tau, float *c, int *ldc, float *work, int *info);
762
763 void
764     F77_FUNC(sstevr, SSTEVR) (const char *jobz, const char *range, int *n, float *d, float *e, float *vl,
765                               float *vu, int *il, int *iu, float *abstol, int *m, float *w,
766                               float *z, int *ldz, int *isuppz, float *work,
767                               int *lwork, int *iwork, int *liwork, int *info);
768
769 void
770     F77_FUNC(ssytrd, SSYTRD) (const char *uplo, int *n, float *  a, int *lda, float *d,
771                               float *e, float *tau, float *work, int *lwork, int *info);
772
773 void
774     F77_FUNC(ssyevr, SSYEVR) (const char *jobz, const char *range, const char *uplo, int *n,
775                               float *a, int *lda, float *vl, float *vu, int *
776                               il, int *iu, float *abstol, int *m, float *w,
777                               float *z__, int *ldz, int *isuppz, float *work,
778                               int *lwork, int *iwork, int *liwork, int *info);
779
780 void
781     F77_FUNC(sormql, SORMQL) (const char *side, const char *trans, int *m, int *n,
782                               int *k, float *a, int *lda, float *tau, float *
783                               c, int *ldc, float *work, int *lwork, int *info);
784
785 void
786     F77_FUNC(sormqr, SORMQR) (const char *side, const char *trans, int *m, int *n, int *k, float *a,
787                               int *lda, float *tau, float *c, int *ldc,
788                               float *work, int *lwork, int *info);
789
790 void
791     F77_FUNC(sorgbr, SORGBR) (const char *vect, int *m, int *n, int *k, float *a, int *lda,
792                               float *tau, float *work, int *lwork, int *info);
793
794 void
795     F77_FUNC(slasq5, SLASQ5) (int *i0, int *n0, float *z, int *pp, float *tau, float *dmin,
796                               float *dmin1, float *dmin2, float *dn, float *dnm1,
797                               float *dnm2, int *ieee);
798
799 void
800     F77_FUNC(slasd8, SLASD8) (int *icompq, int *k, float *d, float *z, float *vf, float *vl,
801                               float *difl, float *difr, int *lddifr, float *dsigma,
802                               float *work, int *info);
803
804 void
805     F77_FUNC(slascl, SLASCL) (const char *type, int *kl, int *ku, float *cfrom, float *cto, int *m,
806                               int *n, float *a, int *lda, int *info);
807
808 void
809     F77_FUNC(slarft, SLARFT) (const char *direct, const char *storev, int *n, int *k, float *v,
810                               int *ldv, float *tau, float *t, int *ldt);
811
812 void
813     F77_FUNC(slagts, SLAGTS) (int *job, int *n, float *a, float *b, float *c, float *d,
814                               int *in, float *y, float *tol, int *info);
815
816 void
817     F77_FUNC(sgesdd, SGESDD) (const char *jobz, int *m, int *n, float *a, int *lda, float *s, float *u,
818                               int *ldu, float *vt, int *ldvt, float *work, int *lwork,
819                               int *iwork, int *info);
820
821 void
822     F77_FUNC(ssytd2, SSYTD2) (const char *uplo, int *n, float *a, int *lda, float *d,
823                               float *e, float *tau, int *info);
824
825 void
826     F77_FUNC(sormlq, SORMLQ) (const char *side, const char *trans, int *m, int *n, int *k, float *a, int *lda,
827                               float *tau, float *c, int *ldc, float *work, int *lwork, int *info);
828
829 void
830     F77_FUNC(sorg2r, SORG2R) (int *m, int *n, int *k, float *a, int *lda, float *tau,
831                               float *work, int *info);
832
833 void
834     F77_FUNC(slasq4, SLASQ4) (int *i0, int *n0, float *z, int *pp, int *n0in, float *dmin,
835                               float *dmin1, float *dmin2, float *dn, float *dn1,
836                               float *dn2, float *tau, int *ttype);
837
838 void
839     F77_FUNC(slasd7, SLASD7) (int *icompq, int *nl, int *nr, int *sqre, int *k, float *d, float *z,
840                               float *zw, float *vf, float *vfw, float *vl, float *vlw,
841                               float *alpha, float *beta, float *dsigma, int *idx, int *idxp,
842                               int *idxq, int *perm, int *givptr, int *givcol, int *ldgcol,
843                               float *givnum, int *ldgnum, float *c, float *s, int *info);
844
845 void
846     F77_FUNC(slas2, SLAS2) (float *f, float *g, float *h, float *ssmin, float *ssmax);
847
848 void
849     F77_FUNC(slarfg, SLARFG) (int *n, float *alpha, float *x, int *incx, float *tau);
850
851 void
852     F77_FUNC(slagtf, SLAGTF) (int *n, float *a, float *lambda, float *b, float *c,
853                               float *tol, float *d, int *in, int *info);
854
855 void
856     F77_FUNC(sgeqrf, SGEQRF) (int *m, int *n, float *a, int *lda, float *tau,
857                               float *work, int *lwork, int *info);
858
859
860 #ifdef __cplusplus
861 }
862 #endif
863
864 /*! \endcond */
865
866 #endif /* GMX_LAPACK_H */