Skip to content

Commit baba851

Browse files
author
jason
committed
Move LAPACK trunk into position.
0 parents  commit baba851

File tree

4,065 files changed

+2004332
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,065 files changed

+2004332
-0
lines changed

BLAS/SRC/Makefile

+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
include ../../make.inc
2+
3+
#######################################################################
4+
# This is the makefile to create a library for the BLAS.
5+
# The files are grouped as follows:
6+
#
7+
# SBLAS1 -- Single precision real BLAS routines
8+
# CBLAS1 -- Single precision complex BLAS routines
9+
# DBLAS1 -- Double precision real BLAS routines
10+
# ZBLAS1 -- Double precision complex BLAS routines
11+
#
12+
# CB1AUX -- Real BLAS routines called by complex routines
13+
# ZB1AUX -- D.P. real BLAS routines called by d.p. complex
14+
# routines
15+
#
16+
# ALLBLAS -- Auxiliary routines for Level 2 and 3 BLAS
17+
#
18+
# SBLAS2 -- Single precision real BLAS2 routines
19+
# CBLAS2 -- Single precision complex BLAS2 routines
20+
# DBLAS2 -- Double precision real BLAS2 routines
21+
# ZBLAS2 -- Double precision complex BLAS2 routines
22+
#
23+
# SBLAS3 -- Single precision real BLAS3 routines
24+
# CBLAS3 -- Single precision complex BLAS3 routines
25+
# DBLAS3 -- Double precision real BLAS3 routines
26+
# ZBLAS3 -- Double precision complex BLAS3 routines
27+
#
28+
# The library can be set up to include routines for any combination
29+
# of the four precisions. To create or add to the library, enter make
30+
# followed by one or more of the precisions desired. Some examples:
31+
# make single
32+
# make single complex
33+
# make single double complex complex16
34+
# Note that these commands are not safe for parallel builds.
35+
#
36+
# Alternatively, the commands
37+
# make all
38+
# or
39+
# make
40+
# without any arguments creates a library of all four precisions.
41+
# The name of the library is held in BLASLIB, which is set in the
42+
# top-level make.inc
43+
#
44+
# To remove the object files after the library is created, enter
45+
# make clean
46+
# To force the source files to be recompiled, enter, for example,
47+
# make single FRC=FRC
48+
#
49+
#---------------------------------------------------------------------
50+
#
51+
# Edward Anderson, University of Tennessee
52+
# March 26, 1990
53+
# Susan Ostrouchov, Last updated September 30, 1994
54+
# ejr, May 2006.
55+
#
56+
#######################################################################
57+
58+
all: $(BLASLIB)
59+
60+
#---------------------------------------------------------
61+
# Comment out the next 6 definitions if you already have
62+
# the Level 1 BLAS.
63+
#---------------------------------------------------------
64+
SBLAS1 = isamax.o sasum.o saxpy.o scopy.o sdot.o snrm2.o \
65+
srot.o srotg.o sscal.o sswap.o sdsdot.o srotmg.o srotm.o
66+
$(SBLAS1): $(FRC)
67+
68+
CBLAS1 = scabs1.o scasum.o scnrm2.o icamax.o caxpy.o ccopy.o \
69+
cdotc.o cdotu.o csscal.o crotg.o cscal.o cswap.o csrot.o
70+
$(CBLAS1): $(FRC)
71+
72+
DBLAS1 = idamax.o dasum.o daxpy.o dcopy.o ddot.o dnrm2.o \
73+
drot.o drotg.o dscal.o dswap.o drotmg.o drotm.o
74+
$(DBLAS1): $(FRC)
75+
76+
ZBLAS1 = dcabs1.o dzasum.o dznrm2.o izamax.o zaxpy.o zcopy.o \
77+
zdotc.o zdotu.o zdscal.o zrotg.o zscal.o zswap.o zdrot.o
78+
$(ZBLAS1): $(FRC)
79+
80+
CB1AUX = isamax.o sasum.o saxpy.o scopy.o snrm2.o sscal.o
81+
$(CB1AUX): $(FRC)
82+
83+
ZB1AUX = idamax.o dasum.o daxpy.o dcopy.o dnrm2.o dscal.o
84+
$(ZB1AUX): $(FRC)
85+
86+
#---------------------------------------------------------------------
87+
# The following line defines auxiliary routines needed by both the
88+
# Level 2 and Level 3 BLAS. Comment it out only if you already have
89+
# both the Level 2 and 3 BLAS.
90+
#---------------------------------------------------------------------
91+
ALLBLAS = lsame.o xerbla.o xerbla_array.o ila_len_trim.o
92+
$(ALLBLAS) : $(FRC)
93+
94+
#---------------------------------------------------------
95+
# Comment out the next 4 definitions if you already have
96+
# the Level 2 BLAS.
97+
#---------------------------------------------------------
98+
SBLAS2 = sgemv.o sgbmv.o ssymv.o ssbmv.o sspmv.o \
99+
strmv.o stbmv.o stpmv.o strsv.o stbsv.o stpsv.o \
100+
sger.o ssyr.o sspr.o ssyr2.o sspr2.o
101+
$(SBLAS2): $(FRC)
102+
103+
CBLAS2 = cgemv.o cgbmv.o chemv.o chbmv.o chpmv.o \
104+
ctrmv.o ctbmv.o ctpmv.o ctrsv.o ctbsv.o ctpsv.o \
105+
cgerc.o cgeru.o cher.o chpr.o cher2.o chpr2.o
106+
$(CBLAS2): $(FRC)
107+
108+
DBLAS2 = dgemv.o dgbmv.o dsymv.o dsbmv.o dspmv.o \
109+
dtrmv.o dtbmv.o dtpmv.o dtrsv.o dtbsv.o dtpsv.o \
110+
dger.o dsyr.o dspr.o dsyr2.o dspr2.o
111+
$(DBLAS2): $(FRC)
112+
113+
ZBLAS2 = zgemv.o zgbmv.o zhemv.o zhbmv.o zhpmv.o \
114+
ztrmv.o ztbmv.o ztpmv.o ztrsv.o ztbsv.o ztpsv.o \
115+
zgerc.o zgeru.o zher.o zhpr.o zher2.o zhpr2.o
116+
$(ZBLAS2): $(FRC)
117+
118+
#---------------------------------------------------------
119+
# Comment out the next 4 definitions if you already have
120+
# the Level 3 BLAS.
121+
#---------------------------------------------------------
122+
SBLAS3 = sgemm.o ssymm.o ssyrk.o ssyr2k.o strmm.o strsm.o
123+
$(SBLAS3): $(FRC)
124+
125+
CBLAS3 = cgemm.o csymm.o csyrk.o csyr2k.o ctrmm.o ctrsm.o \
126+
chemm.o cherk.o cher2k.o
127+
$(CBLAS3): $(FRC)
128+
129+
DBLAS3 = dgemm.o dsymm.o dsyrk.o dsyr2k.o dtrmm.o dtrsm.o
130+
$(DBLAS3): $(FRC)
131+
132+
ZBLAS3 = zgemm.o zsymm.o zsyrk.o zsyr2k.o ztrmm.o ztrsm.o \
133+
zhemm.o zherk.o zher2k.o
134+
$(ZBLAS3): $(FRC)
135+
136+
ALLOBJ=$(SBLAS1) $(SBLAS2) $(SBLAS3) $(DBLAS1) $(DBLAS2) $(DBLAS3) \
137+
$(CBLAS1) $(CB1AUX) $(CBLAS2) $(CBLAS3) $(ZBLAS1) $(ZB1AUX) \
138+
$(ZBLAS2) $(ZBLAS3) $(ALLBLAS)
139+
140+
$(BLASLIB): $(ALLOBJ)
141+
$(ARCH) $(ARCHFLAGS) $@ $(ALLOBJ)
142+
$(RANLIB) $@
143+
144+
single: $(SBLAS1) $(ALLBLAS) $(SBLAS2) $(SBLAS3)
145+
$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(SBLAS1) $(ALLBLAS) \
146+
$(SBLAS2) $(SBLAS3)
147+
$(RANLIB) $(BLASLIB)
148+
149+
double: $(DBLAS1) $(ALLBLAS) $(DBLAS2) $(DBLAS3)
150+
$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(DBLAS1) $(ALLBLAS) \
151+
$(DBLAS2) $(DBLAS3)
152+
$(RANLIB) $(BLASLIB)
153+
154+
complex: $(CBLAS1) $(CB1AUX) $(ALLBLAS) $(CBLAS2) $(CBLAS3)
155+
$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(CBLAS1) $(CB1AUX) \
156+
$(ALLBLAS) $(CBLAS2) $(CBLAS3)
157+
$(RANLIB) $(BLASLIB)
158+
159+
complex16: $(ZBLAS1) $(ZB1AUX) $(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
160+
$(ARCH) $(ARCHFLAGS) $(BLASLIB) $(ZBLAS1) $(ZB1AUX) \
161+
$(ALLBLAS) $(ZBLAS2) $(ZBLAS3)
162+
$(RANLIB) $(BLASLIB)
163+
164+
FRC:
165+
@FRC=$(FRC)
166+
167+
clean:
168+
rm -f *.o
169+
170+
.f.o:
171+
$(FORTRAN) $(OPTS) -c $< -o $@

BLAS/SRC/caxpy.f

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
SUBROUTINE CAXPY(N,CA,CX,INCX,CY,INCY)
2+
* .. Scalar Arguments ..
3+
COMPLEX CA
4+
INTEGER INCX,INCY,N
5+
* ..
6+
* .. Array Arguments ..
7+
COMPLEX CX(*),CY(*)
8+
* ..
9+
*
10+
* Purpose
11+
* =======
12+
*
13+
* CAXPY constant times a vector plus a vector.
14+
*
15+
* Further Details
16+
* ===============
17+
*
18+
* jack dongarra, linpack, 3/11/78.
19+
* modified 12/3/93, array(1) declarations changed to array(*)
20+
*
21+
* .. Local Scalars ..
22+
INTEGER I,IX,IY
23+
* ..
24+
* .. External Functions ..
25+
REAL SCABS1
26+
EXTERNAL SCABS1
27+
* ..
28+
IF (N.LE.0) RETURN
29+
IF (SCABS1(CA).EQ.0.0E+0) RETURN
30+
IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
31+
*
32+
* code for unequal increments or equal increments
33+
* not equal to 1
34+
*
35+
IX = 1
36+
IY = 1
37+
IF (INCX.LT.0) IX = (-N+1)*INCX + 1
38+
IF (INCY.LT.0) IY = (-N+1)*INCY + 1
39+
DO 10 I = 1,N
40+
CY(IY) = CY(IY) + CA*CX(IX)
41+
IX = IX + INCX
42+
IY = IY + INCY
43+
10 CONTINUE
44+
RETURN
45+
*
46+
* code for both increments equal to 1
47+
*
48+
20 DO 30 I = 1,N
49+
CY(I) = CY(I) + CA*CX(I)
50+
30 CONTINUE
51+
RETURN
52+
END

BLAS/SRC/ccopy.f

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
SUBROUTINE CCOPY(N,CX,INCX,CY,INCY)
2+
* .. Scalar Arguments ..
3+
INTEGER INCX,INCY,N
4+
* ..
5+
* .. Array Arguments ..
6+
COMPLEX CX(*),CY(*)
7+
* ..
8+
*
9+
* Purpose
10+
* =======
11+
*
12+
* CCOPY copies a vector x to a vector y.
13+
*
14+
* Further Details
15+
* ===============
16+
*
17+
* jack dongarra, linpack, 3/11/78.
18+
* modified 12/3/93, array(1) declarations changed to array(*)
19+
*
20+
* .. Local Scalars ..
21+
INTEGER I,IX,IY
22+
* ..
23+
IF (N.LE.0) RETURN
24+
IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
25+
*
26+
* code for unequal increments or equal increments
27+
* not equal to 1
28+
*
29+
IX = 1
30+
IY = 1
31+
IF (INCX.LT.0) IX = (-N+1)*INCX + 1
32+
IF (INCY.LT.0) IY = (-N+1)*INCY + 1
33+
DO 10 I = 1,N
34+
CY(IY) = CX(IX)
35+
IX = IX + INCX
36+
IY = IY + INCY
37+
10 CONTINUE
38+
RETURN
39+
*
40+
* code for both increments equal to 1
41+
*
42+
20 DO 30 I = 1,N
43+
CY(I) = CX(I)
44+
30 CONTINUE
45+
RETURN
46+
END

BLAS/SRC/cdotc.f

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
COMPLEX FUNCTION CDOTC(N,CX,INCX,CY,INCY)
2+
* .. Scalar Arguments ..
3+
INTEGER INCX,INCY,N
4+
* ..
5+
* .. Array Arguments ..
6+
COMPLEX CX(*),CY(*)
7+
* ..
8+
*
9+
* Purpose
10+
* =======
11+
*
12+
* forms the dot product of two vectors, conjugating the first
13+
* vector.
14+
*
15+
* Further Details
16+
* ===============
17+
*
18+
* jack dongarra, linpack, 3/11/78.
19+
* modified 12/3/93, array(1) declarations changed to array(*)
20+
*
21+
* .. Local Scalars ..
22+
COMPLEX CTEMP
23+
INTEGER I,IX,IY
24+
* ..
25+
* .. Intrinsic Functions ..
26+
INTRINSIC CONJG
27+
* ..
28+
CTEMP = (0.0,0.0)
29+
CDOTC = (0.0,0.0)
30+
IF (N.LE.0) RETURN
31+
IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
32+
*
33+
* code for unequal increments or equal increments
34+
* not equal to 1
35+
*
36+
IX = 1
37+
IY = 1
38+
IF (INCX.LT.0) IX = (-N+1)*INCX + 1
39+
IF (INCY.LT.0) IY = (-N+1)*INCY + 1
40+
DO 10 I = 1,N
41+
CTEMP = CTEMP + CONJG(CX(IX))*CY(IY)
42+
IX = IX + INCX
43+
IY = IY + INCY
44+
10 CONTINUE
45+
CDOTC = CTEMP
46+
RETURN
47+
*
48+
* code for both increments equal to 1
49+
*
50+
20 DO 30 I = 1,N
51+
CTEMP = CTEMP + CONJG(CX(I))*CY(I)
52+
30 CONTINUE
53+
CDOTC = CTEMP
54+
RETURN
55+
END

BLAS/SRC/cdotu.f

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
COMPLEX FUNCTION CDOTU(N,CX,INCX,CY,INCY)
2+
* .. Scalar Arguments ..
3+
INTEGER INCX,INCY,N
4+
* ..
5+
* .. Array Arguments ..
6+
COMPLEX CX(*),CY(*)
7+
* ..
8+
*
9+
* Purpose
10+
* =======
11+
*
12+
* CDOTU forms the dot product of two vectors.
13+
*
14+
* Further Details
15+
* ===============
16+
*
17+
* jack dongarra, linpack, 3/11/78.
18+
* modified 12/3/93, array(1) declarations changed to array(*)
19+
*
20+
* .. Local Scalars ..
21+
COMPLEX CTEMP
22+
INTEGER I,IX,IY
23+
* ..
24+
CTEMP = (0.0,0.0)
25+
CDOTU = (0.0,0.0)
26+
IF (N.LE.0) RETURN
27+
IF (INCX.EQ.1 .AND. INCY.EQ.1) GO TO 20
28+
*
29+
* code for unequal increments or equal increments
30+
* not equal to 1
31+
*
32+
IX = 1
33+
IY = 1
34+
IF (INCX.LT.0) IX = (-N+1)*INCX + 1
35+
IF (INCY.LT.0) IY = (-N+1)*INCY + 1
36+
DO 10 I = 1,N
37+
CTEMP = CTEMP + CX(IX)*CY(IY)
38+
IX = IX + INCX
39+
IY = IY + INCY
40+
10 CONTINUE
41+
CDOTU = CTEMP
42+
RETURN
43+
*
44+
* code for both increments equal to 1
45+
*
46+
20 DO 30 I = 1,N
47+
CTEMP = CTEMP + CX(I)*CY(I)
48+
30 CONTINUE
49+
CDOTU = CTEMP
50+
RETURN
51+
END

0 commit comments

Comments
 (0)