Skip to content

Commit 101e896

Browse files
🤖 Format .jl files (#405)
Co-authored-by: tmigot <tmigot@users.noreply.github.com>
1 parent 1cee776 commit 101e896

File tree

9 files changed

+342
-69
lines changed

9 files changed

+342
-69
lines changed

src/ADNLPProblems/hs117.jl

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
export hs117
22

33
function hs117(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
4-
a = Rational{Int}[-16 2 0 1 0;
5-
0 -2 0 4 2;
6-
-7 // 2 0 2 0 0;
7-
0 -2 0 -4 -1;
8-
0 -9 -2 1 -14 // 5;
9-
2 0 -4 0 0;
10-
-1 -1 -1 -1 -1;
11-
-1 -2 -3 -2 -1;
12-
1 2 3 4 5;
13-
1 1 1 1 1]
4+
a = Rational{Int}[
5+
-16 2 0 1 0;
6+
0 -2 0 4 2;
7+
-7 // 2 0 2 0 0;
8+
0 -2 0 -4 -1;
9+
0 -9 -2 1 -14 // 5;
10+
2 0 -4 0 0;
11+
-1 -1 -1 -1 -1;
12+
-1 -2 -3 -2 -1;
13+
1 2 3 4 5;
14+
1 1 1 1 1
15+
]
1416

1517
b = [-40, -2, -25 // 100, -4, -4, -1, -40, -60, 5, 1]
1618

17-
c = [ 30 -20 -10 32 -10;
18-
-20 39 -6 -31 32;
19-
-10 -6 10 -6 -10;
20-
32 -31 -6 39 -20;
21-
-10 32 -10 -20 30]
19+
c = [
20+
30 -20 -10 32 -10;
21+
-20 39 -6 -31 32;
22+
-10 -6 10 -6 -10;
23+
32 -31 -6 39 -20;
24+
-10 32 -10 -20 30
25+
]
2226

2327
d = [4, 8, 10, 6, 2]
2428

src/ADNLPProblems/hs119.jl

Lines changed: 275 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,271 @@
11
export hs119
22

33
function hs119(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) where {T}
4-
Q_rows = [1, 2, 2, 3, 1, 4, 5, 5, 6, 1, 2, 3, 4, 7, 1, 6, 8, 3, 9, 2, 3, 5, 8, 10, 4, 7, 11, 5, 9, 12, 7, 11, 13, 3, 10, 12, 13, 14, 4, 6, 8, 15, 1, 5, 9, 16]
5-
Q_cols = [1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16]
4+
Q_rows = [
5+
1,
6+
2,
7+
2,
8+
3,
9+
1,
10+
4,
11+
5,
12+
5,
13+
6,
14+
1,
15+
2,
16+
3,
17+
4,
18+
7,
19+
1,
20+
6,
21+
8,
22+
3,
23+
9,
24+
2,
25+
3,
26+
5,
27+
8,
28+
10,
29+
4,
30+
7,
31+
11,
32+
5,
33+
9,
34+
12,
35+
7,
36+
11,
37+
13,
38+
3,
39+
10,
40+
12,
41+
13,
42+
14,
43+
4,
44+
6,
45+
8,
46+
15,
47+
1,
48+
5,
49+
9,
50+
16,
51+
]
52+
Q_cols = [
53+
1,
54+
2,
55+
3,
56+
3,
57+
4,
58+
4,
59+
5,
60+
6,
61+
6,
62+
7,
63+
7,
64+
7,
65+
7,
66+
7,
67+
8,
68+
8,
69+
8,
70+
9,
71+
9,
72+
10,
73+
10,
74+
10,
75+
10,
76+
10,
77+
11,
78+
11,
79+
11,
80+
12,
81+
12,
82+
12,
83+
13,
84+
13,
85+
13,
86+
14,
87+
14,
88+
14,
89+
14,
90+
14,
91+
15,
92+
15,
93+
15,
94+
15,
95+
16,
96+
16,
97+
16,
98+
16,
99+
]
6100

7-
clinrows = [1, 2, 3, 4, 7, 1, 3, 4, 6, 8, 1, 2, 4, 6, 8, 1, 2, 4, 5, 7, 8, 1, 2, 3, 5, 6, 8, 1, 3, 4, 5, 6, 1, 2, 4, 5, 6, 7, 8, 1, 3, 5, 6, 8, 1, 7, 2, 3, 4, 5, 6, 7, 8]
8-
clincols = [1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 10, 11, 12, 13, 14, 15, 16]
9-
clinvals = T[0.22, -1.46, 1.29, -1.1, 1.12, 0.2, -0.89, -1.06, -1.72, 0.45, 0.19, -1.3, 0.95, -0.33, 0.26, 0.25, 1.82, -0.54, -1.43, 0.31, -1.1, 0.15, -1.15, -1.16, 1.51, 1.62, 0.58, 0.11, -0.96, -1.78, 0.59, 1.24, 0.12, 0.8, -0.41, -0.33, 0.21, 1.12, -1.03, 0.13, -0.49, -0.43, -0.26, 0.1, 1.0, -0.36, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0]
101+
clinrows = [
102+
1,
103+
2,
104+
3,
105+
4,
106+
7,
107+
1,
108+
3,
109+
4,
110+
6,
111+
8,
112+
1,
113+
2,
114+
4,
115+
6,
116+
8,
117+
1,
118+
2,
119+
4,
120+
5,
121+
7,
122+
8,
123+
1,
124+
2,
125+
3,
126+
5,
127+
6,
128+
8,
129+
1,
130+
3,
131+
4,
132+
5,
133+
6,
134+
1,
135+
2,
136+
4,
137+
5,
138+
6,
139+
7,
140+
8,
141+
1,
142+
3,
143+
5,
144+
6,
145+
8,
146+
1,
147+
7,
148+
2,
149+
3,
150+
4,
151+
5,
152+
6,
153+
7,
154+
8,
155+
]
156+
clincols = [
157+
1,
158+
1,
159+
1,
160+
1,
161+
1,
162+
2,
163+
2,
164+
2,
165+
2,
166+
2,
167+
3,
168+
3,
169+
3,
170+
3,
171+
3,
172+
4,
173+
4,
174+
4,
175+
4,
176+
4,
177+
4,
178+
5,
179+
5,
180+
5,
181+
5,
182+
5,
183+
5,
184+
6,
185+
6,
186+
6,
187+
6,
188+
6,
189+
7,
190+
7,
191+
7,
192+
7,
193+
7,
194+
7,
195+
7,
196+
8,
197+
8,
198+
8,
199+
8,
200+
8,
201+
9,
202+
9,
203+
10,
204+
11,
205+
12,
206+
13,
207+
14,
208+
15,
209+
16,
210+
]
211+
clinvals = T[
212+
0.22,
213+
-1.46,
214+
1.29,
215+
-1.1,
216+
1.12,
217+
0.2,
218+
-0.89,
219+
-1.06,
220+
-1.72,
221+
0.45,
222+
0.19,
223+
-1.3,
224+
0.95,
225+
-0.33,
226+
0.26,
227+
0.25,
228+
1.82,
229+
-0.54,
230+
-1.43,
231+
0.31,
232+
-1.1,
233+
0.15,
234+
-1.15,
235+
-1.16,
236+
1.51,
237+
1.62,
238+
0.58,
239+
0.11,
240+
-0.96,
241+
-1.78,
242+
0.59,
243+
1.24,
244+
0.12,
245+
0.8,
246+
-0.41,
247+
-0.33,
248+
0.21,
249+
1.12,
250+
-1.03,
251+
0.13,
252+
-0.49,
253+
-0.43,
254+
-0.26,
255+
0.1,
256+
1.0,
257+
-0.36,
258+
1.0,
259+
1.0,
260+
1.0,
261+
1.0,
262+
1.0,
263+
1.0,
264+
1.0,
265+
]
10266

11267
function f(x; rows = Q_rows, cols = Q_cols)
12-
return sum((x[rows[k]]^2 + x[rows[k]] + 1) * (x[cols[k]]^2 + x[cols[k]] + 1) for k in 1:46)
268+
return sum((x[rows[k]]^2 + x[rows[k]] + 1) * (x[cols[k]]^2 + x[cols[k]] + 1) for k = 1:46)
13269
end
14270

15271
x0 = 10 * ones(T, 16)
@@ -35,5 +291,17 @@ function hs119(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) wher
35291
36.8,
36292
-24,
37293
]
38-
return ADNLPModels.ADNLPModel(f, x0, lvar, uvar, clinrows, clincols, clinvals, lcon, ucon, name = "hs119"; kwargs...)
294+
return ADNLPModels.ADNLPModel(
295+
f,
296+
x0,
297+
lvar,
298+
uvar,
299+
clinrows,
300+
clincols,
301+
clinvals,
302+
lcon,
303+
ucon,
304+
name = "hs119";
305+
kwargs...,
306+
)
39307
end

src/ADNLPProblems/lincon.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ function lincon(; n::Int = default_nvar, type::Type{T} = Float64, kwargs...) whe
66

77
clinrows = [5, 6, 5, 6, 8, 9, 10, 3, 2, 11, 11, 4, 4, 4, 7, 7, 1]
88
clincols = [1, 1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
9-
clinvals = T[1.0, 3.0, 2.0, 4.0, 9.0, 12.0, 15.0, 4.0, -2.0, 5.0, 6.0, 1.0, 2.0, 3.0, 1.0, -1.0, 15.0]
9+
clinvals =
10+
T[1.0, 3.0, 2.0, 4.0, 9.0, 12.0, 15.0, 4.0, -2.0, 5.0, 6.0, 1.0, 2.0, 3.0, 1.0, -1.0, 15.0]
1011

1112
lcon = T[22.0, -1.0, 1.0, 1.0, -5.0, -6.0, -Inf, -Inf, -Inf, -Inf, -11.0]
1213
ucon = T[22.0, -1.0, 1.0, Inf, Inf, Inf, 16.0, 1.0, 2.0, 3.0, 9.0]

0 commit comments

Comments
 (0)