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 18, 2024
1 parent 1a166ad commit fd497cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/sparse_hessian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ struct SparseADHessian{Tag, GT, S, T} <: ADNLPModels.ADBackend
colptr::Vector{Int}
colors::Vector{Int}
ncolors::Int
dcolors::Dict{Int, Vector{Tuple{Int,Int}}}
dcolors::Dict{Int, Vector{Tuple{Int, Int}}}
res::S
lz::Vector{ForwardDiff.Dual{Tag, T, 1}}
glz::Vector{ForwardDiff.Dual{Tag, T, 1}}
Expand Down Expand Up @@ -92,7 +92,7 @@ struct SparseReverseADHessian{T, S, Tagf, F, Tagψ, P} <: ADNLPModels.ADBackend
colptr::Vector{Int}
colors::Vector{Int}
ncolors::Int
dcolors::Dict{Int, Vector{Tuple{Int,Int}}}
dcolors::Dict{Int, Vector{Tuple{Int, Int}}}
res::S
z::Vector{ForwardDiff.Dual{Tagf, T, 1}}
gz::Vector{ForwardDiff.Dual{Tagf, T, 1}}
Expand Down
6 changes: 3 additions & 3 deletions src/sparsity_pattern.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ function nnz_colors(trilH, star_set, colors, ncolors)
# We want to determine the coefficients in `trilH` that will be computed by a given color.
# Because we exploit the symmetry, we also need to store the row index for a given coefficient
# in the "compressed column".
dcolors = Dict(i => Tuple{Int,Int}[] for i=1:ncolors)
dcolors = Dict(i => Tuple{Int, Int}[] for i = 1:ncolors)

n = LinearAlgebra.checksquare(trilH)
for j in 1:n
for k in trilH.colptr[j]:trilH.colptr[j+1]-1
for j = 1:n
for k = trilH.colptr[j]:(trilH.colptr[j + 1] - 1)
i = trilH.rowval[k]
l, c = symmetric_coefficient(i, j, colors, star_set)
push!(dcolors[c], (l, k))
Expand Down

0 comments on commit fd497cf

Please sign in to comment.