Skip to content

Commit 02b71fc

Browse files
committed
Add interfaces cblas_[c,z]rotg, cblas_[cs,zd]rot
Closes #473
1 parent 4f5e185 commit 02b71fc

File tree

8 files changed

+107
-13
lines changed

8 files changed

+107
-13
lines changed

CBLAS/include/cblas.h

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,13 @@ void cblas_zaxpy(const CBLAS_INT N, const void *alpha, const void *X,
143143
/*
144144
* Routines with S and D prefix only
145145
*/
146-
void cblas_srotg(float *a, float *b, float *c, float *s);
147146
void cblas_srotmg(float *d1, float *d2, float *b1, const float b2, float *P);
148-
void cblas_srot(const CBLAS_INT N, float *X, const CBLAS_INT incX,
149-
float *Y, const CBLAS_INT incY, const float c, const float s);
150147
void cblas_srotm(const CBLAS_INT N, float *X, const CBLAS_INT incX,
151-
float *Y, const CBLAS_INT incY, const float *P);
152-
153-
void cblas_drotg(double *a, double *b, double *c, double *s);
148+
float *Y, const CBLAS_INT incY, const float *P);
154149
void cblas_drotmg(double *d1, double *d2, double *b1, const double b2, double *P);
155-
void cblas_drot(const CBLAS_INT N, double *X, const CBLAS_INT incX,
156-
double *Y, const CBLAS_INT incY, const double c, const double s);
157150
void cblas_drotm(const CBLAS_INT N, double *X, const CBLAS_INT incX,
158-
double *Y, const CBLAS_INT incY, const double *P);
151+
double *Y, const CBLAS_INT incY, const double *P);
152+
159153

160154

161155
/*
@@ -168,6 +162,20 @@ void cblas_zscal(const CBLAS_INT N, const void *alpha, void *X, const CBLAS_INT
168162
void cblas_csscal(const CBLAS_INT N, const float alpha, void *X, const CBLAS_INT incX);
169163
void cblas_zdscal(const CBLAS_INT N, const double alpha, void *X, const CBLAS_INT incX);
170164

165+
void cblas_srotg(float *a, float *b, float *c, float *s);
166+
void cblas_drotg(double *a, double *b, double *c, double *s);
167+
void cblas_crotg(void *a, void *b, float *c, void *s);
168+
void cblas_zrotg(void *a, void *b, double *c, void *s);
169+
170+
void cblas_srot(const CBLAS_INT N, float *X, const CBLAS_INT incX,
171+
float *Y, const CBLAS_INT incY, const float c, const float s);
172+
void cblas_drot(const CBLAS_INT N, double *X, const CBLAS_INT incX,
173+
double *Y, const CBLAS_INT incY, const double c, const double s);
174+
void cblas_csrot(const CBLAS_INT N, void *X, const CBLAS_INT incX,
175+
void *Y, const CBLAS_INT incY, const float c, const float s);
176+
void cblas_zdrot(const CBLAS_INT N, void *X, const CBLAS_INT incX,
177+
void *Y, const CBLAS_INT incY, const double c, const double s);
178+
171179
/*
172180
* ===========================================================================
173181
* Prototypes for level 2 BLAS

CBLAS/include/cblas_f77.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@
9393
#define F77_dznrm2_sub_base F77_GLOBAL(dznrm2sub,DZNRM2SUB)
9494
#define F77_dzasum_sub_base F77_GLOBAL(dzasumsub,DZASUMSUB)
9595
#define F77_sdsdot_sub_base F77_GLOBAL(sdsdotsub,SDSDOTSUB)
96+
#define F77_crotg_base F77_GLOBAL(crotg, CROTG)
97+
#define F77_csrot_base F77_GLOBAL(csrot, CSROT)
98+
#define F77_zrotg_base F77_GLOBAL(zrotg, ZROTG)
99+
#define F77_zdrot_base F77_GLOBAL(zdrot, ZDROT)
100+
96101
/*
97102
* Level 2 BLAS
98103
*/
@@ -200,6 +205,7 @@
200205
* Level 1 Fortran variadic definitions
201206
*/
202207

208+
203209
/* Single Precision */
204210

205211
#define F77_srot(...) F77_srot_base(__VA_ARGS__)
@@ -235,6 +241,8 @@
235241

236242
/* Single Complex Precision */
237243

244+
#define F77_crotg(...) F77_crotg_base(__VA_ARGS__)
245+
#define F77_csrot(...) F77_csrot_base(__VA_ARGS__)
238246
#define F77_cswap(...) F77_cswap_base(__VA_ARGS__)
239247
#define F77_ccopy(...) F77_ccopy_base(__VA_ARGS__)
240248
#define F77_caxpy(...) F77_caxpy_base(__VA_ARGS__)
@@ -249,6 +257,8 @@
249257

250258
/* Double Complex Precision */
251259

260+
#define F77_zrotg(...) F77_zrotg_base(__VA_ARGS__)
261+
#define F77_zdrot(...) F77_zdrot_base(__VA_ARGS__)
252262
#define F77_zswap(...) F77_zswap_base(__VA_ARGS__)
253263
#define F77_zcopy(...) F77_zcopy_base(__VA_ARGS__)
254264
#define F77_zaxpy(...) F77_zaxpy_base(__VA_ARGS__)
@@ -579,6 +589,8 @@ void F77_xerbla_base(FCHAR, void *
579589

580590
/* Single Complex Precision */
581591

592+
void F77_crotg_base(void *, void *, float *, void *);
593+
void F77_csrot_base(FINT, void *X, FINT, void *, FINT, const float *, const float *);
582594
void F77_cswap_base( FINT, void *, FINT, void *, FINT);
583595
void F77_ccopy_base( FINT, const void *, FINT, void *, FINT);
584596
void F77_caxpy_base( FINT, const void *, const void *, FINT, void *, FINT);
@@ -593,6 +605,8 @@ void F77_xerbla_base(FCHAR, void *
593605

594606
/* Double Complex Precision */
595607

608+
void F77_zrotg_base(void *, void *, double *, void *);
609+
void F77_zdrot_base(FINT, void *X, FINT, void *, FINT, const double *, const double *);
596610
void F77_zswap_base( FINT, void *, FINT, void *, FINT);
597611
void F77_zcopy_base( FINT, const void *, FINT, void *, FINT);
598612
void F77_zaxpy_base( FINT, const void *, const void *, FINT, void *, FINT);

CBLAS/src/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ set(DLEV1 cblas_drotg.c cblas_drotmg.c cblas_drot.c cblas_drotm.c
2626
dasumsub.f idamaxsub.f)
2727

2828
# Files for level 1 single precision complex
29-
set(CLEV1 cblas_cswap.c cblas_cscal.c cblas_csscal.c cblas_ccopy.c
29+
set(CLEV1 cblas_crotg.c cblas_csrot.c
30+
cblas_cswap.c cblas_cscal.c cblas_csscal.c cblas_ccopy.c
3031
cblas_caxpy.c cblas_cdotu_sub.c cblas_cdotc_sub.c
3132
cblas_icamax.c cdotcsub.f cdotusub.f icamaxsub.f)
3233

3334
# Files for level 1 double precision complex
34-
set(ZLEV1 cblas_zswap.c cblas_zscal.c cblas_zdscal.c cblas_zcopy.c
35+
set(ZLEV1 cblas_zrotg.c cblas_zdrot.c
36+
cblas_zswap.c cblas_zscal.c cblas_zdscal.c cblas_zcopy.c
3537
cblas_zaxpy.c cblas_zdotu_sub.c cblas_zdotc_sub.c cblas_dznrm2.c
3638
cblas_dzasum.c cblas_izamax.c zdotcsub.f zdotusub.f
3739
dzasumsub.f dznrm2sub.f izamaxsub.f)

CBLAS/src/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,14 @@ dlev1 = cblas_drotg.o cblas_drotmg.o cblas_drot.o cblas_drotm.o \
3636
dasumsub.o idamaxsub.o
3737

3838
# Files for level 1 single precision complex
39-
clev1 = cblas_cswap.o cblas_cscal.o cblas_csscal.o cblas_ccopy.o \
39+
clev1 = cblas_crotg.o cblas_csrot.o \
40+
cblas_cswap.o cblas_cscal.o cblas_csscal.o cblas_ccopy.o \
4041
cblas_caxpy.o cblas_cdotu_sub.o cblas_cdotc_sub.o \
4142
cblas_icamax.o cdotcsub.o cdotusub.o icamaxsub.o
4243

4344
# Files for level 1 double precision complex
44-
zlev1 = cblas_zswap.o cblas_zscal.o cblas_zdscal.o cblas_zcopy.o \
45+
zlev1 = cblas_zrotg.o cblas_zdrot.o \
46+
cblas_zswap.o cblas_zscal.o cblas_zdscal.o cblas_zcopy.o \
4547
cblas_zaxpy.o cblas_zdotu_sub.o cblas_zdotc_sub.o cblas_dznrm2.o \
4648
cblas_dzasum.o cblas_izamax.o zdotcsub.o zdotusub.o \
4749
dzasumsub.o dznrm2sub.o izamaxsub.o

CBLAS/src/cblas_crotg.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* cblas_crotg.c
3+
*
4+
* The program is a C interface to crotg.
5+
*
6+
*/
7+
#include "cblas.h"
8+
#include "cblas_f77.h"
9+
void cblas_crotg(void *a, void *b, float *c, void *s)
10+
{
11+
F77_crotg(a,b,c,s);
12+
}
13+

CBLAS/src/cblas_csrot.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* cblas_csrot.c
3+
*
4+
* The program is a C interface to csrot.
5+
*
6+
*/
7+
#include "cblas.h"
8+
#include "cblas_f77.h"
9+
void cblas_csrot(const CBLAS_INT N, void *X, const CBLAS_INT incX,
10+
void *Y, const CBLAS_INT incY, const float c, const float s)
11+
{
12+
#ifdef F77_INT
13+
F77_INT F77_N=N, F77_incX=incX, F77_incY=incY;
14+
#else
15+
#define F77_N N
16+
#define F77_incX incX
17+
#define F77_incY incY
18+
#endif
19+
F77_csrot(&F77_N, X, &F77_incX, Y, &F77_incY, &c, &s);
20+
return;
21+
}

CBLAS/src/cblas_zdrot.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* cblas_zdrot.c
3+
*
4+
* The program is a C interface to zdrot.
5+
*
6+
*/
7+
#include "cblas.h"
8+
#include "cblas_f77.h"
9+
void cblas_zdrot(const CBLAS_INT N, void *X, const CBLAS_INT incX,
10+
void *Y, const CBLAS_INT incY, const double c, const double s)
11+
{
12+
#ifdef F77_INT
13+
F77_INT F77_N=N, F77_incX=incX, F77_incY=incY;
14+
#else
15+
#define F77_N N
16+
#define F77_incX incX
17+
#define F77_incY incY
18+
#endif
19+
F77_zdrot(&F77_N, X, &F77_incX, Y, &F77_incY, &c, &s);
20+
return;
21+
}

CBLAS/src/cblas_zrotg.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
* cblas_zrotg.c
3+
*
4+
* The program is a C interface to zrotg.
5+
*
6+
*/
7+
#include "cblas.h"
8+
#include "cblas_f77.h"
9+
void cblas_zrotg(void *a, void *b, double *c, void *s)
10+
{
11+
F77_zrotg(a,b,c,s);
12+
}
13+

0 commit comments

Comments
 (0)