Skip to content

Commit fdd6495

Browse files
committed
Reformat variable declarations
1 parent f601a1a commit fdd6495

File tree

7 files changed

+80
-104
lines changed

7 files changed

+80
-104
lines changed

src/pyscipopt/benders.pxi

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,8 @@ cdef SCIP_RETCODE PyBendersSolvesub (SCIP* scip, SCIP_BENDERS* benders, SCIP_SOL
175175
cdef SCIP_RETCODE PyBendersPostsolve (SCIP* scip, SCIP_BENDERS* benders, SCIP_SOL* sol,
176176
SCIP_BENDERSENFOTYPE type, int* mergecands, int npriomergecands, int nmergecands, SCIP_Bool checkint,
177177
SCIP_Bool infeasible, SCIP_Bool* merged) noexcept with gil:
178-
cdef SCIP_BENDERSDATA* bendersdata
178+
cdef SCIP_BENDERSDATA* bendersdata = SCIPbendersGetData(benders)
179179
cdef int i
180-
181-
bendersdata = SCIPbendersGetData(benders)
182180
PyBenders = <Benders>bendersdata
183181
if sol == NULL:
184182
solution = None

src/pyscipopt/conshdlr.pxi

Lines changed: 17 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -168,60 +168,54 @@ cdef SCIP_RETCODE PyConsFree (SCIP* scip, SCIP_CONSHDLR* conshdlr) noexcept with
168168
return SCIP_OKAY
169169

170170
cdef SCIP_RETCODE PyConsInit (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
171-
PyConshdlr = getPyConshdlr(conshdlr)
172171
cdef int i
173-
174-
cdef constraints = []
172+
PyConshdlr = getPyConshdlr(conshdlr)
173+
constraints = []
175174
for i in range(nconss):
176175
constraints.append(getPyCons(conss[i]))
177176
PyConshdlr.consinit(constraints)
178177
return SCIP_OKAY
179178

180179
cdef SCIP_RETCODE PyConsExit (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
181180
cdef int i
182-
183181
PyConshdlr = getPyConshdlr(conshdlr)
184-
cdef constraints = []
182+
constraints = []
185183
for i in range(nconss):
186184
constraints.append(getPyCons(conss[i]))
187185
PyConshdlr.consexit(constraints)
188186
return SCIP_OKAY
189187

190188
cdef SCIP_RETCODE PyConsInitpre (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
191189
cdef int i
192-
193190
PyConshdlr = getPyConshdlr(conshdlr)
194-
cdef constraints = []
191+
constraints = []
195192
for i in range(nconss):
196193
constraints.append(getPyCons(conss[i]))
197194
PyConshdlr.consinitpre(constraints)
198195
return SCIP_OKAY
199196

200197
cdef SCIP_RETCODE PyConsExitpre (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
201198
cdef int i
202-
203199
PyConshdlr = getPyConshdlr(conshdlr)
204-
cdef constraints = []
200+
constraints = []
205201
for i in range(nconss):
206202
constraints.append(getPyCons(conss[i]))
207203
PyConshdlr.consexitpre(constraints)
208204
return SCIP_OKAY
209205

210206
cdef SCIP_RETCODE PyConsInitsol (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
211207
cdef int i
212-
213208
PyConshdlr = getPyConshdlr(conshdlr)
214-
cdef constraints = []
209+
constraints = []
215210
for i in range(nconss):
216211
constraints.append(getPyCons(conss[i]))
217212
PyConshdlr.consinitsol(constraints)
218213
return SCIP_OKAY
219214

220215
cdef SCIP_RETCODE PyConsExitsol (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_Bool restart) noexcept with gil:
221216
cdef int i
222-
223217
PyConshdlr = getPyConshdlr(conshdlr)
224-
cdef constraints = []
218+
constraints = []
225219
for i in range(nconss):
226220
constraints.append(getPyCons(conss[i]))
227221
PyConshdlr.consexitsol(constraints, restart)
@@ -257,9 +251,8 @@ cdef SCIP_RETCODE PyConsTrans (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS* s
257251

258252
cdef SCIP_RETCODE PyConsInitlp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_Bool* infeasible) noexcept with gil:
259253
cdef int i
260-
261254
PyConshdlr = getPyConshdlr(conshdlr)
262-
cdef constraints = []
255+
constraints = []
263256
for i in range(nconss):
264257
constraints.append(getPyCons(conss[i]))
265258
result_dict = PyConshdlr.consinitlp(constraints)
@@ -268,9 +261,8 @@ cdef SCIP_RETCODE PyConsInitlp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS**
268261

269262
cdef SCIP_RETCODE PyConsSepalp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, SCIP_RESULT* result) noexcept with gil:
270263
cdef int i
271-
272264
PyConshdlr = getPyConshdlr(conshdlr)
273-
cdef constraints = []
265+
constraints = []
274266
for i in range(nconss):
275267
constraints.append(getPyCons(conss[i]))
276268
result_dict = PyConshdlr.conssepalp(constraints, nusefulconss)
@@ -280,9 +272,8 @@ cdef SCIP_RETCODE PyConsSepalp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS**
280272
cdef SCIP_RETCODE PyConsSepasol (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss,
281273
SCIP_SOL* sol, SCIP_RESULT* result) noexcept with gil:
282274
cdef int i
283-
284275
PyConshdlr = getPyConshdlr(conshdlr)
285-
cdef constraints = []
276+
constraints = []
286277
for i in range(nconss):
287278
constraints.append(getPyCons(conss[i]))
288279
solution = Solution.create(scip, sol)
@@ -293,9 +284,8 @@ cdef SCIP_RETCODE PyConsSepasol (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS*
293284
cdef SCIP_RETCODE PyConsEnfolp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss,
294285
SCIP_Bool solinfeasible, SCIP_RESULT* result) noexcept with gil:
295286
cdef int i
296-
297287
PyConshdlr = getPyConshdlr(conshdlr)
298-
cdef constraints = []
288+
constraints = []
299289
for i in range(nconss):
300290
constraints.append(getPyCons(conss[i]))
301291
result_dict = PyConshdlr.consenfolp(constraints, nusefulconss, solinfeasible)
@@ -304,9 +294,8 @@ cdef SCIP_RETCODE PyConsEnfolp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS**
304294

305295
cdef SCIP_RETCODE PyConsEnforelax (SCIP* scip, SCIP_SOL* sol, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, SCIP_Bool solinfeasible, SCIP_RESULT* result) noexcept with gil:
306296
cdef int i
307-
308297
PyConshdlr = getPyConshdlr(conshdlr)
309-
cdef constraints = []
298+
constraints = []
310299
for i in range(nconss):
311300
constraints.append(getPyCons(conss[i]))
312301
solution = Solution.create(scip, sol)
@@ -317,9 +306,8 @@ cdef SCIP_RETCODE PyConsEnforelax (SCIP* scip, SCIP_SOL* sol, SCIP_CONSHDLR* con
317306
cdef SCIP_RETCODE PyConsEnfops (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss,
318307
SCIP_Bool solinfeasible, SCIP_Bool objinfeasible, SCIP_RESULT* result) noexcept with gil:
319308
cdef int i
320-
321309
PyConshdlr = getPyConshdlr(conshdlr)
322-
cdef constraints = []
310+
constraints = []
323311
for i in range(nconss):
324312
constraints.append(getPyCons(conss[i]))
325313
result_dict = PyConshdlr.consenfops(constraints, nusefulconss, solinfeasible, objinfeasible)
@@ -329,9 +317,8 @@ cdef SCIP_RETCODE PyConsEnfops (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS**
329317
cdef SCIP_RETCODE PyConsCheck (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, SCIP_SOL* sol, SCIP_Bool checkintegrality,
330318
SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool completely, SCIP_RESULT* result) noexcept with gil:
331319
cdef int i
332-
333320
PyConshdlr = getPyConshdlr(conshdlr)
334-
cdef constraints = []
321+
constraints = []
335322
for i in range(nconss):
336323
constraints.append(getPyCons(conss[i]))
337324
solution = Solution.create(scip, sol)
@@ -342,9 +329,8 @@ cdef SCIP_RETCODE PyConsCheck (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS**
342329
cdef SCIP_RETCODE PyConsProp (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss, int nusefulconss, int nmarkedconss,
343330
SCIP_PROPTIMING proptiming, SCIP_RESULT* result) noexcept with gil:
344331
cdef int i
345-
346332
PyConshdlr = getPyConshdlr(conshdlr)
347-
cdef constraints = []
333+
constraints = []
348334
for i in range(nconss):
349335
constraints.append(getPyCons(conss[i]))
350336
result_dict = PyConshdlr.consprop(constraints, nusefulconss, nmarkedconss, proptiming)
@@ -357,9 +343,8 @@ cdef SCIP_RETCODE PyConsPresol (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS**
357343
int* nfixedvars, int* naggrvars, int* nchgvartypes, int* nchgbds, int* naddholes,
358344
int* ndelconss, int* naddconss, int* nupgdconss, int* nchgcoefs, int* nchgsides, SCIP_RESULT* result) noexcept with gil:
359345
cdef int i
360-
361346
PyConshdlr = getPyConshdlr(conshdlr)
362-
cdef constraints = []
347+
constraints = []
363348
for i in range(nconss):
364349
constraints.append(getPyCons(conss[i]))
365350
# dictionary for input/output parameters
@@ -432,9 +417,8 @@ cdef SCIP_RETCODE PyConsDisable (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS*
432417

433418
cdef SCIP_RETCODE PyConsDelvars (SCIP* scip, SCIP_CONSHDLR* conshdlr, SCIP_CONS** conss, int nconss) noexcept with gil:
434419
cdef int i
435-
436420
PyConshdlr = getPyConshdlr(conshdlr)
437-
cdef constraints = []
421+
constraints = []
438422
for i in range(nconss):
439423
constraints.append(getPyCons(conss[i]))
440424
PyConshdlr.consdelvars(constraints)

src/pyscipopt/cutsel.pxi

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,10 @@ cdef SCIP_RETCODE PyCutselExitsol (SCIP* scip, SCIP_CUTSEL* cutsel) noexcept wit
7272
cdef SCIP_RETCODE PyCutselSelect (SCIP* scip, SCIP_CUTSEL* cutsel, SCIP_ROW** cuts, int ncuts,
7373
SCIP_ROW** forcedcuts, int nforcedcuts, SCIP_Bool root, int maxnselectedcuts,
7474
int* nselectedcuts, SCIP_RESULT* result) noexcept with gil:
75-
cdef SCIP_CUTSELDATA* cutseldata
75+
cdef SCIP_CUTSELDATA* cutseldata = SCIPcutselGetData(cutsel)
7676
cdef SCIP_ROW* scip_row
7777
cdef int i
78-
79-
cutseldata = SCIPcutselGetData(cutsel)
78+
8079
PyCutsel = <Cutsel>cutseldata
8180

8281
# translate cuts to python

0 commit comments

Comments
 (0)