Skip to content

Commit

Permalink
Avoid warning with empty upper triangular solves
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed Jun 3, 2024
1 parent 8618b18 commit 8c62e0e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
12 changes: 7 additions & 5 deletions src/blas.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Check warning on line 134 in src/blas.jl

View check run for this annotation

Codecov / codecov/patch

src/blas.jl#L133-L134

Added lines #L133 - L134 were not covered by tests
(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,
Expand Down
5 changes: 5 additions & 0 deletions test/test_tribanded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 8c62e0e

Please sign in to comment.