diff --git a/Project.toml b/Project.toml index 62248bc4b..6e652c6fa 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "LinearSolve" uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" authors = ["SciML"] -version = "3.48.1" +version = "3.49.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" @@ -27,7 +27,6 @@ SciMLLogging = "a6db7da4-7206-11f0-1eab-35f2a5dbe1d1" SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed" [weakdeps] AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e" @@ -138,7 +137,6 @@ StableRNGs = "1.0" StaticArrays = "1.9" StaticArraysCore = "1.4.3" Test = "1.10" -UnPack = "1.0.2" Zygote = "0.7" blis_jll = "0.9.0" julia = "1.10" diff --git a/ext/LinearSolveHYPREExt.jl b/ext/LinearSolveHYPREExt.jl index 4948499e5..550daa2e2 100644 --- a/ext/LinearSolveHYPREExt.jl +++ b/ext/LinearSolveHYPREExt.jl @@ -8,7 +8,6 @@ using LinearSolve: HYPREAlgorithm, LinearCache, LinearProblem, LinearSolve, __conditioning, LinearSolveAdjoint, LinearVerbosity using SciMLLogging: SciMLLogging, verbosity_to_int, @SciMLMessage using SciMLBase: LinearProblem, LinearAliasSpecifier, SciMLBase -using UnPack: @unpack using Setfield: @set! mutable struct HYPRECache @@ -71,7 +70,7 @@ function SciMLBase.init(prob::LinearProblem, alg::HYPREAlgorithm, assumptions = OperatorAssumptions(), sensealg = LinearSolveAdjoint(), kwargs...) - @unpack A, b, u0, p = prob + (; A, b, u0, p) = prob if haskey(kwargs, :alias_A) || haskey(kwargs, :alias_b) aliases = LinearAliasSpecifier() diff --git a/ext/LinearSolvePardisoExt.jl b/ext/LinearSolvePardisoExt.jl index bab20ca5c..2a2ba1702 100644 --- a/ext/LinearSolvePardisoExt.jl +++ b/ext/LinearSolvePardisoExt.jl @@ -3,7 +3,7 @@ module LinearSolvePardisoExt using Pardiso, LinearSolve using SparseArrays using SparseArrays: nonzeros, rowvals, getcolptr -using LinearSolve: PardisoJL, @unpack, LinearVerbosity +using LinearSolve: PardisoJL, LinearVerbosity using SciMLLogging: SciMLLogging, @SciMLMessage, verbosity_to_bool using LinearSolve.SciMLBase @@ -22,7 +22,7 @@ function LinearSolve.init_cacheval(alg::PardisoJL, reltol, verbose::Union{LinearVerbosity, Bool}, assumptions::LinearSolve.OperatorAssumptions) - @unpack nprocs, solver_type, matrix_type, cache_analysis, iparm, dparm, vendor = alg + (; nprocs, solver_type, matrix_type, cache_analysis, iparm, dparm, vendor) = alg A = convert(AbstractMatrix, A) if isnothing(vendor) @@ -137,7 +137,7 @@ function LinearSolve.init_cacheval(alg::PardisoJL, end function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::PardisoJL; kwargs...) - @unpack A, b, u = cache + (; A, b, u) = cache A = convert(AbstractMatrix, A) if cache.isfresh phase = alg.cache_analysis ? Pardiso.NUM_FACT : Pardiso.ANALYSIS_NUM_FACT diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index f08785c97..a0e0c1345 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -24,7 +24,6 @@ using SciMLOperators: SciMLOperators, AbstractSciMLOperator, IdentityOperator, using SciMLLogging: SciMLLogging, @SciMLMessage, verbosity_to_int, AbstractVerbositySpecifier, AbstractMessageLevel, AbstractVerbosityPreset, Silent, InfoLevel, WarnLevel, CustomLevel, None, Minimal, Standard, Detailed, All using Setfield: @set, @set! -using UnPack: @unpack using DocStringExtensions: DocStringExtensions using EnumX: EnumX, @enumx using Markdown: Markdown, @doc_str diff --git a/src/default.jl b/src/default.jl index 8c6311419..11cbe36d7 100644 --- a/src/default.jl +++ b/src/default.jl @@ -445,7 +445,7 @@ end function SciMLBase.solve!(cache::LinearCache, alg::Nothing, args...; assump::OperatorAssumptions = OperatorAssumptions(), kwargs...) - @unpack A, b = cache + (; A, b) = cache SciMLBase.solve!(cache, defaultalg(A, b, assump), args...; kwargs...) end diff --git a/src/preconditioners.jl b/src/preconditioners.jl index 088c2fd81..287624865 100644 --- a/src/preconditioners.jl +++ b/src/preconditioners.jl @@ -35,14 +35,14 @@ end Base.eltype(A::ComposePreconditioner) = promote_type(eltype(A.inner), eltype(A.outer)) function LinearAlgebra.ldiv!(A::ComposePreconditioner, x) - @unpack inner, outer = A + (; inner, outer) = A ldiv!(inner, x) ldiv!(outer, x) end function LinearAlgebra.ldiv!(y, A::ComposePreconditioner, x) - @unpack inner, outer = A + (; inner, outer) = A ldiv!(y, inner, x) ldiv!(outer, y) diff --git a/src/simplegmres.jl b/src/simplegmres.jl index 1735304e5..a9b77765e 100644 --- a/src/simplegmres.jl +++ b/src/simplegmres.jl @@ -162,7 +162,7 @@ end function _init_cacheval(::Val{false}, alg::SimpleGMRES, A, b, u, Pl, Pr, maxiters::Int, abstol, reltol, ::Union{LinearVerbosity, Bool}, ::OperatorAssumptions; zeroinit = true, kwargs...) - @unpack memory, restart, blocksize, warm_start = alg + (; memory, restart, blocksize, warm_start) = alg if zeroinit return SimpleGMRESCache{false}(memory, 0, restart, maxiters, blocksize, @@ -218,8 +218,8 @@ function _init_cacheval(::Val{false}, alg::SimpleGMRES, A, b, u, Pl, Pr, maxiter end function SciMLBase.solve!(cache::SimpleGMRESCache{false}, lincache::LinearCache) - @unpack memory, n, restart, maxiters, blocksize, ε, PlisI, PrisI, Pl, Pr = cache - @unpack Δx, q, p, x, A, b, abstol, reltol, w, V, s, c, z, R, β, warm_start = cache + (; memory, n, restart, maxiters, blocksize, ε, PlisI, PrisI, Pl, Pr) = cache + (; Δx, q, p, x, A, b, abstol, reltol, w, V, s, c, z, R, β, warm_start) = cache T = eltype(x) q = PlisI ? w : q @@ -394,7 +394,7 @@ end function _init_cacheval(::Val{true}, alg::SimpleGMRES, A, b, u, Pl, Pr, maxiters::Int, abstol, reltol, ::Union{LinearVerbosity, Bool}, ::OperatorAssumptions; zeroinit = true, blocksize = alg.blocksize) - @unpack memory, restart, warm_start = alg + (; memory, restart, warm_start) = alg if zeroinit return SimpleGMRESCache{true}(memory, 0, restart, maxiters, blocksize, @@ -449,8 +449,8 @@ function _init_cacheval(::Val{true}, alg::SimpleGMRES, A, b, u, Pl, Pr, maxiters end function SciMLBase.solve!(cache::SimpleGMRESCache{true}, lincache::LinearCache) - @unpack memory, n, restart, maxiters, blocksize, ε, PlisI, PrisI, Pl, Pr = cache - @unpack Δx, q, p, x, A, b, abstol, reltol, w, V, s, c, z, R, β, warm_start = cache + (; memory, n, restart, maxiters, blocksize, ε, PlisI, PrisI, Pl, Pr) = cache + (; Δx, q, p, x, A, b, abstol, reltol, w, V, s, c, z, R, β, warm_start) = cache bsize = n ÷ blocksize __batch = Base.Fix2(reshape, (blocksize, bsize)) diff --git a/src/solve_function.jl b/src/solve_function.jl index a9680d71b..ece9470b4 100644 --- a/src/solve_function.jl +++ b/src/solve_function.jl @@ -47,8 +47,8 @@ end function SciMLBase.solve!(cache::LinearCache, alg::LinearSolveFunction, args...; kwargs...) - @unpack A, b, u, p, isfresh, Pl, Pr, cacheval = cache - @unpack solve_func = alg + (; A, b, u, p, isfresh, Pl, Pr, cacheval) = cache + (; solve_func) = alg u = solve_func(A, b, u, p, isfresh, Pl, Pr, cacheval; kwargs...) return SciMLBase.build_linear_solution(alg, u, nothing, cache) @@ -79,7 +79,7 @@ sol = solve(prob, alg) struct DirectLdiv! <: AbstractSolveFunction end function SciMLBase.solve!(cache::LinearCache, alg::DirectLdiv!, args...; kwargs...) - @unpack A, b, u = cache + (; A, b, u) = cache ldiv!(u, A, b) return SciMLBase.build_linear_solution(alg, u, nothing, cache)