Skip to content

Commit 71ccdcc

Browse files
ChrisRackauckas-ClaudeChrisRackauckasclaude
authored
Remove deepcopy operations from __init path (fixes #747) (#763)
* Remove deepcopy operations from __init path Fixes #747 by replacing deepcopy with copy for matrix A and vector b in the initialization path. This allows trimming to work properly for LinearSolve cases by avoiding the deepcopy operations that prevented optimization. The recent releases of SciMLOperators.jl now define proper copy operations for SciMLOperators, making this change safe and effective. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Bump SciMLOperators requirement to v1.7.1 Updates the minimum SciMLOperators version to v1.7.1 which includes the fix for FunctionOperator copy method handling of nothing values. This resolves the CI failures by ensuring the copy operations work correctly for all SciMLOperator types. Related to SciMLOperators.jl PR #308 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]> * Update Project.toml --------- Co-authored-by: ChrisRackauckas <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent f1bdc47 commit 71ccdcc

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ RecursiveFactorization = "0.2.23"
123123
Reexport = "1.2.2"
124124
SafeTestsets = "0.1"
125125
SciMLBase = "2.70"
126-
SciMLOperators = "1"
126+
SciMLOperators = "1.7.1"
127127
Setfield = "1.1.1"
128128
SparseArrays = "1.10"
129129
Sparspak = "0.3.9"

src/common.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function __init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
321321
elseif issparsematrixcsc(A)
322322
make_SparseMatrixCSC(A)
323323
else
324-
deepcopy(A)
324+
copy(A)
325325
end
326326

327327
b = if issparsematrix(b) && !(A isa Diagonal)
@@ -334,7 +334,7 @@ function __init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
334334
# Extension must be loaded if issparsematrixcsc returns true
335335
make_SparseMatrixCSC(b)
336336
else
337-
deepcopy(b)
337+
copy(b)
338338
end
339339

340340
u0_ = u0 !== nothing ? u0 : __init_u0_from_Ab(A, b)

0 commit comments

Comments
 (0)