Skip to content

Commit 0e2e49f

Browse files
format
1 parent 1364deb commit 0e2e49f

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

src/jacobian.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ function jacobian_finitediff(f, x::AbstractArray, ::Type{diff_type}, dir, colorv
109109
jac_prototype = jac_prototype)
110110
return J, _nfcount(maximum(colorvec), diff_type)
111111
end
112-
function jacobian(cache, f::F) where F
112+
function jacobian(cache, f::F) where {F}
113113
x = cache.u
114114
alg = cache.alg
115115
uf = cache.uf
@@ -136,7 +136,8 @@ function jacobian_autodiff(f, x::AbstractArray, nonlinfun, alg)
136136
maxcolor = maximum(colorvec)
137137
chunk_size = get_chunksize(alg) === Val(0) ? nothing : get_chunksize(alg)
138138
num_of_chunks = chunk_size === nothing ?
139-
Int(ceil(maxcolor / SparseDiffTools.getsize(ForwardDiff.pickchunksize(maxcolor)))) :
139+
Int(ceil(maxcolor /
140+
SparseDiffTools.getsize(ForwardDiff.pickchunksize(maxcolor)))) :
140141
Int(ceil(maxcolor / _unwrap_val(chunk_size)))
141142
(forwarddiff_color_jacobian(f, x, colorvec = colorvec, sparsity = sparsity,
142143
jac_prototype = jac_prototype, chunksize = chunk_size),

src/raphson.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,16 @@ function jacobian_caches(alg::NewtonRaphson, f, u, p, ::Val{true})
6565
linsolve = init(linprob, alg.linsolve, alias_A = true, alias_b = true,
6666
Pl = Pl, Pr = Pr)
6767

68-
du1 = zero(u); du2 = zero(u)
68+
du1 = zero(u)
69+
du2 = zero(u)
6970
tmp = zero(u)
7071
jac_config = build_jac_config(alg, f, uf, du1, u, tmp, du2)
7172

7273
uf, linsolve, J, du1, jac_config
7374
end
7475

7576
function jacobian_caches(alg::NewtonRaphson, f, u, p, ::Val{false})
76-
JacobianWrapper(f,p), nothing, nothing, nothing, nothing
77+
JacobianWrapper(f, p), nothing, nothing, nothing, nothing
7778
end
7879

7980
function SciMLBase.__init(prob::NonlinearProblem{uType, iip}, alg::NewtonRaphson,

src/utils.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,17 +49,18 @@ function alg_difftype(alg::AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}) where {
4949
end
5050

5151
function concrete_jac(alg::AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}) where {CS, AD, FDT,
52-
ST, CJ}
53-
CJ
52+
ST, CJ}
53+
CJ
5454
end
5555

56-
function get_chunksize(alg::AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}) where {CS, AD, FDT,
57-
ST, CJ}
56+
function get_chunksize(alg::AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}) where {CS, AD,
57+
FDT,
58+
ST, CJ}
5859
Val(CS)
5960
end
6061

6162
function standardtag(alg::AbstractNewtonAlgorithm{CS, AD, FDT, ST, CJ}) where {CS, AD, FDT,
62-
ST, CJ}
63+
ST, CJ}
6364
ST
6465
end
6566

0 commit comments

Comments
 (0)