Skip to content

Commit

Permalink
🤖 Format .jl files
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Jul 12, 2024
1 parent 406d4ad commit 093eb80
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
21 changes: 18 additions & 3 deletions src/sparse_hessian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function SparseADHessian(
colptr = trilH.colptr

# The indices of the nonzero elements in `vals` that will be processed by color `c` are stored in `dcolors[c]`.
dcolors = Dict(i => UnitRange{Int}[] for i=1:ncolors)
dcolors = Dict(i => UnitRange{Int}[] for i = 1:ncolors)
for (i, color) in enumerate(colors)
range_vals = colptr[i]:(colptr[i + 1] - 1)
push!(dcolors[color], range_vals)
Expand Down Expand Up @@ -73,7 +73,22 @@ function SparseADHessian(
Hvp = fill!(S(undef, ntotal), 0)
y = fill!(S(undef, ncon), 0)

return SparseADHessian(d, rowval, colptr, colors, ncolors, dcolors, res, lz, glz, sol, longv, Hvp, ∇φ!, y)
return SparseADHessian(
d,
rowval,
colptr,
colors,
ncolors,
dcolors,
res,
lz,
glz,
sol,
longv,
Hvp,
∇φ!,
y,
)
end

struct SparseReverseADHessian{T, S, Tagf, F, Tagψ, P} <: ADNLPModels.ADBackend
Expand Down Expand Up @@ -119,7 +134,7 @@ function SparseReverseADHessian(
colptr = trilH.colptr

# The indices of the nonzero elements in `vals` that will be processed by color `c` are stored in `dcolors[c]`.
dcolors = Dict(i => UnitRange{Int}[] for i=1:ncolors)
dcolors = Dict(i => UnitRange{Int}[] for i = 1:ncolors)
for (i, color) in enumerate(colors)
range_vals = colptr[i]:(colptr[i + 1] - 1)
push!(dcolors[color], range_vals)
Expand Down
2 changes: 1 addition & 1 deletion src/sparse_jacobian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function SparseADJacobian(
colptr = J.colptr

# The indices of the nonzero elements in `vals` that will be processed by color `c` are stored in `dcolors[c]`.
dcolors = Dict(i => UnitRange{Int}[] for i=1:ncolors)
dcolors = Dict(i => UnitRange{Int}[] for i = 1:ncolors)
for (i, color) in enumerate(colors)
range_vals = colptr[i]:(colptr[i + 1] - 1)
push!(dcolors[color], range_vals)
Expand Down

0 comments on commit 093eb80

Please sign in to comment.