diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 3330cde0a..8bb51bab2 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -138,7 +138,15 @@ include("solve_function.jl") include("default.jl") include("init.jl") include("adjoint.jl") -include("deprecated.jl") + +## Deprecated, remove in July 2025 + +@static if isdefined(SciMLBase, :DiffEqArrayOperator) + function defaultalg(A::SciMLBase.DiffEqArrayOperator, b, + assump::OperatorAssumptions{Bool}) + defaultalg(A.A, b, assump) + end +end @inline function _notsuccessful(F::LinearAlgebra.QRCompactWY) (m, n) = size(F) diff --git a/src/default.jl b/src/default.jl index 2c86f899a..f5772ade4 100644 --- a/src/default.jl +++ b/src/default.jl @@ -45,7 +45,7 @@ end # For SciML algorithms already using `defaultalg`, all assume square matrix. defaultalg(A, b) = defaultalg(A, b, OperatorAssumptions(true)) -function defaultalg(A::Union{DiffEqArrayOperator, MatrixOperator}, b, +function defaultalg(A::MatrixOperator, b, assump::OperatorAssumptions{Bool}) defaultalg(A.A, b, assump) end diff --git a/src/deprecated.jl b/src/deprecated.jl deleted file mode 100644 index 19623c4c0..000000000 --- a/src/deprecated.jl +++ /dev/null @@ -1,85 +0,0 @@ -const warned_a = Ref(false) -const warned_b = Ref(false) -const warned_u = Ref(false) -const warned_p = Ref(false) -const warned_prec = Ref(false) -const warned_cacheval = Ref(false) -""" -$(SIGNATURES) -""" -function set_A(cache::LinearCache, A) - if !warned_a[] - @warn "set_A is deprecated for mutation on the cache. Use `cache.A = A" - warned_a[] = true - end - @set! cache.A = A - @set! cache.isfresh = true - return cache -end - -""" -$(SIGNATURES) -""" -function set_b(cache::LinearCache, b) - if !warned_b[] - @warn "set_b is deprecated for mutation on the cache. Use `cache.b = b" - warned_b[] = true - end - @set! cache.b = b - return cache -end - -""" -$(SIGNATURES) -""" -function set_u(cache::LinearCache, u) - if !warned_u[] - @warn "set_u is deprecated for mutation on the cache. Use `cache.u = u" - warned_u[] = true - end - @set! cache.u = u - return cache -end - -""" -$(SIGNATURES) -""" -function set_p(cache::LinearCache, p) - if !warned_p[] - @warn "set_p is deprecated for mutation on the cache. Use `cache.p = p" - warned_p[] = true - end - @set! cache.p = p - # @set! cache.isfresh = true - return cache -end - -""" -$(SIGNATURES) -""" -function set_prec(cache, Pl, Pr) - if !warned_prec[] - @warn "set_prec is deprecated for mutation on the cache. Use `cache.Pl = Pl; cache.Pr = Pr" - warned_prec[] = true - end - @set! cache.Pl = Pl - @set! cache.Pr = Pr - return cache -end - -function set_cacheval(cache::LinearCache, alg_cache) - if !warned_cacheval[] - @warn "set_cacheval is deprecated for mutation on the cache. Use `cache.cacheval = cacheval; cache.isfresh = false" - warned_cacheval[] = true - end - if cache.isfresh - @set! cache.cacheval = alg_cache - @set! cache.isfresh = false - return cache - end -end - -@deprecate SciMLBase.solve(cache::LinearCache, args...; kwargs...) SciMLBase.solve!( - cache::LinearCache, - args...; - kwargs...) false diff --git a/test/pardiso/pardiso.jl b/test/pardiso/pardiso.jl index 0a402005f..ac37f0c20 100644 --- a/test/pardiso/pardiso.jl +++ b/test/pardiso/pardiso.jl @@ -54,17 +54,17 @@ prob = LinearProblem(copy(A), copy(b1)) linsolve = init(prob, UMFPACKFactorization()) sol11 = solve!(linsolve) -linsolve = LinearSolve.set_b(sol11.cache, copy(b2)) +linsolve.b = copy(b2) sol12 = solve!(linsolve) -linsolve = LinearSolve.set_A(sol12.cache, copy(A2)) +linsolve.A = copy(A2) sol13 = solve!(linsolve) for alg in algs linsolve = init(prob, alg) sol31 = solve!(linsolve) - linsolve = LinearSolve.set_b(sol31.cache, copy(b2)) + linsolve.b = copy(b2) sol32 = solve!(linsolve) - linsolve = LinearSolve.set_A(sol32.cache, copy(A2)) + linsolve.A = copy(A2) sol33 = solve!(linsolve) @test sol11.u ≈ sol31.u @test sol12.u ≈ sol32.u