LAPACK
3.12.0
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
cblas_cherk.c
Go to the documentation of this file.
1
/*
2
*
3
* cblas_cherk.c
4
* This program is a C interface to cherk.
5
* Written by Keita Teranishi
6
* 4/8/1998
7
*
8
*/
9
10
#include "
cblas.h
"
11
#include "
cblas_f77.h
"
12
void
API_SUFFIX
(
cblas_cherk
)(
const
CBLAS_LAYOUT
layout,
const
CBLAS_UPLO
Uplo,
13
const
CBLAS_TRANSPOSE
Trans,
const
CBLAS_INT
N,
const
CBLAS_INT
K,
14
const
float
alpha,
const
void
*A,
const
CBLAS_INT
lda,
15
const
float
beta,
void
*C,
const
CBLAS_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
if
( Uplo ==
CblasUpper
) UL=
'U'
;
43
else
if
( Uplo ==
CblasLower
) UL=
'L'
;
44
else
45
{
46
API_SUFFIX
(
cblas_xerbla
)(2,
"cblas_cherk"
,
"Illegal Uplo setting, %d\n"
, Uplo);
47
CBLAS_CallFromC
= 0;
48
RowMajorStrg
= 0;
49
return
;
50
}
51
52
if
( Trans ==
CblasTrans
) TR =
'T'
;
53
else
if
( Trans ==
CblasConjTrans
) TR=
'C'
;
54
else
if
( Trans ==
CblasNoTrans
) TR=
'N'
;
55
else
56
{
57
API_SUFFIX
(
cblas_xerbla
)(3,
"cblas_cherk"
,
"Illegal Trans setting, %d\n"
, Trans);
58
CBLAS_CallFromC
= 0;
59
RowMajorStrg
= 0;
60
return
;
61
}
62
63
#ifdef F77_CHAR
64
F77_UL
= C2F_CHAR(&UL);
65
F77_TR
= C2F_CHAR(&TR);
66
#endif
67
68
F77_cherk
(
F77_UL
,
F77_TR
, &
F77_N
, &
F77_K
, &alpha, A, &
F77_lda
,
69
&beta, C, &
F77_ldc
);
70
}
else
if
(layout ==
CblasRowMajor
)
71
{
72
RowMajorStrg
= 1;
73
if
( Uplo ==
CblasUpper
) UL=
'L'
;
74
else
if
( Uplo ==
CblasLower
) UL=
'U'
;
75
else
76
{
77
API_SUFFIX
(
cblas_xerbla
)(3,
"cblas_cherk"
,
"Illegal Uplo setting, %d\n"
, Uplo);
78
CBLAS_CallFromC
= 0;
79
RowMajorStrg
= 0;
80
return
;
81
}
82
if
( Trans ==
CblasTrans
) TR =
'N'
;
83
else
if
( Trans ==
CblasConjTrans
) TR=
'N'
;
84
else
if
( Trans ==
CblasNoTrans
) TR=
'C'
;
85
else
86
{
87
API_SUFFIX
(
cblas_xerbla
)(3,
"cblas_cherk"
,
"Illegal Trans setting, %d\n"
, Trans);
88
CBLAS_CallFromC
= 0;
89
RowMajorStrg
= 0;
90
return
;
91
}
92
93
#ifdef F77_CHAR
94
F77_UL
= C2F_CHAR(&UL);
95
F77_SD
= C2F_CHAR(&SD);
96
#endif
97
98
F77_cherk
(
F77_UL
,
F77_TR
, &
F77_N
, &
F77_K
, &alpha, A, &
F77_lda
,
99
&beta, C, &
F77_ldc
);
100
}
101
else
API_SUFFIX
(
cblas_xerbla
)(1,
"cblas_cherk"
,
"Illegal layout setting, %d\n"
, layout);
102
CBLAS_CallFromC
= 0;
103
RowMajorStrg
= 0;
104
return
;
105
}
CBLAS_UPLO
CBLAS_UPLO
Definition
cblas.h:41
CblasLower
@ CblasLower
Definition
cblas.h:41
CblasUpper
@ CblasUpper
Definition
cblas.h:41
cblas_xerbla
void cblas_xerbla(CBLAS_INT p, const char *rout, const char *form,...)
Definition
cblas_xerbla.c:12
CBLAS_TRANSPOSE
CBLAS_TRANSPOSE
Definition
cblas.h:40
CblasNoTrans
@ CblasNoTrans
Definition
cblas.h:40
CblasTrans
@ CblasTrans
Definition
cblas.h:40
CblasConjTrans
@ CblasConjTrans
Definition
cblas.h:40
CBLAS_LAYOUT
CBLAS_LAYOUT
Definition
cblas.h:39
CblasColMajor
@ CblasColMajor
Definition
cblas.h:39
CblasRowMajor
@ CblasRowMajor
Definition
cblas.h:39
API_SUFFIX
#define API_SUFFIX(a)
Definition
cblas.h:57
CBLAS_INT
#define CBLAS_INT
Definition
cblas.h:24
cblas.h
F77_SD
#define F77_SD
F77_ldc
#define F77_ldc
F77_K
#define F77_K
cblas_cherk
void API_SUFFIX() cblas_cherk(const CBLAS_LAYOUT layout, const CBLAS_UPLO Uplo, const CBLAS_TRANSPOSE Trans, const CBLAS_INT N, const CBLAS_INT K, const float alpha, const void *A, const CBLAS_INT lda, const float beta, void *C, const CBLAS_INT ldc)
Definition
cblas_cherk.c:12
F77_TR
#define F77_TR
F77_N
#define F77_N
F77_lda
#define F77_lda
F77_UL
#define F77_UL
F77_INT
#define F77_INT
Definition
cblas_example2_64.c:7
F77_cherk
#define F77_cherk(...)
Definition
cblas_f77.h:409
cblas_f77.h
CBLAS_CallFromC
int CBLAS_CallFromC
Definition
cblas_globals.c:1
RowMajorStrg
int RowMajorStrg
Definition
cblas_globals.c:2
CBLAS
src
cblas_cherk.c
Generated on Tue Nov 28 2023 11:55:04 for LAPACK by
1.9.7