Skip to content

Commit

Permalink
Fix lu deprecation warning on julia v1.7+ (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkarrasch authored Jun 25, 2021
1 parent f2e4c83 commit a4b38ad
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 1 addition & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name = "TaylorSeries"
uuid = "6aa5eb33-94cf-58f4-a9d0-e4b2c4fc25ea"
repo = "https://github.com/JuliaDiff/TaylorSeries.jl.git"
version = "0.11.0"
version = "0.11.1"

[deps]
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand Down
5 changes: 4 additions & 1 deletion src/TaylorSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ see also [`HomogeneousPolynomial`](@ref).
module TaylorSeries


using InteractiveUtils: subtypes
using SparseArrays: SparseMatrixCSC
using Markdown
using Requires
Expand All @@ -26,6 +25,10 @@ using LinearAlgebra: norm, mul!,
lu, lu!, LinearAlgebra.lutype, LinearAlgebra.copy_oftype,
LinearAlgebra.issuccess

if VERSION >= v"1.7.0-DEV.1188"
using LinearAlgebra: NoPivot, RowMaximum
end

import LinearAlgebra: norm, mul!, lu

import Base: ==, +, -, *, /, ^
Expand Down
8 changes: 6 additions & 2 deletions src/arithmetic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,10 @@ end
# return Ai
# end

# see https://github.com/JuliaLang/julia/pull/40623
const LU_RowMaximum = VERSION >= v"1.7.0-DEV.1188" ? RowMaximum() : Val(true)
const LU_NoPivot = VERSION >= v"1.7.0-DEV.1188" ? NoPivot() : Val(false)

# Adapted from (Julia v1.2) stdlib/v1.2/LinearAlgebra/src/lu.jl#240-253
# and (Julia v1.4.0-dev) stdlib/LinearAlgebra/v1.4/src/lu.jl#270-274,
# licensed under MIT "Expat".
Expand All @@ -610,10 +614,10 @@ end
# We can't assume an ordered field so we first try without pivoting
function lu(A::AbstractMatrix{Taylor1{T}}; check::Bool = true) where {T<:Number}
S = Taylor1{lutype(T)}
F = lu!(copy_oftype(A, S), Val(false); check = false)
F = lu!(copy_oftype(A, S), LU_NoPivot; check = false)
if issuccess(F)
return F
else
return lu!(copy_oftype(A, S), Val(true); check = check)
return lu!(copy_oftype(A, S), LU_RowMaximum; check = check)
end
end

2 comments on commit a4b38ad

@lbenet
Copy link
Member

@lbenet lbenet commented on a4b38ad Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/39596

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.11.1 -m "<description of version>" a4b38ad9a60fb08f4bda4a4ab01f4be8def7ef88
git push origin v0.11.1

Please sign in to comment.