@@ -21,6 +21,27 @@ module stdlib_linalg_blas_aux
21
21
#:endfor
22
22
end interface stdlib_cabs1
23
23
24
+ #:for rk,rt,ri in RC_KINDS_TYPES
25
+ interface stdlib_i${ri}$amax
26
+ #:for ik,it,ii in LINALG_INT_KINDS_TYPES
27
+ module procedure stdlib${ii}$_i${ri}$amax
28
+ #:endfor
29
+ end interface stdlib_i${ri}$amax
30
+ #:endfor
31
+
32
+ interface stdlib_xerbla
33
+ #:for ik,it,ii in LINALG_INT_KINDS_TYPES
34
+ module procedure stdlib${ii}$_xerbla
35
+ #:endfor
36
+ end interface stdlib_xerbla
37
+
38
+ interface stdlib_xerbla_array
39
+ #:for ik,it,ii in LINALG_INT_KINDS_TYPES
40
+ module procedure stdlib${ii}$_xerbla_array
41
+ #:endfor
42
+ end interface stdlib_xerbla_array
43
+
44
+
24
45
contains
25
46
26
47
@@ -57,13 +78,13 @@ module stdlib_linalg_blas_aux
57
78
stdlib_lsame = ca == cb
58
79
if (stdlib_lsame) return
59
80
! now test for equivalence if both characters are alphabetic.
60
- zcode = ichar('Z')
81
+ zcode = ichar('Z',kind=ilp )
61
82
! use 'z' rather than 'a' so that ascii can be detected on prime
62
83
! machines, on which ichar returns a value with bit 8 set.
63
84
! ichar('a') on prime machines returns 193 which is the same as
64
85
! ichar('a') on an ebcdic machine.
65
- inta = ichar(ca)
66
- intb = ichar(cb)
86
+ inta = ichar(ca,kind=ilp )
87
+ intb = ichar(cb,kind=ilp )
67
88
if (zcode==90 .or. zcode==122) then
68
89
! ascii is assumed - zcode is the ascii code of either lower or
69
90
! upper case 'z'.
@@ -86,7 +107,8 @@ module stdlib_linalg_blas_aux
86
107
! return
87
108
end function stdlib_lsame
88
109
89
- pure subroutine stdlib_xerbla( srname, info )
110
+ #:for ik,it,ii in LINALG_INT_KINDS_TYPES
111
+ pure subroutine stdlib${ii}$_xerbla( srname, info )
90
112
!! XERBLA is an error handler for the LAPACK routines.
91
113
!! It is called by an LAPACK routine if an input parameter has an
92
114
!! invalid value. A message is printed and execution stops.
@@ -97,17 +119,17 @@ module stdlib_linalg_blas_aux
97
119
! -- univ. of california berkeley, univ. of colorado denver and nag ltd..--
98
120
! Scalar Arguments
99
121
character(len=*), intent(in) :: srname
100
- integer(ilp ), intent(in) :: info
122
+ integer(${ik}$ ), intent(in) :: info
101
123
! =====================================================================
102
124
! Intrinsic Functions
103
125
intrinsic :: len_trim
104
126
! Executable Statements
105
127
9999 format( ' ** ON ENTRY TO ', a, ' PARAMETER NUMBER ', i2, ' HAD ','AN ILLEGAL VALUE' )
106
128
107
- end subroutine stdlib_xerbla
129
+ end subroutine stdlib${ii}$_xerbla
108
130
109
131
110
- pure subroutine stdlib_xerbla_array (srname_array, srname_len, info)
132
+ pure subroutine stdlib${ii}$_xerbla_array (srname_array, srname_len, info)
111
133
!! XERBLA_ARRAY assists other languages in calling XERBLA, the LAPACK
112
134
!! and BLAS error handler. Rather than taking a Fortran string argument
113
135
!! as the function's name, XERBLA_ARRAY takes an array of single
@@ -128,12 +150,12 @@ module stdlib_linalg_blas_aux
128
150
! -- reference blas is a software package provided by univ. of tennessee, --
129
151
! -- univ. of california berkeley, univ. of colorado denver and nag ltd..--
130
152
! Scalar Arguments
131
- integer(ilp ), intent(in) :: srname_len, info
153
+ integer(${ik}$ ), intent(in) :: srname_len, info
132
154
! Array Arguments
133
155
character(1), intent(in) :: srname_array(srname_len)
134
156
! =====================================================================
135
157
! Local Scalars
136
- integer(ilp ) :: i
158
+ integer(${ik}$ ) :: i
137
159
! Local Arrays
138
160
character*32 srname
139
161
! Intrinsic Functions
@@ -145,34 +167,34 @@ module stdlib_linalg_blas_aux
145
167
end do
146
168
call stdlib_xerbla( srname, info )
147
169
return
148
- end subroutine stdlib_xerbla_array
170
+ end subroutine stdlib${ii}$_xerbla_array
149
171
150
172
#:for rk,rt,ri in REAL_KINDS_TYPES
151
- pure integer(ilp ) function stdlib_i${ ri}$amax(n,dx,incx)
173
+ pure integer(${ik}$ ) function stdlib${ii}$_i${ ri}$amax(n,dx,incx) result(iamax )
152
174
!! IDAMAX: finds the index of the first element having maximum absolute value.
153
175
! -- reference blas level1 routine --
154
176
! -- reference blas is a software package provided by univ. of tennessee, --
155
177
! -- univ. of california berkeley, univ. of colorado denver and nag ltd..--
156
178
! Scalar Arguments
157
- integer(ilp ), intent(in) :: incx, n
179
+ integer(${ik}$ ), intent(in) :: incx, n
158
180
! Array Arguments
159
181
real(${rk}$), intent(in) :: dx(*)
160
182
! =====================================================================
161
183
! Local Scalars
162
184
real(${rk}$) :: dmax
163
- integer(ilp ) :: i, ix
185
+ integer(${ik}$ ) :: i, ix
164
186
! Intrinsic Functions
165
187
intrinsic :: abs
166
- stdlib_i${ri}$amax = 0
188
+ iamax = 0
167
189
if (n<1 .or. incx<=0) return
168
- stdlib_i${ri}$amax = 1
190
+ iamax = 1
169
191
if (n==1) return
170
192
if (incx==1) then
171
193
! code for increment equal to 1
172
194
dmax = abs(dx(1))
173
195
do i = 2,n
174
196
if (abs(dx(i))>dmax) then
175
- stdlib_i${ri}$amax = i
197
+ iamax = i
176
198
dmax = abs(dx(i))
177
199
end if
178
200
end do
@@ -183,41 +205,40 @@ module stdlib_linalg_blas_aux
183
205
ix = ix + incx
184
206
do i = 2,n
185
207
if (abs(dx(ix))>dmax) then
186
- stdlib_i${ri}$amax = i
208
+ iamax = i
187
209
dmax = abs(dx(ix))
188
210
end if
189
211
ix = ix + incx
190
212
end do
191
213
end if
192
214
return
193
- end function stdlib_i ${ri}$amax
215
+ end function stdlib${ii}$_i ${ri}$amax
194
216
195
217
#:endfor
196
-
197
218
#:for ck,ct,ci in CMPLX_KINDS_TYPES
198
- pure integer(ilp ) function stdlib_i${ ci}$amax(n,zx,incx)
219
+ pure integer(${ik}$ ) function stdlib${ii}$_i${ ci}$amax(n,zx,incx) result(iamax )
199
220
!! IZAMAX: finds the index of the first element having maximum |Re(.)| + |Im(.)|
200
221
! -- reference blas level1 routine --
201
222
! -- reference blas is a software package provided by univ. of tennessee, --
202
223
! -- univ. of california berkeley, univ. of colorado denver and nag ltd..--
203
224
! Scalar Arguments
204
- integer(ilp ), intent(in) :: incx, n
225
+ integer(${ik}$ ), intent(in) :: incx, n
205
226
! Array Arguments
206
227
complex(${ck}$), intent(in) :: zx(*)
207
228
! =====================================================================
208
229
! Local Scalars
209
230
real(${ck}$) :: dmax
210
- integer(ilp ) :: i, ix
211
- stdlib_i${ci}$amax = 0
231
+ integer(${ik}$ ) :: i, ix
232
+ iamax = 0
212
233
if (n<1 .or. incx<=0) return
213
- stdlib_i${ci}$amax = 1
234
+ iamax = 1
214
235
if (n==1) return
215
236
if (incx==1) then
216
237
! code for increment equal to 1
217
238
dmax = stdlib_cabs1(zx(1))
218
239
do i = 2,n
219
240
if (stdlib_cabs1(zx(i))>dmax) then
220
- stdlib_i${ci}$amax = i
241
+ iamax = i
221
242
dmax = stdlib_cabs1(zx(i))
222
243
end if
223
244
end do
@@ -228,15 +249,16 @@ module stdlib_linalg_blas_aux
228
249
ix = ix + incx
229
250
do i = 2,n
230
251
if (stdlib_cabs1(zx(ix))>dmax) then
231
- stdlib_i${ci}$amax = i
252
+ iamax = i
232
253
dmax = stdlib_cabs1(zx(ix))
233
254
end if
234
255
ix = ix + incx
235
256
end do
236
257
end if
237
258
return
238
- end function stdlib_i ${ci}$amax
259
+ end function stdlib${ii}$_i ${ci}$amax
239
260
240
261
#:endfor
262
+ #:endfor
241
263
242
264
end module stdlib_linalg_blas_aux
0 commit comments