Debian Codegraph @

CBLAS/src/cblas_dger.c

raw
1 /*
2 *
3 * cblas_dger.c
4 * This program is a C interface to dger.
5 * Written by Keita Teranishi
6 * 4/6/1998
7 *
8 */
9
10 #include "cblas.h"
11 #include "cblas_f77.h"
12 void API_SUFFIX(cblas_dger)(const CBLAS_LAYOUT layout, const CBLAS_INT M, const CBLAS_INT N,
13 const double alpha, const double *X, const CBLAS_INT incX,
14 const double *Y, const CBLAS_INT incY, double *A, const CBLAS_INT lda)
15 {
16 #ifdef F77_INT
17 F77_INT F77_M=M, F77_N=N, F77_lda=lda, F77_incX=incX, F77_incY=incY;
18 #else
19 #define F77_M M
20 #define F77_N N
21 #define F77_incX incX
22 #define F77_incY incY
23 #define F77_lda lda
24 #endif
25
26 extern int CBLAS_CallFromC;
27 extern int RowMajorStrg;
28 RowMajorStrg = 0;
29
30 CBLAS_CallFromC = 1;
31 if (layout == CblasColMajor)
32 {
33 F77_dger( &F77_M, &F77_N, &alpha, X, &F77_incX, Y, &F77_incY, A,
34 &F77_lda);
35 }
36 else if (layout == CblasRowMajor)
37 {
38 RowMajorStrg = 1;
39 F77_dger( &F77_N, &F77_M ,&alpha, Y, &F77_incY, X, &F77_incX, A,
40 &F77_lda);
41
42 }
43 else API_SUFFIX(cblas_xerbla)(1, "cblas_dger", "Illegal layout setting, %d\n", layout);
44 CBLAS_CallFromC = 0;
45 RowMajorStrg = 0;
46 return;
47 }