Skip to content
This repository was archived by the owner on Aug 22, 2025. It is now read-only.

Commit 4c760e8

Browse files
committed
make structs immutable
1 parent df9b45a commit 4c760e8

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/differentiation/jaches_products.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ end
198198

199199
### Operator Forms
200200

201-
mutable struct FwdModeAutoDiffVecProd{F,U,C,V,V!} <: AbstractAutoDiffVecProd
201+
struct FwdModeAutoDiffVecProd{F,U,C,V,V!} <: AbstractAutoDiffVecProd
202202
f::F
203203
u::U
204204
cache::C
@@ -211,7 +211,7 @@ function update_coefficients(L::FwdModeAutoDiffVecProd, u, p, t)
211211
end
212212

213213
function update_coefficients!(L::FwdModeAutoDiffVecProd, u, p, t)
214-
L.u .= u
214+
copy!(L.u, u)
215215
L
216216
end
217217

src/differentiation/vecjac_products.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ end
3737

3838
### Operator Forms
3939

40-
mutable struct RevModeAutoDiffVecProd{ad,iip,oop,F,U,C,V,V!} <: AbstractAutoDiffVecProd
40+
struct RevModeAutoDiffVecProd{ad,iip,oop,F,U,C,V,V!} <: AbstractAutoDiffVecProd
4141
f::F
4242
u::U
4343
cache::C
@@ -68,7 +68,7 @@ function update_coefficients(L::RevModeAutoDiffVecProd, u, p, t)
6868
end
6969

7070
function update_coefficients!(L::RevModeAutoDiffVecProd, u, p, t)
71-
L.u .= u
71+
copy!(L.u, u)
7272
L
7373
end
7474

0 commit comments

Comments
 (0)