Skip to content

Commit

Permalink
Update for Julia v1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
dlfivefifty committed Dec 31, 2018
1 parent dbd08e8 commit 337084b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/banded/BandedLU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ checksquare(A::BandedLU) = (A.m == size(A.data, 2) ||
# Returns the narrowest blas type given the eltypes of A and b in A*x=b
function _promote_to_blas_type(::Type{T}, ::Type{S}) where {T<:Number, S<:Number}
TS = Base.promote_op(/, T, S)
# promote to narrowest type
TS <: Complex && return Base.promote_op(/, TS, ComplexF32)
TS <: AbstractFloat && return Base.promote_op(/, TS, Float32)
if TS Union{}
# promote to narrowest type
TS <: Complex && return Base.promote_op(/, TS, ComplexF32)
TS <: AbstractFloat && return Base.promote_op(/, TS, Float32)
end
error("Cannot convert objects of element type $(T), $(S) to a `BlasFloat` type")
end

Expand Down
1 change: 0 additions & 1 deletion test/test_bandedlu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ cldiv!(A, b) = ldiv!(adjoint(A), b)
@test BandedMatrices._promote_to_blas_type(typ, Int16) == typ
@test BandedMatrices._promote_to_blas_type(typ, Int8) == typ


@test_throws ErrorException BandedMatrices._promote_to_blas_type(_foo, Float64)
end

Expand Down
6 changes: 6 additions & 0 deletions test/test_broadcasting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,17 @@ using BandedMatrices, LinearAlgebra, LazyArrays, Test
A = brand(5,5,1,1)
A.data .= NaN
lmul!(0.0,A)
@test isnan(norm(A)) == isnan(norm(lmul!(0.0,[NaN])))

lmul!(false,A)
@test norm(A) == 0.0

A = brand(5,5,1,1)
A.data .= NaN
rmul!(A,0.0)
@test isnan(norm(A)) == isnan(norm(rmul!([NaN],0.0)))

rmul!(A,false)
@test norm(A) == 0.0

n = 100
Expand Down

0 comments on commit 337084b

Please sign in to comment.