~ubuntu-branches/ubuntu/raring/python-scipy/raring-proposed

« back to all changes in this revision

Viewing changes to Lib/lib/blas/fblas_l1.pyf.src

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-01-07 14:12:12 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070107141212-mm0ebkh5b37hcpzn
* Remove build dependency on python-numpy-dev.
* python-scipy: Depend on python-numpy instead of python-numpy-dev.
* Package builds on other archs than i386. Closes: #402783.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
!%f90 -*- f90 -*-
 
2
! Signatures for f2py-wrappers of FORTRAN LEVEL 1 BLAS functions.
 
3
!
 
4
! Author: Pearu Peterson
 
5
! Created: Jan-Feb 2002
 
6
! $Revision: 1181 $ $Date: 2004-11-26 06:35:43 -0700 (Fri, 26 Nov 2004) $
 
7
!
 
8
! rotg, rotmg, rot, rotm
 
9
! swap, scal, copy, axpy
 
10
! dot, dotu, dotc
 
11
! nrm2, asum, amax, iamax
 
12
!
 
13
! Not Implemented: NONE
 
14
!
 
15
! NOTE: Avoiding wrappers hack does not work under 64-bit Gentoo system
 
16
! with single precision routines, so they are removed.
 
17
 
 
18
! Level 1 BLAS
 
19
 
 
20
subroutine <prefix>rotg(a,b,c,s)
 
21
  ! a,b are elements of a direction vector of rotated x-axis.
 
22
 
 
23
  ! if abs(a) + abs(b)>0:
 
24
  !     roe = abs(a)<abs(b) ? b : a
 
25
  !     r = sign(roe) * sqrt(a^2 + b^2)
 
26
  !     c = a/r
 
27
  !     s = b/r
 
28
  ! else:
 
29
  !     c = 1
 
30
  !     s = r = 0
 
31
  ! a = r
 
32
  ! if 0 < abs(c) <= s: b = 1/c  ! XXX: what is b when returned
 
33
  ! else: b = s 
 
34
 
 
35
  callprotoargument <ctype>*,<ctype>*,<ctype>*,<ctype>*
 
36
 
 
37
  ! XXX: a and b get new values. Are they relevant?
 
38
  <ftype> intent(in) :: a
 
39
  <ftype> intent(in) :: b
 
40
  <ftype> intent(out,out=c) :: c
 
41
  <ftype> intent(out,out=s) :: s
 
42
 
 
43
end subroutine <prefix>rotg
 
44
 
 
45
 
 
46
! <prefix2=s,d> <ctype2=float,double> <ftype2=real,double precision>
 
47
subroutine <prefix2>rotmg(d1,d2,x1,y1,param)
 
48
  ! XXX: Could one give a geometrical meaning to the parameters d1,d2,x1,y1?
 
49
 
 
50
  ! Construct matrix H such that (H * (sqrt(d1)*x1,sqrt(d2)*y1)^T)_2 = 0.
 
51
  ! H = [[1,0],[0,1]] if param[0]==-2
 
52
  ! H = [[param[1],param[3]],[param[2],param[4]]] if param[0]==-1
 
53
  ! H = [[1,param[3]],[param[2],1]] if param[0]==0
 
54
  ! H = [[param[1],1],[-1,param[4]]] if param[0]==1
 
55
 
 
56
  callstatement { (*f2py_func)(&d1,&d2,&x1,&y1,param); }
 
57
  callprotoargument <ctype2=float,double>*,<ctype2>*,<ctype2>*,<ctype2>*,<ctype2>*
 
58
 
 
59
  <ftype2> intent(in) :: d1
 
60
  <ftype2> intent(in) :: d2
 
61
  <ftype2> intent(in) :: x1
 
62
  <ftype2> intent(in) :: y1
 
63
  <ftype2> intent(out), dimension(5) :: param
 
64
end subroutine <prefix2>rotmg
 
65
 
 
66
 
 
67
subroutine <prefix><,,s,d>rot(n,x,offx,incx,y,offy,incy,c,s)
 
68
 
 
69
  ! Apply plane rotation
 
70
 
 
71
  callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy,&c,&s)
 
72
  callprotoargument int*,<ctype>*,int*,<ctype>*,int*,<ctypereal>*,<ctypereal>*
 
73
 
 
74
  <ftype> dimension(*),intent(in,out,copy) :: x,y
 
75
 
 
76
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
77
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
78
 
 
79
  integer optional,intent(in),depend(x) :: offx=0
 
80
  integer optional,intent(in),depend(y) :: offy=0
 
81
  check(offx>=0 && offx<len(x)) :: offx
 
82
  check(offy>=0 && offy<len(y)) :: offy
 
83
 
 
84
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
85
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
86
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
87
 
 
88
  <ftypereal> intent(in) :: c
 
89
  <ftypereal> intent(in) :: s
 
90
end subroutine <prefix><,,s,d>rot
 
91
 
 
92
 
 
93
subroutine <prefix2>rotm(n,x,offx,incx,y,offy,incy,param)
 
94
 
 
95
  ! Apply modified plane rotation
 
96
 
 
97
  callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy,param)
 
98
  callprotoargument int*,<ctype2>*,int*,<ctype2>*,int*,<ctype2>*
 
99
 
 
100
  <ftype2> dimension(*),intent(in,out,copy) :: x,y
 
101
 
 
102
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
103
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
104
 
 
105
  integer optional,intent(in),depend(x) :: offx=0
 
106
  integer optional,intent(in),depend(y) :: offy=0
 
107
  check(offx>=0 && offx<len(x)) :: offx
 
108
  check(offy>=0 && offy<len(y)) :: offy
 
109
 
 
110
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
111
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
112
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
113
 
 
114
  <ftype2> dimension(5),intent(in) :: param
 
115
end subroutine <prefix2>rotm
 
116
 
 
117
 
 
118
subroutine <prefix>swap(n,x,offx,incx,y,offy,incy)
 
119
 
 
120
  ! Swap two arrays: x <-> y
 
121
 
 
122
  callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy)
 
123
  callprotoargument int*,<ctype>*,int*,<ctype>*,int*
 
124
 
 
125
  <ftype> dimension(*),intent(in,out) :: x,y
 
126
 
 
127
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
128
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
129
 
 
130
  integer optional,intent(in),depend(x) :: offx=0
 
131
  integer optional,intent(in),depend(y) :: offy=0
 
132
  check(offx>=0 && offx<len(x)) :: offx
 
133
  check(offy>=0 && offy<len(y)) :: offy
 
134
 
 
135
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
136
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
137
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
138
 
 
139
end subroutine <prefix>swap
 
140
 
 
141
subroutine <prefix>scal(n,a,x,offx,incx)
 
142
 
 
143
  ! Calculate y = a*x
 
144
 
 
145
  <ftype> intent(in):: a
 
146
 
 
147
  callstatement (*f2py_func)(&n,&a,x+offx,&incx)
 
148
  callprotoargument int*,<ctype>*,<ctype>*,int*
 
149
 
 
150
  <ftype> dimension(*),intent(in,out) :: x
 
151
 
 
152
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
153
 
 
154
  integer optional,intent(in),depend(x) :: offx=0
 
155
  check(offx>=0 && offx<len(x)) :: offx
 
156
 
 
157
  integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
 
158
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
159
 
 
160
end subroutine <prefix>scal
 
161
 
 
162
subroutine <_prefix2=cs,zd>scal(n,a,x,offx,incx)
 
163
 
 
164
  ! Calculate y = a*x
 
165
 
 
166
  <real,double precision> intent(in):: a
 
167
 
 
168
  callstatement (*f2py_func)(&n,&a,x+offx,&incx)
 
169
  callprotoargument int*,<float,double>*,<complex_float,complex_double>*,int*
 
170
 
 
171
  <complex,double complex> dimension(*),intent(in,out,copy) :: x
 
172
 
 
173
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
174
 
 
175
  integer optional,intent(in),depend(x) :: offx=0
 
176
  check(offx>=0 && offx<len(x)) :: offx
 
177
 
 
178
  integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
 
179
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
180
 
 
181
end subroutine <_prefix2>scal
 
182
 
 
183
subroutine <prefix>copy(n,x,offx,incx,y,offy,incy)
 
184
 
 
185
  ! Copy y <- x
 
186
 
 
187
  callstatement (*f2py_func)(&n,x+offx,&incx,y+offy,&incy)
 
188
  callprotoargument int*,<ctype>*,int*,<ctype>*,int*
 
189
 
 
190
  <ftype> dimension(*),intent(in) :: x
 
191
  <ftype> dimension(*),intent(in,out) :: y
 
192
 
 
193
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
194
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
195
 
 
196
  integer optional,intent(in),depend(x) :: offx=0
 
197
  integer optional,intent(in),depend(y) :: offy=0
 
198
  check(offx>=0 && offx<len(x)) :: offx
 
199
  check(offy>=0 && offy<len(y)) :: offy
 
200
 
 
201
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
202
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
203
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
204
 
 
205
end subroutine <prefix>copy
 
206
 
 
207
subroutine <prefix>axpy(n,a,x,offx,incx,y,offy,incy)
 
208
 
 
209
  ! Calculate z = a*x+y, where a is scalar.
 
210
 
 
211
  callstatement (*f2py_func)(&n,&a,x+offx,&incx,y+offy,&incy)
 
212
  callprotoargument int*,<ctype>*,<ctype>*,int*,<ctype>*,int*
 
213
 
 
214
  <ftype> dimension(*),intent(in) :: x
 
215
  <ftype> dimension(*),intent(in,out,out=z) :: y
 
216
 
 
217
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
218
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
219
 
 
220
  integer optional,intent(in),depend(x) :: offx=0
 
221
  integer optional,intent(in),depend(y) :: offy=0
 
222
  check(offx>=0 && offx<len(x)) :: offx
 
223
  check(offy>=0 && offy<len(y)) :: offy
 
224
 
 
225
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
226
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
227
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
228
 
 
229
  <ftype> optional, intent(in):: a=<1.0,\0,(1.0\,0.0),\2>
 
230
 
 
231
end subroutine <prefix>axpy
 
232
 
 
233
function <prefix2>dot(n,x,offx,incx,y,offy,incy) result (xy)
 
234
 
 
235
  <ftype2> <prefix2>dot,xy
 
236
 
 
237
  callstatement (*f2py_func)(&<prefix2>dot,&n,x+offx,&incx,y+offy,&incy)
 
238
  callprotoargument <ctype2>*,int*,<ctype2>*,int*,<ctype2>*,int*
 
239
 
 
240
  <ftype2> dimension(*),intent(in) :: x
 
241
  <ftype2> dimension(*),intent(in) :: y
 
242
 
 
243
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
244
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
245
 
 
246
  integer optional,intent(in),depend(x) :: offx=0
 
247
  integer optional,intent(in),depend(y) :: offy=0
 
248
  check(offx>=0 && offx<len(x)) :: offx
 
249
  check(offy>=0 && offy<len(y)) :: offy
 
250
 
 
251
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
252
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
253
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
254
 
 
255
end function <prefix2>dot
 
256
 
 
257
! <prefix2c=c,z> <ftype2c=complex,double complex> <ctype2c=complex_float,complex_double>
 
258
subroutine <prefix2c>dotu(xy,n,x,offx,incx,y,offy,incy)
 
259
 
 
260
  <ftype2c> intent(out):: xy
 
261
  fortranname w<prefix2c>dotu
 
262
  
 
263
  callstatement (*f2py_func)(&xy,&n,x+offx,&incx,y+offy,&incy)
 
264
  callprotoargument <ctype2c>*,int*,<ctype2c>*,int*,<ctype2c>*,int*
 
265
 
 
266
  <ftype2c> dimension(*),intent(in) :: x
 
267
  <ftype2c> dimension(*),intent(in) :: y
 
268
 
 
269
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
270
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
271
 
 
272
  integer optional,intent(in),depend(x) :: offx=0
 
273
  integer optional,intent(in),depend(y) :: offy=0
 
274
  check(offx>=0 && offx<len(x)) :: offx
 
275
  check(offy>=0 && offy<len(y)) :: offy
 
276
 
 
277
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
278
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
279
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
280
 
 
281
end subroutine <prefix2c>dotu
 
282
 
 
283
subroutine <prefix2c>dotc(xy,n,x,offx,incx,y,offy,incy)
 
284
 
 
285
  <ftype2c> intent (out) :: xy
 
286
  fortranname w<prefix2c>dotc
 
287
 
 
288
  callstatement (*f2py_func)(&xy,&n,x+offx,&incx,y+offy,&incy)
 
289
  callprotoargument <ctype2c>*,int*,<ctype2c>*,int*,<ctype2c>*,int*
 
290
 
 
291
  <ftype2c> dimension(*),intent(in) :: x
 
292
  <ftype2c> dimension(*),intent(in) :: y
 
293
 
 
294
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
295
  integer optional, intent(in),check(incy>0||incy<0) :: incy = 1
 
296
 
 
297
  integer optional,intent(in),depend(x) :: offx=0
 
298
  integer optional,intent(in),depend(y) :: offy=0
 
299
  check(offx>=0 && offx<len(x)) :: offx
 
300
  check(offy>=0 && offy<len(y)) :: offy
 
301
 
 
302
  integer optional,intent(in),depend(x,incx,offx,y,incy,offy) :: n = (len(x)-offx)/abs(incx)
 
303
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
304
  check(len(y)-offy>(n-1)*abs(incy)) :: n
 
305
 
 
306
end subroutine <prefix2c>dotc
 
307
 
 
308
! <prefix3=s,d,sc,dz>
 
309
function <prefix3>nrm2(n,x,offx,incx) result(n2)
 
310
 
 
311
  <ftypereal> <prefix3>nrm2, n2
 
312
 
 
313
  callstatement (*f2py_func)(&<prefix3>nrm2, &n,x+offx,&incx)
 
314
  callprotoargument <ctypereal>*,int*,<ctype>*,int*
 
315
 
 
316
  <ftype> dimension(*),intent(in) :: x
 
317
 
 
318
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
319
 
 
320
  integer optional,intent(in),depend(x) :: offx=0
 
321
  check(offx>=0 && offx<len(x)) :: offx
 
322
 
 
323
  integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
 
324
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
325
 
 
326
end function <prefix3>nrm2
 
327
 
 
328
function <prefix3>asum(n,x,offx,incx) result (s)
 
329
 
 
330
  <ftypereal> <prefix3>asum,s
 
331
 
 
332
  callstatement (*f2py_func)(&<prefix3>asum,&n,x+offx,&incx)
 
333
  callprotoargument <ctypereal>*,int*,<ctype>*,int*
 
334
 
 
335
  <ftype> dimension(*),intent(in) :: x
 
336
 
 
337
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
338
 
 
339
  integer optional,intent(in),depend(x) :: offx=0
 
340
  check(offx>=0 && offx<len(x)) :: offx
 
341
 
 
342
  integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
 
343
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
344
 
 
345
end function <prefix3>asum
 
346
 
 
347
function i<prefix>amax(n,x,offx,incx) result(k)
 
348
 
 
349
  ! This is to avoid Fortran wrappers.
 
350
  integer i<prefix>amax,k
 
351
  fortranname F_FUNC(i<prefix>amax,I<S,D,C,Z>AMAX)
 
352
  intent(c) i<prefix>amax
 
353
 
 
354
  callstatement i<prefix>amax_return_value = (*f2py_func)(&n,x+offx,&incx) - 1
 
355
  callprotoargument int*,<ctype>*,int*
 
356
 
 
357
  <ftype> dimension(*),intent(in) :: x
 
358
 
 
359
  integer optional, intent(in),check(incx>0||incx<0) :: incx = 1
 
360
 
 
361
  integer optional,intent(in),depend(x) :: offx=0
 
362
  check(offx>=0 && offx<len(x)) :: offx
 
363
 
 
364
  integer optional,intent(in),depend(x,incx,offx) :: n = (len(x)-offx)/abs(incx)
 
365
  check(len(x)-offx>(n-1)*abs(incx)) :: n
 
366
 
 
367
end function i<prefix>amax
 
368