Skip to content

Commit 7fbde01

Browse files
🤖 Format .jl files (#392)
Co-authored-by: tmigot <tmigot@users.noreply.github.com>
1 parent ccf94f8 commit 7fbde01

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

benchmark/benchmarks.jl

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,34 +17,44 @@ const list_problems_PureJuMP = setdiff(list_problems, list_problems_not_PureJuMP
1717
const SUITE = BenchmarkGroup()
1818

1919
const SAMPLES = 5
20-
const EVALS = 1
20+
const EVALS = 1
2121

2222
SUITE["ADNLPProblems"] = BenchmarkGroup()
2323
SUITE["ADNLPProblems"]["NLP"] = BenchmarkGroup()
2424
SUITE["ADNLPProblems"]["NLP"]["constructor"] = BenchmarkGroup()
2525
SUITE["ADNLPProblems"]["NLP"]["obj"] = BenchmarkGroup()
2626
for pb in list_problems_ADNLPProblems
2727
problem_constructor = getproperty(OptimizationProblems.ADNLPProblems, Symbol(pb))
28-
SUITE["ADNLPProblems"]["NLP"]["constructor"][pb] = @benchmarkable $(problem_constructor)() samples=SAMPLES evals=EVALS
29-
SUITE["ADNLPProblems"]["NLP"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup = (nlp = $(problem_constructor)())
28+
SUITE["ADNLPProblems"]["NLP"]["constructor"][pb] =
29+
@benchmarkable $(problem_constructor)() samples=SAMPLES evals=EVALS
30+
SUITE["ADNLPProblems"]["NLP"]["obj"][pb] =
31+
@benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup =
32+
(nlp = $(problem_constructor)())
3033
end
3134

3235
SUITE["ADNLPProblems"]["NLS"] = BenchmarkGroup()
3336
SUITE["ADNLPProblems"]["NLS"]["constructor"] = BenchmarkGroup()
3437
SUITE["ADNLPProblems"]["NLS"]["obj"] = BenchmarkGroup()
35-
list_problems_nls_ADNLPProblems = intersect(Symbol.(OptimizationProblems.meta[OptimizationProblems.meta.objtype .== :least_squares, :name]), list_problems_ADNLPProblems)
38+
list_problems_nls_ADNLPProblems = intersect(
39+
Symbol.(OptimizationProblems.meta[OptimizationProblems.meta.objtype .== :least_squares, :name]),
40+
list_problems_ADNLPProblems,
41+
)
3642
for pb in list_problems_nls_ADNLPProblems
3743
problem_constructor = getproperty(OptimizationProblems.ADNLPProblems, Symbol(pb))
38-
SUITE["ADNLPProblems"]["NLS"]["constructor"][pb] = @benchmarkable $(problem_constructor)(use_nls = true) samples=SAMPLES evals=EVALS
39-
SUITE["ADNLPProblems"]["NLS"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup = (nlp = $(problem_constructor)(use_nls = true))
44+
SUITE["ADNLPProblems"]["NLS"]["constructor"][pb] =
45+
@benchmarkable $(problem_constructor)(use_nls = true) samples=SAMPLES evals=EVALS
46+
SUITE["ADNLPProblems"]["NLS"]["obj"][pb] =
47+
@benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup =
48+
(nlp = $(problem_constructor)(use_nls = true))
4049
end
4150
SUITE["PureJuMP"] = BenchmarkGroup()
4251
SUITE["PureJuMP"]["constructor"] = BenchmarkGroup()
4352
SUITE["PureJuMP"]["obj"] = BenchmarkGroup()
4453
for pb in list_problems_PureJuMP
45-
problem_constructor = getproperty(OptimizationProblems.PureJuMP, Symbol(pb))
46-
SUITE["PureJuMP"]["constructor"][pb] = @benchmarkable $(problem_constructor)() samples=SAMPLES evals=EVALS
47-
SUITE["PureJuMP"]["obj"][pb] = @benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup = (
48-
nlp = MathOptNLPModel($(problem_constructor)())
49-
)
54+
problem_constructor = getproperty(OptimizationProblems.PureJuMP, Symbol(pb))
55+
SUITE["PureJuMP"]["constructor"][pb] =
56+
@benchmarkable $(problem_constructor)() samples=SAMPLES evals=EVALS
57+
SUITE["PureJuMP"]["obj"][pb] =
58+
@benchmarkable obj(nlp, nlp.meta.x0) samples=SAMPLES evals=EVALS setup =
59+
(nlp = MathOptNLPModel($(problem_constructor)()))
5060
end

0 commit comments

Comments
 (0)