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