2
! Signatures for f2py-wrappers of FORTRAN LEVEL 1 BLAS functions.
4
! Author: Pearu Peterson
5
! Created: Jan-Feb 2002
6
! $Revision: 1.7 $ $Date: 2004/10/01 10:56:40 $
8
! NOTE: Avoiding wrappers hack does not work under 64-bit Gentoo system
9
! with single precision routines, so they are removed.
13
subroutine <tchar=s,d,c,z>rotg(a,b,c,s)
14
! a,b are elements of a direction vector of rotated x-axis.
16
! if abs(a) + abs(b)>0:
17
! roe = abs(a)<abs(b) ? b : a
18
! r = sign(roe) * sqrt(a^2 + b^2)
25
! if 0 < abs(c) <= s: b = 1/c ! XXX: what is b when returned
28
callprotoargument <type_in_c>*,<type_in_c>*,<type_in_c>*,<type_in_c>*
30
! XXX: a and b get new values. Are they relevant?
31
<type_in> intent(in) :: a
32
<type_in> intent(in) :: b
33
<type_in> intent(out,out=c) :: c
34
<type_in> intent(out,out=s) :: s
36
end subroutine <tchar=s,d,c,z>rotg
39
subroutine <tchar=s,d>rotmg(d1,d2,x1,y1,param)
40
! XXX: Could one give a geometrical meaning to the parameters d1,d2,x1,y1?
42
! Construct matrix H such that (H * (sqrt(d1)*x1,sqrt(d2)*y1)^T)_2 = 0.
43
! H = [[1,0],[0,1]] if param[0]==-2
44
! H = [[param[1],param[3]],[param[2],param[4]]] if param[0]==-1
45
! H = [[1,param[3]],[param[2],1]] if param[0]==0
46
! H = [[param[1],1],[-1,param[4]]] if param[0]==1
48
callstatement { (*f2py_func)(&d1,&d2,&x1,&y1,param); }
49
callprotoargument <type_in_c>*,<type_in_c>*,<type_in_c>*,<type_in_c>*,<type_in_c>*
51
<type_in> intent(in) :: d1
52
<type_in> intent(in) :: d2
53
<type_in> intent(in) :: x1
54
<type_in> intent(in) :: y1
55
<type_in> intent(out), dimension(5) :: param
56
end subroutine <tchar=s,d>rotmg
59
subroutine <tchar=s,d,cs,zd>rot(n,x,offx,incx,y,offy,incy,c,s)
61
! Apply plane rotation
63
callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy,&c,&s)
64
callprotoargument int*,<type_in_c>*,int*,<type_in_c>*,int*,<rtype_in_c>*,<rtype_in_c>*
66
<type_in> dimension(*),intent(in,out,copy) :: x,y
68
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
69
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
71
integer optional,intent(in),depend(x) :: offx=0
72
integer optional,intent(in),depend(y) :: offy=0
73
check(offx>=0 && offx<len(x)) :: offx
74
check(offy>=0 && offy<len(y)) :: offy
76
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
77
check(len(x)-offx>(n-1)*abs(incx)) :: n
78
check(len(y)-offy>(n-1)*abs(incy)) :: n
80
<rtype_in> intent(in) :: c
81
<rtype_in> intent(in) :: s
82
end subroutine <tchar=s,d,cs,zd>rot
85
subroutine <tchar=s,d>rotm(n,x,offx,incx,y,offy,incy,param)
87
! Apply modified plane rotation
89
callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy,param)
90
callprotoargument int*,<type_in_c>*,int*,<type_in_c>*,int*,<type_in_c>*
92
<type_in> dimension(*),intent(in,out,copy) :: x,y
94
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
95
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
97
integer optional,intent(in),depend(x) :: offx=0
98
integer optional,intent(in),depend(y) :: offy=0
99
check(offx>=0 && offx<len(x)) :: offx
100
check(offy>=0 && offy<len(y)) :: offy
102
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
103
check(len(x)-offx>(n-1)*abs(incx)) :: n
104
check(len(y)-offy>(n-1)*abs(incy)) :: n
106
<type_in> dimension(5),intent(in) :: param
107
end subroutine <tchar=s,d>rotm
110
subroutine <tchar=s,d,c,z>swap(n,x,offx,incx,y,offy,incy)
112
! Swap two arrays: x <-> y
114
callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy)
115
callprotoargument int*,<type_in_c>*,int*,<type_in_c>*,int*
117
<type_in> dimension(*),intent(in,out) :: x,y
119
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
120
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
122
integer optional,intent(in),depend(x) :: offx=0
123
integer optional,intent(in),depend(y) :: offy=0
124
check(offx>=0 && offx<len(x)) :: offx
125
check(offy>=0 && offy<len(y)) :: offy
127
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
128
check(len(x)-offx>(n-1)*abs(incx)) :: n
129
check(len(y)-offy>(n-1)*abs(incy)) :: n
131
end subroutine <tchar=s,d,c,z>swap
133
subroutine <tchar=s,d,c,z>scal(n,a,x,offx,incx)
137
<type_in> intent(in):: a
139
callstatement (*f2py_func)(&n,&a,x+offx,&incx)
140
callprotoargument int*,<type_in_c>*,<type_in_c>*,int*
142
<type_in> dimension(*),intent(in,out) :: x
144
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
146
integer optional,intent(in),depend(x) :: offx=0
147
check(offx>=0 && offx<len(x)) :: offx
149
integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
150
check(len(x)-offx>(n-1)*abs(incx)) :: n
152
end subroutine <tchar=s,d,c,z>scal
154
subroutine <tchar=cs,zd>scal(n,a,x,offx,incx)
158
<rtype_in> intent(in):: a
160
callstatement (*f2py_func)(&n,&a,x+offx,&incx)
161
callprotoargument int*,<rtype_in_c>*,<type_in_c>*,int*
163
<type_in> dimension(*),intent(in,out,copy) :: x
165
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
167
integer optional,intent(in),depend(x) :: offx=0
168
check(offx>=0 && offx<len(x)) :: offx
170
integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
171
check(len(x)-offx>(n-1)*abs(incx)) :: n
173
end subroutine <tchar=cs,zd>scal
175
subroutine <tchar=s,d,c,z>copy(n,x,offx,incx,y,offy,incy)
179
callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy)
180
callprotoargument int*,<type_in_c>*,int*,<type_in_c>*,int*
182
<type_in> dimension(*),intent(in) :: x
183
<type_in> dimension(*),intent(in,out) :: y
185
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
186
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
188
integer optional,intent(in),depend(x) :: offx=0
189
integer optional,intent(in),depend(y) :: offy=0
190
check(offx>=0 && offx<len(x)) :: offx
191
check(offy>=0 && offy<len(y)) :: offy
193
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
194
check(len(x)-offx>(n-1)*abs(incx)) :: n
195
check(len(y)-offy>(n-1)*abs(incy)) :: n
197
end subroutine <tchar=s,d,c,z>copy
199
subroutine <tchar=s,d,c,z>axpy(n,a,x,offx,incx,y,offy,incy)
201
! Calculate z = a*x+y, where a is scalar.
203
callstatement (*f2py_func)(&n,&a,x+offx,&incx,y+offy,&incy)
204
callprotoargument int*,<type_in_c>*,<type_in_c>*,int*,<type_in_c>*,int*
206
<type_in> dimension(*),intent(in) :: x
207
<type_in> dimension(*),intent(in,out) :: y
209
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
210
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
212
integer optional,intent(in),depend(x) :: offx=0
213
integer optional,intent(in),depend(y) :: offy=0
214
check(offx>=0 && offx<len(x)) :: offx
215
check(offy>=0 && offy<len(y)) :: offy
217
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
218
check(len(x)-offx>(n-1)*abs(incx)) :: n
219
check(len(y)-offy>(n-1)*abs(incy)) :: n
221
<type_in> optional, intent(in):: a=<type_convert=1.>
223
end subroutine <tchar=s,d,c,z>axpy
225
function <tchar=s,d>dot(n,x,offx,incx,y,offy,incy) result (xy)
227
<type_in> <tchar=s,d>dot,xy
229
callstatement (*f2py_func)(&<tchar=s,d>dot,&n,x+offx,&incx,y+offy,&incy)
230
callprotoargument <type_in_c>*,int*,<type_in_c>*,int*,<type_in_c>*,int*
232
<type_in> dimension(*),intent(in) :: x
233
<type_in> dimension(*),intent(in) :: y
235
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
236
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
238
integer optional,intent(in),depend(x) :: offx=0
239
integer optional,intent(in),depend(y) :: offy=0
240
check(offx>=0 && offx<len(x)) :: offx
241
check(offy>=0 && offy<len(y)) :: offy
243
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
244
check(len(x)-offx>(n-1)*abs(incx)) :: n
245
check(len(y)-offy>(n-1)*abs(incy)) :: n
247
end function <tchar=s,d>dot
249
subroutine <tchar=c,z>dotu(xy,n,x,offx,incx,y,offy,incy)
251
<type_in> intent(out):: xy
252
fortranname w<tchar=c,z>dotu
254
callstatement (*f2py_func)(&xy,&n,x+offx,&incx,y+offy,&incy)
255
callprotoargument <type_in_c>*,int*,<type_in_c>*,int*,<type_in_c>*,int*
257
<type_in> dimension(*),intent(in) :: x
258
<type_in> dimension(*),intent(in) :: y
260
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
261
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
263
integer optional,intent(in),depend(x) :: offx=0
264
integer optional,intent(in),depend(y) :: offy=0
265
check(offx>=0 && offx<len(x)) :: offx
266
check(offy>=0 && offy<len(y)) :: offy
268
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
269
check(len(x)-offx>(n-1)*abs(incx)) :: n
270
check(len(y)-offy>(n-1)*abs(incy)) :: n
272
end subroutine <tchar=c,z>dotu
274
subroutine <tchar=c,z>dotc(xy,n,x,offx,incx,y,offy,incy)
276
<type_in> intent (out) :: xy
277
fortranname w<tchar=c,z>dotc
279
callstatement (*f2py_func)(&xy,&n,x+offx,&incx,y+offy,&incy)
280
callprotoargument <type_in_c>*,int*,<type_in_c>*,int*,<type_in_c>*,int*
282
<type_in> dimension(*),intent(in) :: x
283
<type_in> dimension(*),intent(in) :: y
285
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
286
integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
288
integer optional,intent(in),depend(x) :: offx=0
289
integer optional,intent(in),depend(y) :: offy=0
290
check(offx>=0 && offx<len(x)) :: offx
291
check(offy>=0 && offy<len(y)) :: offy
293
integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
294
check(len(x)-offx>(n-1)*abs(incx)) :: n
295
check(len(y)-offy>(n-1)*abs(incy)) :: n
297
end subroutine <tchar=c,z>dotc
299
function <tchar=s,d,sc,dz>nrm2(n,x,offx,incx) result(n2)
301
<type_in> <tchar=s,d,sc,dz>nrm2, n2
303
callstatement (*f2py_func)(&<tchar=s,d,sc,dz>nrm2, &n,x+offx,&incx)
304
callprotoargument <type_in_c>*,int*,<type_out_c>*,int*
306
<type_out> dimension(*),intent(in) :: x
308
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
310
integer optional,intent(in),depend(x) :: offx=0
311
check(offx>=0 && offx<len(x)) :: offx
313
integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
314
check(len(x)-offx>(n-1)*abs(incx)) :: n
316
end function <tchar=s,d,sc,dz>nrm2
318
function <tchar=s,d,sc,dz>asum(n,x,offx,incx) result (s)
320
<type_in> <tchar=s,d,sc,dz>asum,s
322
callstatement (*f2py_func)(&<tchar=s,d,sc,dz>asum,&n,x+offx,&incx)
323
callprotoargument <type_in_c>*,int*,<type_out_c>*,int*
325
<type_out> dimension(*),intent(in) :: x
327
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
329
integer optional,intent(in),depend(x) :: offx=0
330
check(offx>=0 && offx<len(x)) :: offx
332
integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
333
check(len(x)-offx>(n-1)*abs(incx)) :: n
335
end function <tchar=s,d,sc,dz>asum
337
function i<tchar=s,d,c,z>amax(n,x,offx,incx) result(k)
339
! This is to avoid Fortran wrappers.
340
integer i<tchar=s,d,c,z>amax,k
341
fortranname F_FUNC(i<tchar=s,d,c,z>amax,I<TCHAR=S,D,C,Z>AMAX)
342
intent(c) i<tchar=s,d,c,z>amax
344
callstatement i<tchar=s,d,c,z>amax_return_value = (*f2py_func)(&n,x+offx,&incx) - 1
345
callprotoargument int*,<type_out_c>*,int*
347
<type_out> dimension(*),intent(in) :: x
349
integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
351
integer optional,intent(in),depend(x) :: offx=0
352
check(offx>=0 && offx<len(x)) :: offx
354
integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
355
check(len(x)-offx>(n-1)*abs(incx)) :: n
357
end function i<tchar=s,d,c,z>amax