Merge branch 'master' of git://git.gromacs.org/gromacs
[gromacs/adressmacs.git] / include / gmx_blas.h
blobf36d4d868c8a5280c76e56eed9748226f442f6e4
1 /*
2 *
3 * This source code is part of
4 *
5 * G R O M A C S
6 *
7 * GROningen MAchine for Chemical Simulations
8 *
9 * Written by David van der Spoel, Erik Lindahl, Berk Hess, and others.
10 * Copyright (c) 1991-2000, University of Groningen, The Netherlands.
11 * Copyright (c) 2001-2008, The GROMACS development team,
12 * check out http://www.gromacs.org for more information.
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * If you want to redistribute modifications, please consider that
20 * scientific software is very special. Version control is crucial -
21 * bugs must be traceable. We will be happy to consider code for
22 * inclusion in the official distribution, but derived work must not
23 * be called official GROMACS. Details are found in the README & COPYING
24 * files - if they are missing, get the official version at www.gromacs.org.
26 * To help us fund GROMACS development, we humbly ask that you cite
27 * the papers on the package - you can find them in the top README file.
29 * For more info, check our website at http://www.gromacs.org
31 * And Hey:
32 * Gallium Rubidium Oxygen Manganese Argon Carbon Silicon
35 #ifndef _GMX_BLAS_H_
36 #define _GMX_BLAS_H_
38 #include "types/simple.h"
41 /** @file
43 * @brief Header definitions for the standard BLAS library.
45 * This is the subset of BLAS routines used for the
46 * linear algebra operations in Gromacs.
47 * Do NOT use this for other purposes - we only provide this as a
48 * simple fallback/reference implementation when no optimized BLAS
49 * is present. If you need an implementation for your own code
50 * there are several much faster versions out there.
52 * All routines are compatible with the BLAS reference implementation,
53 * meaning they assume fortran-style matrix row/column organization.
55 * There is plenty of documentation for these routines available
56 * at http://www.netlib.org/blas , so there is no point in repeating
57 * it here.
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 #if 0
65 #endif
67 #ifndef F77_FUNC
68 #define F77_FUNC(name,NAME) name ## _
69 #endif
72 /* Double precision versions */
73 double
74 F77_FUNC(dasum,DASUM)(int *n, double *dx, int *incx);
76 void
77 F77_FUNC(daxpy,DAXPY)(int *n, double *da, double *dx, int *incx, double *dy, int *incy);
79 void
80 F77_FUNC(dcopy,DCOPY)(int *n, double *dx, int *incx, double *dy, int *incy);
82 double
83 F77_FUNC(ddot,DDOT)(int *n, double *dx, int *incx, double *dy, int *incy);
85 void
86 F77_FUNC(dgemm,DGEMM)(const char *transa, const char *transb, int *m, int *n, int *k,
87 double *alpha, double *a, int *lda, double *b, int *ldb,
88 double *beta, double *c, int *ldc);
90 void
91 F77_FUNC(dgemv,DGEMV)(const char *trans, int *m, int *n, double *alpha, double *a, int *lda,
92 double *x, int *incx, double *beta, double *y, int *incy);
94 void
95 F77_FUNC(dger,DGER)(int *m, int *n, double *alpha, double *x, int *incx,
96 double *y, int *incy, double *a, int *lda);
98 double
99 F77_FUNC(dnrm2,DNRM2)(int *n, double *x, int *incx);
101 void
102 F77_FUNC(drot,DROT)(int *n, double *dx, int *incx,
103 double *dy, int *incy, double *c, double *s);
105 void
106 F77_FUNC(dscal,DSCAL)(int *n, double *fact, double *dx, int *incx);
108 void
109 F77_FUNC(dswap,DSWAP)(int *n, double *dx, int *incx, double *dy, int *incy);
111 void
112 F77_FUNC(dsymv,DSYMV)(const char *uplo, int *n, double *alpha, double *a, int *lda,
113 double *x, int *incx, double *beta, double *y, int *incy);
115 void
116 F77_FUNC(dsyr2,DSYR2)(const char *uplo, int *n, double *alpha, double *x, int *incx,
117 double *y, int *incy, double *a, int *lda);
119 void
120 F77_FUNC(dsyr2k,DSYR2K)(const char *uplo, const char *trans, int *n, int *k, double *alpha, double *a,
121 int *lda, double *b, int *ldb, double *beta, double *c, int *ldc);
123 void
124 F77_FUNC(dtrmm,DTRMM)(const char *side, const char *uplo, const char *transa, const char *diag, int *m, int *n,
125 double *alpha, double *a, int *lda, double *b, int *ldb);
127 void
128 F77_FUNC(dtrmv,DTRMV)(const char *uplo, const char *trans, const char *diag, int *n,
129 double *a, int *lda, double *x, int *incx);
131 void
132 F77_FUNC(dtrsm,DTRSM)(const char *side, const char *uplo, const char *transa, const char *diag, int *m, int *n,
133 double *alpha, double *a,int *lda, double *b, int *ldb);
136 F77_FUNC(idamax,IDAMAX)(int *n, double *dx, int *incx);
140 /* Single precision versions */
141 float
142 F77_FUNC(sasum,SASUM)(int *n, float *dx, int *incx);
144 void
145 F77_FUNC(saxpy,SAXPY)(int *n, float *da, float *dx, int *incx, float *dy, int *incy);
147 void
148 F77_FUNC(scopy,SCOPY)(int *n, float *dx, int *incx, float *dy, int *incy);
150 float
151 F77_FUNC(sdot,SDOT)(int *n, float *dx, int *incx, float *dy, int *incy);
153 void
154 F77_FUNC(sgemm,SGEMM)(const char *transa, const char *transb, int *m, int *n, int *k,
155 float *alpha, float *a, int *lda, float *b, int *ldb,
156 float *beta, float *c, int *ldc);
158 void
159 F77_FUNC(sgemv,SGEMV)(const char *trans, int *m, int *n, float *alpha, float *a, int *lda,
160 float *x, int *incx, float *beta, float *y, int *incy);
162 void
163 F77_FUNC(sger,SGER)(int *m, int *n, float *alpha, float *x, int *incx,
164 float *y, int *incy, float *a, int *lda);
166 float
167 F77_FUNC(snrm2,SNRM2)(int *n, float *x, int *incx);
169 void
170 F77_FUNC(srot,SROT)(int *n, float *dx, int *incx,
171 float *dy, int *incy, float *c, float *s);
173 void
174 F77_FUNC(sscal,SSCAL)(int *n, float *fact, float *dx, int *incx);
176 void
177 F77_FUNC(sswap,SSWAP)(int *n, float *dx, int *incx, float *dy, int *incy);
179 void
180 F77_FUNC(ssymv,SSYMV)(const char *uplo, int *n, float *alpha, float *a, int *lda,
181 float *x, int *incx, float *beta, float *y, int *incy);
183 void
184 F77_FUNC(ssyr2,SSYR2)(const char *uplo, int *n, float *alpha, float *x, int *incx,
185 float *y, int *incy, float *a, int *lda);
187 void
188 F77_FUNC(ssyr2k,SSYR2K)(const char *uplo, const char *trans, int *n, int *k, float *alpha, float *a,
189 int *lda, float *b, int *ldb, float *beta, float *c, int *ldc);
191 void
192 F77_FUNC(strmm,STRMM)(const char *side, const char *uplo, const char *transa, const char *diag, int *m, int *n,
193 float *alpha, float *a, int *lda, float *b, int *ldb);
195 void
196 F77_FUNC(strmv,STRMV)(const char *uplo, const char *trans, const char *diag, int *n,
197 float *a, int *lda, float *x, int *incx);
199 void
200 F77_FUNC(strsm,STRSM)(const char *side, const char *uplo, const char *transa, const char *diag, int *m, int *n,
201 float *alpha, float *a,int *lda, float *b, int *ldb);
204 F77_FUNC(isamax,ISAMAX)(int *n, float *dx, int *incx);
207 #ifdef __cplusplus
209 #endif
213 #endif /* _BLAS_H_ */