LAPACK
3.9.0
LAPACK: Linear Algebra PACKage
cblas_dsyrk.c
Go to the documentation of this file.
1
/*
2
*
3
* cblas_dsyrk.c
4
* This program is a C interface to dsyrk.
5
* Written by Keita Teranishi
6
* 4/8/1998
7
*
8
*/
9
10
#include "
cblas.h
"
11
#include "
cblas_f77.h
"
12
void
cblas_dsyrk
(
const
CBLAS_LAYOUT
layout,
const
CBLAS_UPLO
Uplo,
13
const
CBLAS_TRANSPOSE
Trans,
const
int
N
,
const
int
K,
14
const
double
alpha,
const
double
*A,
const
int
lda,
15
const
double
beta,
double
*C,
const
int
ldc)
16
{
17
char
UL, TR;
18
#ifdef F77_CHAR
19
F77_CHAR
F77_TR
,
F77_UL
;
20
#else
21
#define F77_TR &TR
22
#define F77_UL &UL
23
#endif
24
25
#ifdef F77_INT
26
F77_INT
F77_N
=
N
,
F77_K
=K,
F77_lda
=lda;
27
F77_INT
F77_ldc
=ldc;
28
#else
29
#define F77_N N
30
#define F77_K K
31
#define F77_lda lda
32
#define F77_ldc ldc
33
#endif
34
35
extern
int
CBLAS_CallFromC
;
36
extern
int
RowMajorStrg
;
37
RowMajorStrg
= 0;
38
CBLAS_CallFromC
= 1;
39
40
if
( layout ==
CblasColMajor
)
41
{
42
43
if
( Uplo ==
CblasUpper
) UL=
'U'
;
44
else
if
( Uplo ==
CblasLower
) UL=
'L'
;
45
else
46
{
47
cblas_xerbla
(2,
"cblas_dsyrk"
,
"Illegal Uplo setting, %d\n"
, Uplo);
48
CBLAS_CallFromC
= 0;
49
RowMajorStrg
= 0;
50
return
;
51
}
52
53
if
( Trans ==
CblasTrans
) TR =
'T'
;
54
else
if
( Trans ==
CblasConjTrans
) TR=
'C'
;
55
else
if
( Trans ==
CblasNoTrans
) TR=
'N'
;
56
else
57
{
58
cblas_xerbla
(3,
"cblas_dsyrk"
,
"Illegal Trans setting, %d\n"
, Trans);
59
CBLAS_CallFromC
= 0;
60
RowMajorStrg
= 0;
61
return
;
62
}
63
64
65
#ifdef F77_CHAR
66
F77_UL
= C2F_CHAR(&UL);
67
F77_TR
= C2F_CHAR(&TR);
68
#endif
69
70
F77_dsyrk
(
F77_UL
,
F77_TR
, &
F77_N
, &
F77_K
, &alpha, A, &
F77_lda
,
71
&beta, C, &
F77_ldc
);
72
}
else
if
(layout ==
CblasRowMajor
)
73
{
74
RowMajorStrg
= 1;
75
if
( Uplo ==
CblasUpper
) UL=
'L'
;
76
else
if
( Uplo ==
CblasLower
) UL=
'U'
;
77
else
78
{
79
cblas_xerbla
(3,
"cblas_dsyrk"
,
"Illegal Uplo setting, %d\n"
, Uplo);
80
CBLAS_CallFromC
= 0;
81
RowMajorStrg
= 0;
82
return
;
83
}
84
if
( Trans ==
CblasTrans
) TR =
'N'
;
85
else
if
( Trans ==
CblasConjTrans
) TR=
'N'
;
86
else
if
( Trans ==
CblasNoTrans
) TR=
'T'
;
87
else
88
{
89
cblas_xerbla
(3,
"cblas_dsyrk"
,
"Illegal Trans setting, %d\n"
, Trans);
90
CBLAS_CallFromC
= 0;
91
RowMajorStrg
= 0;
92
return
;
93
}
94
95
#ifdef F77_CHAR
96
F77_UL
= C2F_CHAR(&UL);
97
F77_TR
= C2F_CHAR(&TR);
98
#endif
99
100
F77_dsyrk
(
F77_UL
,
F77_TR
, &
F77_N
, &
F77_K
, &alpha, A, &
F77_lda
,
101
&beta, C, &
F77_ldc
);
102
}
103
else
cblas_xerbla
(1,
"cblas_dsyrk"
,
"Illegal layout setting, %d\n"
, layout);
104
CBLAS_CallFromC
= 0;
105
RowMajorStrg
= 0;
106
return
;
107
}
108
cblas_f77.h
CBLAS_TRANSPOSE
CBLAS_TRANSPOSE
Definition:
cblas.h:20
F77_K
#define F77_K
cblas_xerbla
void cblas_xerbla(int p, const char *rout, const char *form,...)
Definition:
cblas_xerbla.c:8
CblasUpper
Definition:
cblas.h:21
cblas_dsyrk
void cblas_dsyrk(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE Trans, const int N, const int K, const double alpha, const double *A, const int lda, const double beta, double *C, const int ldc)
Definition:
cblas_dsyrk.c:12
F77_dsyrk
#define F77_dsyrk
Definition:
cblas_f77.h:175
F77_ldc
#define F77_ldc
F77_TR
#define F77_TR
CblasColMajor
Definition:
cblas.h:19
F77_UL
#define F77_UL
F77_N
#define F77_N
CblasTrans
Definition:
cblas.h:20
CBLAS_CallFromC
int CBLAS_CallFromC
Definition:
cblas_globals.c:1
cblas.h
CBLAS_LAYOUT
CBLAS_LAYOUT
Definition:
cblas.h:19
CblasRowMajor
Definition:
cblas.h:19
RowMajorStrg
int RowMajorStrg
Definition:
cblas_globals.c:2
F77_lda
#define F77_lda
CblasNoTrans
Definition:
cblas.h:20
CblasLower
Definition:
cblas.h:21
CBLAS_UPLO
CBLAS_UPLO
Definition:
cblas.h:21
N
#define N
Definition:
example_user.c:10
CblasConjTrans
Definition:
cblas.h:20
CBLAS
src
cblas_dsyrk.c
Generated on Wed May 5 2021 15:10:30 for LAPACK by
1.8.16