Skip to content

Commit

Permalink
🤖 Format .jl files
Browse files Browse the repository at this point in the history
  • Loading branch information
amontoison committed Aug 17, 2024
1 parent 58d2b78 commit ede470b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
6 changes: 4 additions & 2 deletions src/sparse_hessian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ function sparse_hess_coord!(
end

# column icol of the compressed hessian
compressed_hessian_icol = (b.coloring_mode == :direct) ? b.compressed_hessian : view(b.compressed_hessian,:,icol)
compressed_hessian_icol =
(b.coloring_mode == :direct) ? b.compressed_hessian : view(b.compressed_hessian, :, icol)

b.longv[(ncon + 1):(ncon + b.nvar)] .= b.seed
map!(ForwardDiff.Dual{Tag}, b.lz, b.sol, b.longv)
Expand Down Expand Up @@ -312,7 +313,8 @@ function sparse_hess_coord!(
end

# column icol of the compressed hessian
compressed_hessian_icol = (b.coloring_mode == :direct) ? b.compressed_hessian : view(b.compressed_hessian,:,icol)
compressed_hessian_icol =
(b.coloring_mode == :direct) ? b.compressed_hessian : view(b.compressed_hessian, :, icol)

# objective
map!(ForwardDiff.Dual{Tagf}, b.z, x, b.seed) # x + ε * v
Expand Down
15 changes: 12 additions & 3 deletions test/sparse_hessian.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
list_sparse_hess_backend = (
(ADNLPModels.SparseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:direct}())),
(ADNLPModels.SparseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}())),
(ADNLPModels.SparseReverseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:direct}())),
(ADNLPModels.SparseReverseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}())),
(
ADNLPModels.SparseADHessian,
Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}()),
),
(
ADNLPModels.SparseReverseADHessian,
Dict(:coloring_algorithm => GreedyColoringAlgorithm{:direct}()),
),
(
ADNLPModels.SparseReverseADHessian,
Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}()),
),
(ADNLPModels.ForwardDiffADHessian, Dict()),
)

Expand Down
15 changes: 12 additions & 3 deletions test/sparse_hessian_nls.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
list_sparse_hess_backend = (
(ADNLPModels.SparseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:direct}())),
(ADNLPModels.SparseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}())),
(ADNLPModels.SparseReverseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:direct}())),
(ADNLPModels.SparseReverseADHessian, Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}())),
(
ADNLPModels.SparseADHessian,
Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}()),
),
(
ADNLPModels.SparseReverseADHessian,
Dict(:coloring_algorithm => GreedyColoringAlgorithm{:direct}()),
),
(
ADNLPModels.SparseReverseADHessian,
Dict(:coloring_algorithm => GreedyColoringAlgorithm{:substitution}()),
),
(ADNLPModels.ForwardDiffADHessian, Dict()),
)

Expand Down

0 comments on commit ede470b

Please sign in to comment.