From aa0ae07c1d9e86a816d8f93a993b4eb4b51897a0 Mon Sep 17 00:00:00 2001 From: Jiahao Chen Date: Mon, 18 Mar 2013 22:46:01 -0400 Subject: [PATCH] Fixes calls to LAPACK.stebz Fixes crash in eigenvalue computations for SymTridiagonal matrices --- base/linalg/tridiag.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/base/linalg/tridiag.jl b/base/linalg/tridiag.jl index 5439b80cc6acf..58e0f03e5c8a1 100644 --- a/base/linalg/tridiag.jl +++ b/base/linalg/tridiag.jl @@ -46,9 +46,11 @@ size(m::SymTridiagonal) = (length(m.dv), length(m.dv)) size(m::SymTridiagonal, d::Integer) = d<1 ? error("dimension out of range") : (d<2 ? length(m.dv) : 1) eig(m::SymTridiagonal) = LAPACK.stegr!('V', copy(m.dv), copy(m.ev)) -eigvals(m::SymTridiagonal, il::Int, ih::Int) = LAPACK.stebz!('I', 'E', 0.0, 0.0, il, iu, -1.0, copy(m.dv), copy(m.ev))[1] -eigvals(m::SymTridiagonal, vl::Int, iv::Int) = LAPACK.stebz!('V', 'E', vl, vh, 0, 0, -1.0, copy(m.dv), copy(m.ev))[1] -eigvals(m::SymTridiagonal) = eigvals(m, 1, size(m, 1)) + +#Wrap LAPACK DSTEBZ to compute eigenvalues +eigvals(m::SymTridiagonal, il::Int, iu::Int) = LAPACK.stebz!('I', 'E', 0.0, 0.0, il, iu, -1.0, copy(m.dv), copy(m.ev))[1] +eigvals(m::SymTridiagonal, vl::Float64, vu::Float64) = LAPACK.stebz!('V', 'E', vl, vu, 0, 0, -1.0, copy(m.dv), copy(m.ev))[1] +eigvals(m::SymTridiagonal) = LAPACK.stebz!('A', 'E', 0.0, 0.0, 0, 0, -1.0, copy(m.dv), copy(m.ev))[1] ## Tridiagonal matrices ## type Tridiagonal{T} <: AbstractMatrix{T}