diff --git a/Project.toml b/Project.toml index 20877ae2..9ceb7b4e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BandedMatrices" uuid = "aae01518-5342-5314-be14-df237901396f" -version = "1.7" +version = "1.7.1" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/blas.jl b/src/blas.jl index 43a24302..14367539 100644 --- a/src/blas.jl +++ b/src/blas.jl @@ -130,11 +130,13 @@ for (fname, elty) in ((:dtbsv_,:Float64), throw(DimensionMismatch("size of A is $n != length(x) = $(length(x))")) end chkstride1(A) - ccall((@blasfunc($fname), libblas), Cvoid, - (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, - Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), - uplo, trans, diag, m, k, - A, max(1,stride(A,2)), x, stride(x, 1)) + if n ≠ 0 # avoid empty warning message + ccall((@blasfunc($fname), libblas), Cvoid, + (Ref{UInt8}, Ref{UInt8}, Ref{UInt8}, Ref{BlasInt}, Ref{BlasInt}, + Ptr{$elty}, Ref{BlasInt}, Ptr{$elty}, Ref{BlasInt}), + uplo, trans, diag, m, k, + A, max(1,stride(A,2)), x, stride(x, 1)) + end x end function tbsv(uplo::AbstractChar, trans::AbstractChar, diag::AbstractChar, diff --git a/test/test_tribanded.jl b/test/test_tribanded.jl index 517bf366..5eb90db2 100644 --- a/test/test_tribanded.jl +++ b/test/test_tribanded.jl @@ -114,6 +114,11 @@ import BandedMatrices: BandedColumns, BandedRows, isbanded @test rot180(LowerTriangular(B)) == rot180(Matrix(LowerTriangular(B))) @test rot180(UnitLowerTriangular(B)) == rot180(Matrix(UnitLowerTriangular(B))) end + + @testset "empty uppertriangular" begin + B = brand(0,0,2,1) + @test UpperTriangular(B) \ Float64[] == Float64[] + end end end # module