Skip to content

Commit 14f93a7

Browse files
committed
Fix reader write
1 parent 0b78317 commit 14f93a7

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/pyscipopt/reader.pxi

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ cdef class Reader:
1212
'''calls read method of reader'''
1313
return {}
1414

15-
def readerwrite(self, file, name, transformed, objsense, objscale, objoffset, binvars, intvars,
15+
def readerwrite(self, file, name, transformed, objsense, objoffset, objscale, binvars, intvars,
1616
implvars, contvars, fixedvars, startnvars, conss, maxnconss, startnconss, genericnames):
1717
'''calls write method of reader'''
1818
return {}
@@ -40,7 +40,8 @@ cdef SCIP_RETCODE PyReaderRead (SCIP* scip, SCIP_READER* reader, const char* fil
4040

4141
cdef SCIP_RETCODE PyReaderWrite (SCIP* scip, SCIP_READER* reader, FILE* file,
4242
const char* name, SCIP_PROBDATA* probdata, SCIP_Bool transformed,
43-
SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset,
43+
SCIP_OBJSENSE objsense, SCIP_Real objoffset, SCIP_Real objscale,
44+
SCIP_RATIONAL* objoffsetexact, SCIP_RATIONAL* objscaleexact,
4445
SCIP_VAR** vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars,
4546
SCIP_VAR** fixedvars, int nfixedvars, int startnvars,
4647
SCIP_CONS** conss, int nconss, int maxnconss, int startnconss,
@@ -58,7 +59,8 @@ cdef SCIP_RETCODE PyReaderWrite (SCIP* scip, SCIP_READER* reader, FILE* file,
5859
PyFixedVars = [Variable.create(fixedvars[i]) for i in range(nfixedvars)]
5960
PyConss = [Constraint.create(conss[i]) for i in range(nconss)]
6061
PyReader = <Reader>readerdata
61-
result_dict = PyReader.readerwrite(PyFile, PyName, transformed, objsense, objscale, objoffset,
62+
#TODO: provide rational objoffsetexact and objscaleexact
63+
result_dict = PyReader.readerwrite(PyFile, PyName, transformed, objsense, objoffset, objscale,
6264
PyBinVars, PyIntVars, PyImplVars, PyContVars, PyFixedVars, startnvars,
6365
PyConss, maxnconss, startnconss, genericnames)
6466
result[0] = result_dict.get("result", <SCIP_RESULT>result[0])

src/pyscipopt/scip.pxd

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,9 @@ cdef extern from "scip/scip.h":
361361

362362
ctypedef double SCIP_Real
363363

364+
ctypedef struct SCIP_RATIONAL:
365+
pass
366+
364367
ctypedef struct SCIP:
365368
pass
366369

@@ -957,7 +960,8 @@ cdef extern from "scip/scip.h":
957960
SCIP_RETCODE (*readerread) (SCIP* scip, SCIP_READER* reader, const char* filename, SCIP_RESULT* result),
958961
SCIP_RETCODE (*readerwrite) (SCIP* scip, SCIP_READER* reader, FILE* file,
959962
const char* name, SCIP_PROBDATA* probdata, SCIP_Bool transformed,
960-
SCIP_OBJSENSE objsense, SCIP_Real objscale, SCIP_Real objoffset,
963+
SCIP_OBJSENSE objsense, SCIP_Real objoffset, SCIP_Real objscale,
964+
SCIP_RATIONAL* objoffsetexact, SCIP_RATIONAL* objscaleexact,
961965
SCIP_VAR** vars, int nvars, int nbinvars, int nintvars, int nimplvars, int ncontvars,
962966
SCIP_VAR** fixedvars, int nfixedvars, int startnvars,
963967
SCIP_CONS** conss, int nconss, int maxnconss, int startnconss,

0 commit comments

Comments
 (0)