Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions ext/LinearSolveHYPREExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions ext/LinearSolvePardisoExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/LinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/default.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/preconditioners.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
12 changes: 6 additions & 6 deletions src/simplegmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions src/solve_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
Loading