-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Closed
Description
Writing my first lapack interface. Not sure if I have all the pointers right, etc., but
anyway as long as code just crashes, it's hard to debug. I may try this on a
mac later today, but if anyone can just help me sooner, that would be great.
Here's the exact code:
const liblapack = Base.liblapack_name
import Base.BlasInt
## (ST) Symmetric tridiagonal - maxeig
for (stebz, elty) in
((:dstebz_,:Float64),
(:sstebz_,:Float32))
@eval begin
function stebz!(dv::Vector{$elty}, ev::Vector{$elty})
n = length(dv)
if length(ev) != (n-1) throw(LapackDimMisMatch("stebz!")) end
z=Array($elty,1)
z[1]=0.0 #just to be sure
m=Array(BlasInt,1)
nsplit =Array(BlasInt,1)
w = Array($elty, n)
iblock = Array(BlasInt,n)
isplit = Array(BlasInt,n)
work = Array($elty, 4*n)
iwork = Array(BlasInt,3*n)
info = Array(BlasInt, 1)
ccall(($(string(stebz)),liblapack), Void,
(Ptr{Uint8},Ptr{Uint8},
Ptr{BlasInt},Ptr{BlasInt},Ptr{BlasInt},Ptr{BlasInt},Ptr{BlasInt},
Ptr{$elty},Ptr{$elty},Ptr{$elty},
Ptr{BlasInt},Ptr{BlasInt},
Ptr{$elty},Ptr{BlasInt},Ptr{$elty},Ptr{BlasInt},Ptr{BlasInt}),
'I','B',
&n,0,0,&n,&n,
z,dv,ev,
m, nsplit,
w, iblock,work,iwork,info)
if info[1] != 0 throw(LapackException(info[1])) end
w
end
end
end
Metadata
Metadata
Assignees
Labels
No labels