Skip to content

Commit f4de750

Browse files
committed
SCIPwriteMIP
1 parent bb68d04 commit f4de750

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

src/pyscipopt/scip.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ cdef extern from "scip/scip.h":
699699
SCIP_RETCODE SCIPwriteOrigProblem(SCIP* scip, char* filename, char* extension, SCIP_Bool genericnames)
700700
SCIP_RETCODE SCIPwriteTransProblem(SCIP* scip, char* filename, char* extension, SCIP_Bool genericnames)
701701
SCIP_RETCODE SCIPwriteLP(SCIP* scip, const char*)
702+
SCIP_RETCODE SCIPwriteMIP(SCIP * scip, const char * filename, SCIP_Bool genericnames, SCIP_Bool origobj, SCIP_Bool lazyconss)
702703
SCIP_STATUS SCIPgetStatus(SCIP* scip)
703704
SCIP_Real SCIPepsilon(SCIP* scip)
704705
SCIP_Real SCIPfeastol(SCIP* scip)

src/pyscipopt/scip.pxi

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9392,6 +9392,29 @@ cdef class Model:
93929392
PY_SCIP_CALL( SCIPwriteLP(self._scip, absfile) )
93939393

93949394
locale.setlocale(locale.LC_NUMERIC,user_locale)
9395+
9396+
def writeMIP(self, filename, genericnames=False, origobj=False, lazyconss=False):
9397+
"""
9398+
Writes MIP relaxation of the current branch-and-bound node to a file
9399+
9400+
Parameters
9401+
----------
9402+
filename : str
9403+
name of the output file
9404+
genericnames : bool, optional
9405+
should generic names like x_i and row_j be used in order to avoid troubles with reserved symbols? (Default value = False)
9406+
origobj : bool, optional
9407+
should the original objective function be used (Default value = False)
9408+
lazyconss : bool, optional
9409+
output removable rows as lazy constraints? (Default value = False)
9410+
"""
9411+
user_locale = locale.getlocale(category=locale.LC_NUMERIC)
9412+
locale.setlocale(locale.LC_NUMERIC, "C")
9413+
9414+
absfile = str_conversion(abspath(filename))
9415+
PY_SCIP_CALL(SCIPwriteMIP(self._scip, absfile, genericnames, origobj, lazyconss))
9416+
9417+
locale.setlocale(locale.LC_NUMERIC,user_locale)
93959418

93969419
def createSol(self, Heur heur = None, initlp=False):
93979420
"""

0 commit comments

Comments
 (0)