From dca59f6991b371fcadd3c6e4dac745066d4c1a2f Mon Sep 17 00:00:00 2001 From: Peter <47452063+pet-mit@users.noreply.github.com> Date: Tue, 7 Mar 2023 17:56:57 +0100 Subject: [PATCH] Update to XPRESS 9.0 (#82) * rename JNI module "main" * Remove useless XPRESS lib dependencies * Remove useless XPRESS lib dependencies from implementation * temporarily deactivate windows build * temporarily deactivate windows build pt2 * reactivate windows build * update python script * code style * cleanup * correction to stay compatible with xpress 8.13 * correction to stay compatible with xpress 8.13 * clean up python script * Update python script to detect control parameters * Update for XPRESS 9.0. Add seperate Int64 controls. Exclude parameters that are not for XPRSprob and XPRS_COMPUTE * fix link in README.md * test build with XPRESS 9.0 * test build with XPRESS 9.0 * update workflows * update workflows * update workflows * review changes --- .github/workflows/centos.yml | 4 +- .github/workflows/ubuntu-windows.yml | 12 +- README.md | 9 + .../unittests/xpress_interface.cc | 55 +- ortools/linear_solver/xpress_interface.cc | 647 +++++++++--------- ortools/xpress/environment.cc | 4 +- ortools/xpress/environment.h | 41 +- ortools/xpress/parse_header_xpress.py | 236 ++++--- 8 files changed, 544 insertions(+), 464 deletions(-) diff --git a/.github/workflows/centos.yml b/.github/workflows/centos.yml index af91b0724ab..befcc018137 100644 --- a/.github/workflows/centos.yml +++ b/.github/workflows/centos.yml @@ -22,7 +22,7 @@ jobs: container: 'centos:centos7' env: SIRIUS_RELEASE_TAG: antares-integration-v1.3 - XPRESS_INSTALL_DIR: xpressmp813/ + XPRESS_INSTALL_DIR: xpressmp/ SIRIUS_INSTALL_DIR: sirius_install/ strategy: fail-fast: false @@ -79,7 +79,7 @@ jobs: with: repository: rte-france/xpress-mp path: ${{ env.XPRESS_INSTALL_DIR }} - ref: master + ref: "9.0" token: ${{ secrets.ACCESS_TOKEN }} - name: set Xpress variables diff --git a/.github/workflows/ubuntu-windows.yml b/.github/workflows/ubuntu-windows.yml index 1398b63f5ec..54247956709 100644 --- a/.github/workflows/ubuntu-windows.yml +++ b/.github/workflows/ubuntu-windows.yml @@ -19,9 +19,9 @@ jobs: runs-on: ${{ matrix.os }} env: SIRIUS_RELEASE_TAG: ${{ matrix.sirius-release-tag }} - XPRESSDIR: ${{ github.workspace }}/xpressmp813 - XPRESS: ${{ github.workspace }}/xpressmp813/bin - XPRS_LIB_PATH: ${{ github.workspace }}/xpressmp813/lib + XPRESSDIR: ${{ github.workspace }}/xpressmp + XPRESS: ${{ github.workspace }}/xpressmp/bin + XPRS_LIB_PATH: ${{ github.workspace }}/xpressmp/lib SIRIUS_INSTALL_PATH : ${{ github.workspace }}/sirius_install SIRIUS: ${{ github.workspace }}/sirius_install/bin strategy: @@ -154,7 +154,7 @@ jobs: with: key: ${{ matrix.os }}-${{ matrix.shared }}-${{ matrix.sirius }}-${{ matrix.python-version }} - - name: setup envoronment + - name: setup environment uses: ./.github/workflows/setup-env with: os: ${{ matrix.os }} @@ -176,7 +176,7 @@ jobs: with: repository: rte-france/xpress-mp path: ${{ env.XPRESSDIR }} - ref: master + ref: "9.0" token: ${{ secrets.ACCESS_TOKEN }} - name: Checkout Xpress windows if: ${{ startsWith(matrix.os, 'windows') }} @@ -184,7 +184,7 @@ jobs: with: repository: rte-france/xpress-mp-temp path: ${{ env.XPRESSDIR }} - ref: master + ref: "9.0" token: ${{ secrets.ACCESS_TOKEN }} - name: set cache variables diff --git a/README.md b/README.md index fd005e63ea8..f5bb8c9e5ec 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,15 @@ developed by [RTE](https://www.rte-france.com/). In order to use a version of ortools with the support of Xpress, a valid Xpress installation is required. Ortools looks for the environment variable `XPRESS` that contains the path of the dynamic libraries of the solver. +#### Updating the Xpress version +If you need to build OR-Tools for a different XPRESS version than the last supported one, you can use Python script +[parse_header_xpress](ortools/xpress/parse_header_xpress.py) to make things easier. +Use it along with the XPRESS header file you have in your version: +~~~bash +python3 /path/to/ortools/linear_solver/xpress/parse_header_xpress.py /path/to/xpress/include/xprs.h +~~~ +The script will output multiple sections that you should use to replace some parts of the code of the XPRESS interface. + ### Using Sirius In order to use a version of ortools with the support of Sirius, the dynamic library of Sirius must be present on the machine. When using the dynamically linked distribution, file libsirius_solver.so / libsirius_solver.dll is required. diff --git a/ortools/linear_solver/unittests/xpress_interface.cc b/ortools/linear_solver/unittests/xpress_interface.cc index 6937bd47d43..bc8823751bd 100644 --- a/ortools/linear_solver/unittests/xpress_interface.cc +++ b/ortools/linear_solver/unittests/xpress_interface.cc @@ -116,6 +116,12 @@ namespace operations_research { return value; } + int getInteger64Control(int control) { + XPRSint64 value; + EXPECT_STATUS(XPRSgetintcontrol64(prob(), control, &value)); + return value; + } + private: MPSolver* solver_; @@ -659,6 +665,9 @@ ENDATA TEST(XpressInterface, setDoubleControls) { std::vector> params = { + {"MAXCUTTIME", XPRS_MAXCUTTIME, 1.}, + {"MAXSTALLTIME", XPRS_MAXSTALLTIME, 1.}, + {"TUNERMAXTIME", XPRS_TUNERMAXTIME, 1.}, {"MATRIXTOL", XPRS_MATRIXTOL, 1.}, {"PIVOTTOL", XPRS_PIVOTTOL, 1.}, {"FEASTOL", XPRS_FEASTOL, 1.}, @@ -689,7 +698,6 @@ ENDATA {"BARPRIMALSTOP", XPRS_BARPRIMALSTOP, 1.}, {"BARSTEPSTOP", XPRS_BARSTEPSTOP, 1.}, {"ELIMTOL", XPRS_ELIMTOL, 1.}, - {"PERTURB", XPRS_PERTURB, 1.}, {"MARKOWITZTOL", XPRS_MARKOWITZTOL, 1.}, {"MIPABSGAPNOTIFY", XPRS_MIPABSGAPNOTIFY, 1.}, {"MIPRELGAPNOTIFY", XPRS_MIPRELGAPNOTIFY, 1.}, @@ -697,6 +705,7 @@ ENDATA {"PPFACTOR", XPRS_PPFACTOR, 1.}, {"REPAIRINDEFINITEQMAX", XPRS_REPAIRINDEFINITEQMAX, 1.}, {"BARGAPTARGET", XPRS_BARGAPTARGET, 1.}, + {"DUMMYCONTROL", XPRS_DUMMYCONTROL, 1.}, {"BARSTARTWEIGHT", XPRS_BARSTARTWEIGHT, 1.}, {"BARFREESCALE", XPRS_BARFREESCALE, 1.}, {"SBEFFORT", XPRS_SBEFFORT, 1.}, @@ -706,7 +715,6 @@ ENDATA {"EIGENVALUETOL", XPRS_EIGENVALUETOL, 1.}, {"INDLINBIGM", XPRS_INDLINBIGM, 1.}, {"TREEMEMORYSAVINGTARGET", XPRS_TREEMEMORYSAVINGTARGET, 1.}, - {"GLOBALFILEBIAS", XPRS_GLOBALFILEBIAS, 1.}, {"INDPRELINBIGM", XPRS_INDPRELINBIGM, 1.}, {"RELAXTREEMEMORYLIMIT", XPRS_RELAXTREEMEMORYLIMIT, 1.}, {"MIPABSGAPNOTIFYOBJ", XPRS_MIPABSGAPNOTIFYOBJ, 1.}, @@ -731,6 +739,11 @@ ENDATA {"INPUTTOL", XPRS_INPUTTOL, 1.}, {"MIPRESTARTFACTOR", XPRS_MIPRESTARTFACTOR, 1.}, {"BAROBJPERTURB", XPRS_BAROBJPERTURB, 1.}, + {"CPIALPHA", XPRS_CPIALPHA, 1.}, + {"GLOBALBOUNDINGBOX", XPRS_GLOBALBOUNDINGBOX, 1.}, + {"TIMELIMIT", XPRS_TIMELIMIT, 1.}, + {"SOLTIMELIMIT", XPRS_SOLTIMELIMIT, 1.}, + {"REPAIRINFEASTIMELIMIT", XPRS_REPAIRINFEASTIMELIMIT, 1.}, }; for (const auto& [paramString, control, paramValue] : params) { UNITTEST_INIT_MIP(); @@ -771,7 +784,6 @@ ENDATA {"BARITERLIMIT", XPRS_BARITERLIMIT, 1}, {"CHOLESKYALG", XPRS_CHOLESKYALG, 1}, {"BAROUTPUT", XPRS_BAROUTPUT, 1}, - {"CSTYLE", XPRS_CSTYLE, 1}, {"EXTRAMIPENTS", XPRS_EXTRAMIPENTS, 1}, {"REFACTOR", XPRS_REFACTOR, 1}, {"BARTHREADS", XPRS_BARTHREADS, 1}, @@ -805,7 +817,6 @@ ENDATA {"SYMSELECT", XPRS_SYMSELECT, 1}, {"SYMMETRY", XPRS_SYMMETRY, 1}, {"MAXMEMORYHARD", XPRS_MAXMEMORYHARD, 1}, - {"LPTHREADS", XPRS_LPTHREADS, 1}, {"MIQCPALG", XPRS_MIQCPALG, 1}, {"QCCUTS", XPRS_QCCUTS, 1}, {"QCROOTALG", XPRS_QCROOTALG, 1}, @@ -828,10 +839,7 @@ ENDATA {"DUALGRADIENT", XPRS_DUALGRADIENT, 1}, {"SBITERLIMIT", XPRS_SBITERLIMIT, 1}, {"SBBEST", XPRS_SBBEST, 1}, - {"MAXCUTTIME", XPRS_MAXCUTTIME, 1}, - {"ACTIVESET", XPRS_ACTIVESET, 1}, {"BARINDEFLIMIT", XPRS_BARINDEFLIMIT, 1}, - {"HEURSTRATEGY", XPRS_HEURSTRATEGY, 1}, {"HEURFREQ", XPRS_HEURFREQ, 1}, {"HEURDEPTH", XPRS_HEURDEPTH, 1}, {"HEURMAXSOL", XPRS_HEURMAXSOL, 1}, @@ -863,7 +871,6 @@ ENDATA {"MAXCHECKSONMAXCUTTIME", XPRS_MAXCHECKSONMAXCUTTIME, 1}, {"HISTORYCOSTS", XPRS_HISTORYCOSTS, 1}, {"ALGAFTERCROSSOVER", XPRS_ALGAFTERCROSSOVER, 1}, - {"LINELENGTH", XPRS_LINELENGTH, 1}, {"MUTEXCALLBACKS", XPRS_MUTEXCALLBACKS, 1}, {"BARCRASH", XPRS_BARCRASH, 1}, {"HEURDIVESOFTROUNDING", XPRS_HEURDIVESOFTROUNDING, 1}, @@ -873,14 +880,13 @@ ENDATA {"ROOTPRESOLVE", XPRS_ROOTPRESOLVE, 1}, {"CROSSOVERDRP", XPRS_CROSSOVERDRP, 1}, {"FORCEOUTPUT", XPRS_FORCEOUTPUT, 1}, + {"PRIMALOPS", XPRS_PRIMALOPS, 1}, {"DETERMINISTIC", XPRS_DETERMINISTIC, 1}, {"PREPROBING", XPRS_PREPROBING, 1}, - {"EXTRAQCELEMENTS", XPRS_EXTRAQCELEMENTS, 1}, - {"EXTRAQCROWS", XPRS_EXTRAQCROWS, 1}, {"TREEMEMORYLIMIT", XPRS_TREEMEMORYLIMIT, 1}, {"TREECOMPRESSION", XPRS_TREECOMPRESSION, 1}, {"TREEDIAGNOSTICS", XPRS_TREEDIAGNOSTICS, 1}, - {"MAXGLOBALFILESIZE", XPRS_MAXGLOBALFILESIZE, 1}, + {"MAXTREEFILESIZE", XPRS_MAXTREEFILESIZE, 1}, {"PRECLIQUESTRATEGY", XPRS_PRECLIQUESTRATEGY, 1}, {"REPAIRINFEASMAXTIME", XPRS_REPAIRINFEASMAXTIME, 1}, {"IFCHECKCONVEXITY", XPRS_IFCHECKCONVEXITY, 1}, @@ -934,10 +940,8 @@ ENDATA {"TUNERMETHOD", XPRS_TUNERMETHOD, 1}, {"TUNERTARGET", XPRS_TUNERTARGET, 1}, {"TUNERTHREADS", XPRS_TUNERTHREADS, 1}, - {"TUNERMAXTIME", XPRS_TUNERMAXTIME, 1}, {"TUNERHISTORY", XPRS_TUNERHISTORY, 1}, {"TUNERPERMUTE", XPRS_TUNERPERMUTE, 1}, - {"TUNERROOTALG", XPRS_TUNERROOTALG, 1}, {"TUNERVERBOSE", XPRS_TUNERVERBOSE, 1}, {"TUNEROUTPUT", XPRS_TUNEROUTPUT, 1}, {"PREANALYTICCENTER", XPRS_PREANALYTICCENTER, 1}, @@ -945,7 +949,7 @@ ENDATA {"LPFLAGS", XPRS_LPFLAGS, 1}, {"MIPKAPPAFREQ", XPRS_MIPKAPPAFREQ, 1}, {"OBJSCALEFACTOR", XPRS_OBJSCALEFACTOR, 1}, - {"GLOBALFILELOGINTERVAL", XPRS_GLOBALFILELOGINTERVAL, 1}, + {"TREEFILELOGINTERVAL", XPRS_TREEFILELOGINTERVAL, 1}, {"IGNORECONTAINERCPULIMIT", XPRS_IGNORECONTAINERCPULIMIT, 1}, {"IGNORECONTAINERMEMORYLIMIT", XPRS_IGNORECONTAINERMEMORYLIMIT, 1}, {"MIPDUALREDUCTIONS", XPRS_MIPDUALREDUCTIONS, 1}, @@ -956,9 +960,9 @@ ENDATA {"GENCONSABSTRANSFORMATION", XPRS_GENCONSABSTRANSFORMATION, 1}, {"COMPUTEJOBPRIORITY", XPRS_COMPUTEJOBPRIORITY, 1}, {"PREFOLDING", XPRS_PREFOLDING, 1}, - {"COMPUTE", XPRS_COMPUTE, 0}, {"NETSTALLLIMIT", XPRS_NETSTALLLIMIT, 1}, {"SERIALIZEPREINTSOL", XPRS_SERIALIZEPREINTSOL, 1}, + {"NUMERICALEMPHASIS", XPRS_NUMERICALEMPHASIS, 1}, {"PWLNONCONVEXTRANSFORMATION", XPRS_PWLNONCONVEXTRANSFORMATION, 1}, {"MIPCOMPONENTS", XPRS_MIPCOMPONENTS, 1}, {"MIPCONCURRENTNODES", XPRS_MIPCONCURRENTNODES, 1}, @@ -972,10 +976,16 @@ ENDATA {"BARREFITER", XPRS_BARREFITER, 1}, {"COMPUTELOG", XPRS_COMPUTELOG, 1}, {"SIFTPRESOLVEOPS", XPRS_SIFTPRESOLVEOPS, 1}, + {"CHECKINPUTDATA", XPRS_CHECKINPUTDATA, 1}, {"ESCAPENAMES", XPRS_ESCAPENAMES, 1}, {"IOTIMEOUT", XPRS_IOTIMEOUT, 1}, - {"MAXSTALLTIME", XPRS_MAXSTALLTIME, 1}, {"AUTOCUTTING", XPRS_AUTOCUTTING, 1}, + {"CALLBACKCHECKTIMEDELAY", XPRS_CALLBACKCHECKTIMEDELAY, 1}, + {"MULTIOBJOPS", XPRS_MULTIOBJOPS, 1}, + {"MULTIOBJLOG", XPRS_MULTIOBJLOG, 1}, + {"GLOBALSPATIALBRANCHIFPREFERORIG", XPRS_GLOBALSPATIALBRANCHIFPREFERORIG, 1}, + {"PRECONFIGURATION", XPRS_PRECONFIGURATION, 1}, + {"FEASIBILITYJUMP", XPRS_FEASIBILITYJUMP, 1}, }; for (const auto& [paramString, control, paramValue] : params) { UNITTEST_INIT_MIP(); @@ -985,6 +995,19 @@ ENDATA } } + TEST(XpressInterface, setInt64Control) { + std::vector> params = { + {"EXTRAELEMS", XPRS_EXTRAELEMS, 1}, + {"EXTRASETELEMS", XPRS_EXTRASETELEMS, 1}, + }; + for (const auto& [paramString, control, paramValue] : params) { + UNITTEST_INIT_MIP(); + std::string xpressParamString = paramString + " " + std::to_string(paramValue); + solver.SetSolverSpecificParametersAsString(xpressParamString); + EXPECT_EQ(paramValue, getter.getInteger64Control(control)); + } + } + TEST(XpressInterface, SolveMIP) { UNITTEST_INIT_MIP(); diff --git a/ortools/linear_solver/xpress_interface.cc b/ortools/linear_solver/xpress_interface.cc index 18eb6a69737..89499c2cff6 100644 --- a/ortools/linear_solver/xpress_interface.cc +++ b/ortools/linear_solver/xpress_interface.cc @@ -284,345 +284,348 @@ static int convertToXpressBasisStatus(MPSolver::BasisStatus mpsolver_basis_statu static std::map& getMapStringControls() { static std::map mapControls = { - {"MPSRHSNAME", XPRS_MPSRHSNAME}, - {"MPSOBJNAME", XPRS_MPSOBJNAME}, - {"MPSRANGENAME", XPRS_MPSRANGENAME}, - {"MPSBOUNDNAME", XPRS_MPSBOUNDNAME}, - {"OUTPUTMASK", XPRS_OUTPUTMASK}, - {"TUNERMETHODFILE", XPRS_TUNERMETHODFILE}, - {"TUNEROUTPUTPATH", XPRS_TUNEROUTPUTPATH}, - {"TUNERSESSIONNAME", XPRS_TUNERSESSIONNAME}, - {"COMPUTEEXECSERVICE", XPRS_COMPUTEEXECSERVICE}, + {"MPSRHSNAME", XPRS_MPSRHSNAME}, + {"MPSOBJNAME", XPRS_MPSOBJNAME}, + {"MPSRANGENAME", XPRS_MPSRANGENAME}, + {"MPSBOUNDNAME", XPRS_MPSBOUNDNAME}, + {"OUTPUTMASK", XPRS_OUTPUTMASK}, + {"TUNERMETHODFILE", XPRS_TUNERMETHODFILE}, + {"TUNEROUTPUTPATH", XPRS_TUNEROUTPUTPATH}, + {"TUNERSESSIONNAME", XPRS_TUNERSESSIONNAME}, + {"COMPUTEEXECSERVICE", XPRS_COMPUTEEXECSERVICE}, }; return mapControls; } static std::map& getMapDoubleControls() { - static std::map mapControls = { - {"MATRIXTOL", XPRS_MATRIXTOL}, - {"PIVOTTOL", XPRS_PIVOTTOL}, - {"FEASTOL", XPRS_FEASTOL}, - {"OUTPUTTOL", XPRS_OUTPUTTOL}, - {"SOSREFTOL", XPRS_SOSREFTOL}, - {"OPTIMALITYTOL", XPRS_OPTIMALITYTOL}, - {"ETATOL", XPRS_ETATOL}, - {"RELPIVOTTOL", XPRS_RELPIVOTTOL}, - {"MIPTOL", XPRS_MIPTOL}, - {"MIPTOLTARGET", XPRS_MIPTOLTARGET}, - {"BARPERTURB", XPRS_BARPERTURB}, - {"MIPADDCUTOFF", XPRS_MIPADDCUTOFF}, - {"MIPABSCUTOFF", XPRS_MIPABSCUTOFF}, - {"MIPRELCUTOFF", XPRS_MIPRELCUTOFF}, - {"PSEUDOCOST", XPRS_PSEUDOCOST}, - {"PENALTY", XPRS_PENALTY}, - {"BIGM", XPRS_BIGM}, - {"MIPABSSTOP", XPRS_MIPABSSTOP}, - {"MIPRELSTOP", XPRS_MIPRELSTOP}, - {"CROSSOVERACCURACYTOL", XPRS_CROSSOVERACCURACYTOL}, - {"PRIMALPERTURB", XPRS_PRIMALPERTURB}, - {"DUALPERTURB", XPRS_DUALPERTURB}, - {"BAROBJSCALE", XPRS_BAROBJSCALE}, - {"BARRHSSCALE", XPRS_BARRHSSCALE}, - {"CHOLESKYTOL", XPRS_CHOLESKYTOL}, - {"BARGAPSTOP", XPRS_BARGAPSTOP}, - {"BARDUALSTOP", XPRS_BARDUALSTOP}, - {"BARPRIMALSTOP", XPRS_BARPRIMALSTOP}, - {"BARSTEPSTOP", XPRS_BARSTEPSTOP}, - {"ELIMTOL", XPRS_ELIMTOL}, - {"PERTURB", XPRS_PERTURB}, - {"MARKOWITZTOL", XPRS_MARKOWITZTOL}, - {"MIPABSGAPNOTIFY", XPRS_MIPABSGAPNOTIFY}, - {"MIPRELGAPNOTIFY", XPRS_MIPRELGAPNOTIFY}, - {"BARLARGEBOUND", XPRS_BARLARGEBOUND}, - {"PPFACTOR", XPRS_PPFACTOR}, - {"REPAIRINDEFINITEQMAX", XPRS_REPAIRINDEFINITEQMAX}, - {"BARGAPTARGET", XPRS_BARGAPTARGET}, - {"BARSTARTWEIGHT", XPRS_BARSTARTWEIGHT}, - {"BARFREESCALE", XPRS_BARFREESCALE}, - {"SBEFFORT", XPRS_SBEFFORT}, - {"HEURDIVERANDOMIZE", XPRS_HEURDIVERANDOMIZE}, - {"HEURSEARCHEFFORT", XPRS_HEURSEARCHEFFORT}, - {"CUTFACTOR", XPRS_CUTFACTOR}, - {"EIGENVALUETOL", XPRS_EIGENVALUETOL}, - {"INDLINBIGM", XPRS_INDLINBIGM}, - {"TREEMEMORYSAVINGTARGET", XPRS_TREEMEMORYSAVINGTARGET}, - {"GLOBALFILEBIAS", XPRS_GLOBALFILEBIAS}, - {"INDPRELINBIGM", XPRS_INDPRELINBIGM}, - {"RELAXTREEMEMORYLIMIT", XPRS_RELAXTREEMEMORYLIMIT}, - {"MIPABSGAPNOTIFYOBJ", XPRS_MIPABSGAPNOTIFYOBJ}, - {"MIPABSGAPNOTIFYBOUND", XPRS_MIPABSGAPNOTIFYBOUND}, - {"PRESOLVEMAXGROW", XPRS_PRESOLVEMAXGROW}, - {"HEURSEARCHTARGETSIZE", XPRS_HEURSEARCHTARGETSIZE}, - {"CROSSOVERRELPIVOTTOL", XPRS_CROSSOVERRELPIVOTTOL}, - {"CROSSOVERRELPIVOTTOLSAFE", XPRS_CROSSOVERRELPIVOTTOLSAFE}, - {"DETLOGFREQ", XPRS_DETLOGFREQ}, - {"MAXIMPLIEDBOUND", XPRS_MAXIMPLIEDBOUND}, - {"FEASTOLTARGET", XPRS_FEASTOLTARGET}, - {"OPTIMALITYTOLTARGET", XPRS_OPTIMALITYTOLTARGET}, - {"PRECOMPONENTSEFFORT", XPRS_PRECOMPONENTSEFFORT}, - {"LPLOGDELAY", XPRS_LPLOGDELAY}, - {"HEURDIVEITERLIMIT", XPRS_HEURDIVEITERLIMIT}, - {"BARKERNEL", XPRS_BARKERNEL}, - {"FEASTOLPERTURB", XPRS_FEASTOLPERTURB}, - {"CROSSOVERFEASWEIGHT", XPRS_CROSSOVERFEASWEIGHT}, - {"LUPIVOTTOL", XPRS_LUPIVOTTOL}, - {"MIPRESTARTGAPTHRESHOLD", XPRS_MIPRESTARTGAPTHRESHOLD}, - {"NODEPROBINGEFFORT", XPRS_NODEPROBINGEFFORT}, - {"INPUTTOL", XPRS_INPUTTOL}, - {"MIPRESTARTFACTOR", XPRS_MIPRESTARTFACTOR}, - {"BAROBJPERTURB", XPRS_BAROBJPERTURB}, + static std::map mapControls = { + {"MAXCUTTIME", XPRS_MAXCUTTIME}, + {"MAXSTALLTIME", XPRS_MAXSTALLTIME}, + {"TUNERMAXTIME", XPRS_TUNERMAXTIME}, + {"MATRIXTOL", XPRS_MATRIXTOL}, + {"PIVOTTOL", XPRS_PIVOTTOL}, + {"FEASTOL", XPRS_FEASTOL}, + {"OUTPUTTOL", XPRS_OUTPUTTOL}, + {"SOSREFTOL", XPRS_SOSREFTOL}, + {"OPTIMALITYTOL", XPRS_OPTIMALITYTOL}, + {"ETATOL", XPRS_ETATOL}, + {"RELPIVOTTOL", XPRS_RELPIVOTTOL}, + {"MIPTOL", XPRS_MIPTOL}, + {"MIPTOLTARGET", XPRS_MIPTOLTARGET}, + {"BARPERTURB", XPRS_BARPERTURB}, + {"MIPADDCUTOFF", XPRS_MIPADDCUTOFF}, + {"MIPABSCUTOFF", XPRS_MIPABSCUTOFF}, + {"MIPRELCUTOFF", XPRS_MIPRELCUTOFF}, + {"PSEUDOCOST", XPRS_PSEUDOCOST}, + {"PENALTY", XPRS_PENALTY}, + {"BIGM", XPRS_BIGM}, + {"MIPABSSTOP", XPRS_MIPABSSTOP}, + {"MIPRELSTOP", XPRS_MIPRELSTOP}, + {"CROSSOVERACCURACYTOL", XPRS_CROSSOVERACCURACYTOL}, + {"PRIMALPERTURB", XPRS_PRIMALPERTURB}, + {"DUALPERTURB", XPRS_DUALPERTURB}, + {"BAROBJSCALE", XPRS_BAROBJSCALE}, + {"BARRHSSCALE", XPRS_BARRHSSCALE}, + {"CHOLESKYTOL", XPRS_CHOLESKYTOL}, + {"BARGAPSTOP", XPRS_BARGAPSTOP}, + {"BARDUALSTOP", XPRS_BARDUALSTOP}, + {"BARPRIMALSTOP", XPRS_BARPRIMALSTOP}, + {"BARSTEPSTOP", XPRS_BARSTEPSTOP}, + {"ELIMTOL", XPRS_ELIMTOL}, + {"MARKOWITZTOL", XPRS_MARKOWITZTOL}, + {"MIPABSGAPNOTIFY", XPRS_MIPABSGAPNOTIFY}, + {"MIPRELGAPNOTIFY", XPRS_MIPRELGAPNOTIFY}, + {"BARLARGEBOUND", XPRS_BARLARGEBOUND}, + {"PPFACTOR", XPRS_PPFACTOR}, + {"REPAIRINDEFINITEQMAX", XPRS_REPAIRINDEFINITEQMAX}, + {"BARGAPTARGET", XPRS_BARGAPTARGET}, + {"DUMMYCONTROL", XPRS_DUMMYCONTROL}, + {"BARSTARTWEIGHT", XPRS_BARSTARTWEIGHT}, + {"BARFREESCALE", XPRS_BARFREESCALE}, + {"SBEFFORT", XPRS_SBEFFORT}, + {"HEURDIVERANDOMIZE", XPRS_HEURDIVERANDOMIZE}, + {"HEURSEARCHEFFORT", XPRS_HEURSEARCHEFFORT}, + {"CUTFACTOR", XPRS_CUTFACTOR}, + {"EIGENVALUETOL", XPRS_EIGENVALUETOL}, + {"INDLINBIGM", XPRS_INDLINBIGM}, + {"TREEMEMORYSAVINGTARGET", XPRS_TREEMEMORYSAVINGTARGET}, + {"INDPRELINBIGM", XPRS_INDPRELINBIGM}, + {"RELAXTREEMEMORYLIMIT", XPRS_RELAXTREEMEMORYLIMIT}, + {"MIPABSGAPNOTIFYOBJ", XPRS_MIPABSGAPNOTIFYOBJ}, + {"MIPABSGAPNOTIFYBOUND", XPRS_MIPABSGAPNOTIFYBOUND}, + {"PRESOLVEMAXGROW", XPRS_PRESOLVEMAXGROW}, + {"HEURSEARCHTARGETSIZE", XPRS_HEURSEARCHTARGETSIZE}, + {"CROSSOVERRELPIVOTTOL", XPRS_CROSSOVERRELPIVOTTOL}, + {"CROSSOVERRELPIVOTTOLSAFE", XPRS_CROSSOVERRELPIVOTTOLSAFE}, + {"DETLOGFREQ", XPRS_DETLOGFREQ}, + {"MAXIMPLIEDBOUND", XPRS_MAXIMPLIEDBOUND}, + {"FEASTOLTARGET", XPRS_FEASTOLTARGET}, + {"OPTIMALITYTOLTARGET", XPRS_OPTIMALITYTOLTARGET}, + {"PRECOMPONENTSEFFORT", XPRS_PRECOMPONENTSEFFORT}, + {"LPLOGDELAY", XPRS_LPLOGDELAY}, + {"HEURDIVEITERLIMIT", XPRS_HEURDIVEITERLIMIT}, + {"BARKERNEL", XPRS_BARKERNEL}, + {"FEASTOLPERTURB", XPRS_FEASTOLPERTURB}, + {"CROSSOVERFEASWEIGHT", XPRS_CROSSOVERFEASWEIGHT}, + {"LUPIVOTTOL", XPRS_LUPIVOTTOL}, + {"MIPRESTARTGAPTHRESHOLD", XPRS_MIPRESTARTGAPTHRESHOLD}, + {"NODEPROBINGEFFORT", XPRS_NODEPROBINGEFFORT}, + {"INPUTTOL", XPRS_INPUTTOL}, + {"MIPRESTARTFACTOR", XPRS_MIPRESTARTFACTOR}, + {"BAROBJPERTURB", XPRS_BAROBJPERTURB}, + {"CPIALPHA", XPRS_CPIALPHA}, + {"GLOBALBOUNDINGBOX", XPRS_GLOBALBOUNDINGBOX}, + {"TIMELIMIT", XPRS_TIMELIMIT}, + {"SOLTIMELIMIT", XPRS_SOLTIMELIMIT}, + {"REPAIRINFEASTIMELIMIT", XPRS_REPAIRINFEASTIMELIMIT}, }; - return mapControls; + return mapControls; } static std::map& getMapIntControls() { - static std::map mapControls = { - {"EXTRAROWS", XPRS_EXTRAROWS}, - {"EXTRACOLS", XPRS_EXTRACOLS}, - {"LPITERLIMIT", XPRS_LPITERLIMIT}, - {"LPLOG", XPRS_LPLOG}, - {"SCALING", XPRS_SCALING}, - {"PRESOLVE", XPRS_PRESOLVE}, - {"CRASH", XPRS_CRASH}, - {"PRICINGALG", XPRS_PRICINGALG}, - {"INVERTFREQ", XPRS_INVERTFREQ}, - {"INVERTMIN", XPRS_INVERTMIN}, - {"MAXNODE", XPRS_MAXNODE}, - {"MAXTIME", XPRS_MAXTIME}, - {"MAXMIPSOL", XPRS_MAXMIPSOL}, - {"SIFTPASSES", XPRS_SIFTPASSES}, - {"DEFAULTALG", XPRS_DEFAULTALG}, - {"VARSELECTION", XPRS_VARSELECTION}, - {"NODESELECTION", XPRS_NODESELECTION}, - {"BACKTRACK", XPRS_BACKTRACK}, - {"MIPLOG", XPRS_MIPLOG}, - {"KEEPNROWS", XPRS_KEEPNROWS}, - {"MPSECHO", XPRS_MPSECHO}, - {"MAXPAGELINES", XPRS_MAXPAGELINES}, - {"OUTPUTLOG", XPRS_OUTPUTLOG}, - {"BARSOLUTION", XPRS_BARSOLUTION}, - {"CACHESIZE", XPRS_CACHESIZE}, - {"CROSSOVER", XPRS_CROSSOVER}, - {"BARITERLIMIT", XPRS_BARITERLIMIT}, - {"CHOLESKYALG", XPRS_CHOLESKYALG}, - {"BAROUTPUT", XPRS_BAROUTPUT}, - {"CSTYLE", XPRS_CSTYLE}, - {"EXTRAMIPENTS", XPRS_EXTRAMIPENTS}, - {"REFACTOR", XPRS_REFACTOR}, - {"BARTHREADS", XPRS_BARTHREADS}, - {"KEEPBASIS", XPRS_KEEPBASIS}, - {"CROSSOVEROPS", XPRS_CROSSOVEROPS}, - {"VERSION", XPRS_VERSION}, - {"CROSSOVERTHREADS", XPRS_CROSSOVERTHREADS}, - {"BIGMMETHOD", XPRS_BIGMMETHOD}, - {"MPSNAMELENGTH", XPRS_MPSNAMELENGTH}, - {"ELIMFILLIN", XPRS_ELIMFILLIN}, - {"PRESOLVEOPS", XPRS_PRESOLVEOPS}, - {"MIPPRESOLVE", XPRS_MIPPRESOLVE}, - {"MIPTHREADS", XPRS_MIPTHREADS}, - {"BARORDER", XPRS_BARORDER}, - {"BREADTHFIRST", XPRS_BREADTHFIRST}, - {"AUTOPERTURB", XPRS_AUTOPERTURB}, - {"DENSECOLLIMIT", XPRS_DENSECOLLIMIT}, - {"CALLBACKFROMMASTERTHREAD", XPRS_CALLBACKFROMMASTERTHREAD}, - {"MAXMCOEFFBUFFERELEMS", XPRS_MAXMCOEFFBUFFERELEMS}, - {"REFINEOPS", XPRS_REFINEOPS}, - {"LPREFINEITERLIMIT", XPRS_LPREFINEITERLIMIT}, - {"MIPREFINEITERLIMIT", XPRS_MIPREFINEITERLIMIT}, - {"DUALIZEOPS", XPRS_DUALIZEOPS}, - {"CROSSOVERITERLIMIT", XPRS_CROSSOVERITERLIMIT}, - {"PREBASISRED", XPRS_PREBASISRED}, - {"PRESORT", XPRS_PRESORT}, - {"PREPERMUTE", XPRS_PREPERMUTE}, - {"PREPERMUTESEED", XPRS_PREPERMUTESEED}, - {"MAXMEMORYSOFT", XPRS_MAXMEMORYSOFT}, - {"CUTFREQ", XPRS_CUTFREQ}, - {"SYMSELECT", XPRS_SYMSELECT}, - {"SYMMETRY", XPRS_SYMMETRY}, - {"MAXMEMORYHARD", XPRS_MAXMEMORYHARD}, - {"LPTHREADS", XPRS_LPTHREADS}, - {"MIQCPALG", XPRS_MIQCPALG}, - {"QCCUTS", XPRS_QCCUTS}, - {"QCROOTALG", XPRS_QCROOTALG}, - {"PRECONVERTSEPARABLE", XPRS_PRECONVERTSEPARABLE}, - {"ALGAFTERNETWORK", XPRS_ALGAFTERNETWORK}, - {"TRACE", XPRS_TRACE}, - {"MAXIIS", XPRS_MAXIIS}, - {"CPUTIME", XPRS_CPUTIME}, - {"COVERCUTS", XPRS_COVERCUTS}, - {"GOMCUTS", XPRS_GOMCUTS}, - {"LPFOLDING", XPRS_LPFOLDING}, - {"MPSFORMAT", XPRS_MPSFORMAT}, - {"CUTSTRATEGY", XPRS_CUTSTRATEGY}, - {"CUTDEPTH", XPRS_CUTDEPTH}, - {"TREECOVERCUTS", XPRS_TREECOVERCUTS}, - {"TREEGOMCUTS", XPRS_TREEGOMCUTS}, - {"CUTSELECT", XPRS_CUTSELECT}, - {"TREECUTSELECT", XPRS_TREECUTSELECT}, - {"DUALIZE", XPRS_DUALIZE}, - {"DUALGRADIENT", XPRS_DUALGRADIENT}, - {"SBITERLIMIT", XPRS_SBITERLIMIT}, - {"SBBEST", XPRS_SBBEST}, - {"MAXCUTTIME", XPRS_MAXCUTTIME}, - {"ACTIVESET", XPRS_ACTIVESET}, - {"BARINDEFLIMIT", XPRS_BARINDEFLIMIT}, - {"HEURSTRATEGY", XPRS_HEURSTRATEGY}, - {"HEURFREQ", XPRS_HEURFREQ}, - {"HEURDEPTH", XPRS_HEURDEPTH}, - {"HEURMAXSOL", XPRS_HEURMAXSOL}, - {"HEURNODES", XPRS_HEURNODES}, - {"LNPBEST", XPRS_LNPBEST}, - {"LNPITERLIMIT", XPRS_LNPITERLIMIT}, - {"BRANCHCHOICE", XPRS_BRANCHCHOICE}, - {"BARREGULARIZE", XPRS_BARREGULARIZE}, - {"SBSELECT", XPRS_SBSELECT}, - {"LOCALCHOICE", XPRS_LOCALCHOICE}, - {"LOCALBACKTRACK", XPRS_LOCALBACKTRACK}, - {"DUALSTRATEGY", XPRS_DUALSTRATEGY}, - {"L1CACHE", XPRS_L1CACHE}, - {"HEURDIVESTRATEGY", XPRS_HEURDIVESTRATEGY}, - {"HEURSELECT", XPRS_HEURSELECT}, - {"BARSTART", XPRS_BARSTART}, - {"PRESOLVEPASSES", XPRS_PRESOLVEPASSES}, - {"BARNUMSTABILITY", XPRS_BARNUMSTABILITY}, - {"BARORDERTHREADS", XPRS_BARORDERTHREADS}, - {"EXTRASETS", XPRS_EXTRASETS}, - {"FEASIBILITYPUMP", XPRS_FEASIBILITYPUMP}, - {"PRECOEFELIM", XPRS_PRECOEFELIM}, - {"PREDOMCOL", XPRS_PREDOMCOL}, - {"HEURSEARCHFREQ", XPRS_HEURSEARCHFREQ}, - {"HEURDIVESPEEDUP", XPRS_HEURDIVESPEEDUP}, - {"SBESTIMATE", XPRS_SBESTIMATE}, - {"BARCORES", XPRS_BARCORES}, - {"MAXCHECKSONMAXTIME", XPRS_MAXCHECKSONMAXTIME}, - {"MAXCHECKSONMAXCUTTIME", XPRS_MAXCHECKSONMAXCUTTIME}, - {"HISTORYCOSTS", XPRS_HISTORYCOSTS}, - {"ALGAFTERCROSSOVER", XPRS_ALGAFTERCROSSOVER}, - {"LINELENGTH", XPRS_LINELENGTH}, - {"MUTEXCALLBACKS", XPRS_MUTEXCALLBACKS}, - {"BARCRASH", XPRS_BARCRASH}, - {"HEURDIVESOFTROUNDING", XPRS_HEURDIVESOFTROUNDING}, - {"HEURSEARCHROOTSELECT", XPRS_HEURSEARCHROOTSELECT}, - {"HEURSEARCHTREESELECT", XPRS_HEURSEARCHTREESELECT}, - {"MPS18COMPATIBLE", XPRS_MPS18COMPATIBLE}, - {"ROOTPRESOLVE", XPRS_ROOTPRESOLVE}, - {"CROSSOVERDRP", XPRS_CROSSOVERDRP}, - {"FORCEOUTPUT", XPRS_FORCEOUTPUT}, - {"DETERMINISTIC", XPRS_DETERMINISTIC}, - {"PREPROBING", XPRS_PREPROBING}, - {"EXTRAQCELEMENTS", XPRS_EXTRAQCELEMENTS}, - {"EXTRAQCROWS", XPRS_EXTRAQCROWS}, - {"TREEMEMORYLIMIT", XPRS_TREEMEMORYLIMIT}, - {"TREECOMPRESSION", XPRS_TREECOMPRESSION}, - {"TREEDIAGNOSTICS", XPRS_TREEDIAGNOSTICS}, - {"MAXGLOBALFILESIZE", XPRS_MAXGLOBALFILESIZE}, - {"PRECLIQUESTRATEGY", XPRS_PRECLIQUESTRATEGY}, - {"REPAIRINFEASMAXTIME", XPRS_REPAIRINFEASMAXTIME}, - {"IFCHECKCONVEXITY", XPRS_IFCHECKCONVEXITY}, - {"PRIMALUNSHIFT", XPRS_PRIMALUNSHIFT}, - {"REPAIRINDEFINITEQ", XPRS_REPAIRINDEFINITEQ}, - {"MIPRAMPUP", XPRS_MIPRAMPUP}, - {"MAXLOCALBACKTRACK", XPRS_MAXLOCALBACKTRACK}, - {"USERSOLHEURISTIC", XPRS_USERSOLHEURISTIC}, - {"FORCEPARALLELDUAL", XPRS_FORCEPARALLELDUAL}, - {"BACKTRACKTIE", XPRS_BACKTRACKTIE}, - {"BRANCHDISJ", XPRS_BRANCHDISJ}, - {"MIPFRACREDUCE", XPRS_MIPFRACREDUCE}, - {"CONCURRENTTHREADS", XPRS_CONCURRENTTHREADS}, - {"MAXSCALEFACTOR", XPRS_MAXSCALEFACTOR}, - {"HEURTHREADS", XPRS_HEURTHREADS}, - {"THREADS", XPRS_THREADS}, - {"HEURBEFORELP", XPRS_HEURBEFORELP}, - {"PREDOMROW", XPRS_PREDOMROW}, - {"BRANCHSTRUCTURAL", XPRS_BRANCHSTRUCTURAL}, - {"QUADRATICUNSHIFT", XPRS_QUADRATICUNSHIFT}, - {"BARPRESOLVEOPS", XPRS_BARPRESOLVEOPS}, - {"QSIMPLEXOPS", XPRS_QSIMPLEXOPS}, - {"MIPRESTART", XPRS_MIPRESTART}, - {"CONFLICTCUTS", XPRS_CONFLICTCUTS}, - {"PREPROTECTDUAL", XPRS_PREPROTECTDUAL}, - {"CORESPERCPU", XPRS_CORESPERCPU}, - {"RESOURCESTRATEGY", XPRS_RESOURCESTRATEGY}, - {"CLAMPING", XPRS_CLAMPING}, - {"SLEEPONTHREADWAIT", XPRS_SLEEPONTHREADWAIT}, - {"PREDUPROW", XPRS_PREDUPROW}, - {"CPUPLATFORM", XPRS_CPUPLATFORM}, - {"BARALG", XPRS_BARALG}, - {"SIFTING", XPRS_SIFTING}, - {"LPLOGSTYLE", XPRS_LPLOGSTYLE}, - {"RANDOMSEED", XPRS_RANDOMSEED}, - {"TREEQCCUTS", XPRS_TREEQCCUTS}, - {"PRELINDEP", XPRS_PRELINDEP}, - {"DUALTHREADS", XPRS_DUALTHREADS}, - {"PREOBJCUTDETECT", XPRS_PREOBJCUTDETECT}, - {"PREBNDREDQUAD", XPRS_PREBNDREDQUAD}, - {"PREBNDREDCONE", XPRS_PREBNDREDCONE}, - {"PRECOMPONENTS", XPRS_PRECOMPONENTS}, - {"MAXMIPTASKS", XPRS_MAXMIPTASKS}, - {"MIPTERMINATIONMETHOD", XPRS_MIPTERMINATIONMETHOD}, - {"PRECONEDECOMP", XPRS_PRECONEDECOMP}, - {"HEURFORCESPECIALOBJ", XPRS_HEURFORCESPECIALOBJ}, - {"HEURSEARCHROOTCUTFREQ", XPRS_HEURSEARCHROOTCUTFREQ}, - {"PREELIMQUAD", XPRS_PREELIMQUAD}, - {"PREIMPLICATIONS", XPRS_PREIMPLICATIONS}, - {"TUNERMODE", XPRS_TUNERMODE}, - {"TUNERMETHOD", XPRS_TUNERMETHOD}, - {"TUNERTARGET", XPRS_TUNERTARGET}, - {"TUNERTHREADS", XPRS_TUNERTHREADS}, - {"TUNERMAXTIME", XPRS_TUNERMAXTIME}, - {"TUNERHISTORY", XPRS_TUNERHISTORY}, - {"TUNERPERMUTE", XPRS_TUNERPERMUTE}, - {"TUNERROOTALG", XPRS_TUNERROOTALG}, - {"TUNERVERBOSE", XPRS_TUNERVERBOSE}, - {"TUNEROUTPUT", XPRS_TUNEROUTPUT}, - {"PREANALYTICCENTER", XPRS_PREANALYTICCENTER}, - {"NETCUTS", XPRS_NETCUTS}, - {"LPFLAGS", XPRS_LPFLAGS}, - {"MIPKAPPAFREQ", XPRS_MIPKAPPAFREQ}, - {"OBJSCALEFACTOR", XPRS_OBJSCALEFACTOR}, - {"GLOBALFILELOGINTERVAL", XPRS_GLOBALFILELOGINTERVAL}, - {"IGNORECONTAINERCPULIMIT", XPRS_IGNORECONTAINERCPULIMIT}, - {"IGNORECONTAINERMEMORYLIMIT", XPRS_IGNORECONTAINERMEMORYLIMIT}, - {"MIPDUALREDUCTIONS", XPRS_MIPDUALREDUCTIONS}, - {"GENCONSDUALREDUCTIONS", XPRS_GENCONSDUALREDUCTIONS}, - {"PWLDUALREDUCTIONS", XPRS_PWLDUALREDUCTIONS}, - {"BARFAILITERLIMIT", XPRS_BARFAILITERLIMIT}, - {"AUTOSCALING", XPRS_AUTOSCALING}, - {"GENCONSABSTRANSFORMATION", XPRS_GENCONSABSTRANSFORMATION}, - {"COMPUTEJOBPRIORITY", XPRS_COMPUTEJOBPRIORITY}, - {"PREFOLDING", XPRS_PREFOLDING}, - {"COMPUTE", XPRS_COMPUTE}, - {"NETSTALLLIMIT", XPRS_NETSTALLLIMIT}, - {"SERIALIZEPREINTSOL", XPRS_SERIALIZEPREINTSOL}, - {"PWLNONCONVEXTRANSFORMATION", XPRS_PWLNONCONVEXTRANSFORMATION}, - {"MIPCOMPONENTS", XPRS_MIPCOMPONENTS}, - {"MIPCONCURRENTNODES", XPRS_MIPCONCURRENTNODES}, - {"MIPCONCURRENTSOLVES", XPRS_MIPCONCURRENTSOLVES}, - {"OUTPUTCONTROLS", XPRS_OUTPUTCONTROLS}, - {"SIFTSWITCH", XPRS_SIFTSWITCH}, - {"HEUREMPHASIS", XPRS_HEUREMPHASIS}, - {"COMPUTEMATX", XPRS_COMPUTEMATX}, - {"COMPUTEMATX_IIS", XPRS_COMPUTEMATX_IIS}, - {"COMPUTEMATX_IISMAXTIME", XPRS_COMPUTEMATX_IISMAXTIME}, - {"BARREFITER", XPRS_BARREFITER}, - {"COMPUTELOG", XPRS_COMPUTELOG}, - {"SIFTPRESOLVEOPS", XPRS_SIFTPRESOLVEOPS}, - {"ESCAPENAMES", XPRS_ESCAPENAMES}, - {"IOTIMEOUT", XPRS_IOTIMEOUT}, - {"MAXSTALLTIME", XPRS_MAXSTALLTIME}, - {"AUTOCUTTING", XPRS_AUTOCUTTING}, + static std::map mapControls = { + {"EXTRAROWS", XPRS_EXTRAROWS}, + {"EXTRACOLS", XPRS_EXTRACOLS}, + {"LPITERLIMIT", XPRS_LPITERLIMIT}, + {"LPLOG", XPRS_LPLOG}, + {"SCALING", XPRS_SCALING}, + {"PRESOLVE", XPRS_PRESOLVE}, + {"CRASH", XPRS_CRASH}, + {"PRICINGALG", XPRS_PRICINGALG}, + {"INVERTFREQ", XPRS_INVERTFREQ}, + {"INVERTMIN", XPRS_INVERTMIN}, + {"MAXNODE", XPRS_MAXNODE}, + {"MAXTIME", XPRS_MAXTIME}, + {"MAXMIPSOL", XPRS_MAXMIPSOL}, + {"SIFTPASSES", XPRS_SIFTPASSES}, + {"DEFAULTALG", XPRS_DEFAULTALG}, + {"VARSELECTION", XPRS_VARSELECTION}, + {"NODESELECTION", XPRS_NODESELECTION}, + {"BACKTRACK", XPRS_BACKTRACK}, + {"MIPLOG", XPRS_MIPLOG}, + {"KEEPNROWS", XPRS_KEEPNROWS}, + {"MPSECHO", XPRS_MPSECHO}, + {"MAXPAGELINES", XPRS_MAXPAGELINES}, + {"OUTPUTLOG", XPRS_OUTPUTLOG}, + {"BARSOLUTION", XPRS_BARSOLUTION}, + {"CACHESIZE", XPRS_CACHESIZE}, + {"CROSSOVER", XPRS_CROSSOVER}, + {"BARITERLIMIT", XPRS_BARITERLIMIT}, + {"CHOLESKYALG", XPRS_CHOLESKYALG}, + {"BAROUTPUT", XPRS_BAROUTPUT}, + {"EXTRAMIPENTS", XPRS_EXTRAMIPENTS}, + {"REFACTOR", XPRS_REFACTOR}, + {"BARTHREADS", XPRS_BARTHREADS}, + {"KEEPBASIS", XPRS_KEEPBASIS}, + {"CROSSOVEROPS", XPRS_CROSSOVEROPS}, + {"VERSION", XPRS_VERSION}, + {"CROSSOVERTHREADS", XPRS_CROSSOVERTHREADS}, + {"BIGMMETHOD", XPRS_BIGMMETHOD}, + {"MPSNAMELENGTH", XPRS_MPSNAMELENGTH}, + {"ELIMFILLIN", XPRS_ELIMFILLIN}, + {"PRESOLVEOPS", XPRS_PRESOLVEOPS}, + {"MIPPRESOLVE", XPRS_MIPPRESOLVE}, + {"MIPTHREADS", XPRS_MIPTHREADS}, + {"BARORDER", XPRS_BARORDER}, + {"BREADTHFIRST", XPRS_BREADTHFIRST}, + {"AUTOPERTURB", XPRS_AUTOPERTURB}, + {"DENSECOLLIMIT", XPRS_DENSECOLLIMIT}, + {"CALLBACKFROMMASTERTHREAD", XPRS_CALLBACKFROMMASTERTHREAD}, + {"MAXMCOEFFBUFFERELEMS", XPRS_MAXMCOEFFBUFFERELEMS}, + {"REFINEOPS", XPRS_REFINEOPS}, + {"LPREFINEITERLIMIT", XPRS_LPREFINEITERLIMIT}, + {"MIPREFINEITERLIMIT", XPRS_MIPREFINEITERLIMIT}, + {"DUALIZEOPS", XPRS_DUALIZEOPS}, + {"CROSSOVERITERLIMIT", XPRS_CROSSOVERITERLIMIT}, + {"PREBASISRED", XPRS_PREBASISRED}, + {"PRESORT", XPRS_PRESORT}, + {"PREPERMUTE", XPRS_PREPERMUTE}, + {"PREPERMUTESEED", XPRS_PREPERMUTESEED}, + {"MAXMEMORYSOFT", XPRS_MAXMEMORYSOFT}, + {"CUTFREQ", XPRS_CUTFREQ}, + {"SYMSELECT", XPRS_SYMSELECT}, + {"SYMMETRY", XPRS_SYMMETRY}, + {"MAXMEMORYHARD", XPRS_MAXMEMORYHARD}, + {"MIQCPALG", XPRS_MIQCPALG}, + {"QCCUTS", XPRS_QCCUTS}, + {"QCROOTALG", XPRS_QCROOTALG}, + {"PRECONVERTSEPARABLE", XPRS_PRECONVERTSEPARABLE}, + {"ALGAFTERNETWORK", XPRS_ALGAFTERNETWORK}, + {"TRACE", XPRS_TRACE}, + {"MAXIIS", XPRS_MAXIIS}, + {"CPUTIME", XPRS_CPUTIME}, + {"COVERCUTS", XPRS_COVERCUTS}, + {"GOMCUTS", XPRS_GOMCUTS}, + {"LPFOLDING", XPRS_LPFOLDING}, + {"MPSFORMAT", XPRS_MPSFORMAT}, + {"CUTSTRATEGY", XPRS_CUTSTRATEGY}, + {"CUTDEPTH", XPRS_CUTDEPTH}, + {"TREECOVERCUTS", XPRS_TREECOVERCUTS}, + {"TREEGOMCUTS", XPRS_TREEGOMCUTS}, + {"CUTSELECT", XPRS_CUTSELECT}, + {"TREECUTSELECT", XPRS_TREECUTSELECT}, + {"DUALIZE", XPRS_DUALIZE}, + {"DUALGRADIENT", XPRS_DUALGRADIENT}, + {"SBITERLIMIT", XPRS_SBITERLIMIT}, + {"SBBEST", XPRS_SBBEST}, + {"BARINDEFLIMIT", XPRS_BARINDEFLIMIT}, + {"HEURFREQ", XPRS_HEURFREQ}, + {"HEURDEPTH", XPRS_HEURDEPTH}, + {"HEURMAXSOL", XPRS_HEURMAXSOL}, + {"HEURNODES", XPRS_HEURNODES}, + {"LNPBEST", XPRS_LNPBEST}, + {"LNPITERLIMIT", XPRS_LNPITERLIMIT}, + {"BRANCHCHOICE", XPRS_BRANCHCHOICE}, + {"BARREGULARIZE", XPRS_BARREGULARIZE}, + {"SBSELECT", XPRS_SBSELECT}, + {"LOCALCHOICE", XPRS_LOCALCHOICE}, + {"LOCALBACKTRACK", XPRS_LOCALBACKTRACK}, + {"DUALSTRATEGY", XPRS_DUALSTRATEGY}, + {"L1CACHE", XPRS_L1CACHE}, + {"HEURDIVESTRATEGY", XPRS_HEURDIVESTRATEGY}, + {"HEURSELECT", XPRS_HEURSELECT}, + {"BARSTART", XPRS_BARSTART}, + {"PRESOLVEPASSES", XPRS_PRESOLVEPASSES}, + {"BARNUMSTABILITY", XPRS_BARNUMSTABILITY}, + {"BARORDERTHREADS", XPRS_BARORDERTHREADS}, + {"EXTRASETS", XPRS_EXTRASETS}, + {"FEASIBILITYPUMP", XPRS_FEASIBILITYPUMP}, + {"PRECOEFELIM", XPRS_PRECOEFELIM}, + {"PREDOMCOL", XPRS_PREDOMCOL}, + {"HEURSEARCHFREQ", XPRS_HEURSEARCHFREQ}, + {"HEURDIVESPEEDUP", XPRS_HEURDIVESPEEDUP}, + {"SBESTIMATE", XPRS_SBESTIMATE}, + {"BARCORES", XPRS_BARCORES}, + {"MAXCHECKSONMAXTIME", XPRS_MAXCHECKSONMAXTIME}, + {"MAXCHECKSONMAXCUTTIME", XPRS_MAXCHECKSONMAXCUTTIME}, + {"HISTORYCOSTS", XPRS_HISTORYCOSTS}, + {"ALGAFTERCROSSOVER", XPRS_ALGAFTERCROSSOVER}, + {"MUTEXCALLBACKS", XPRS_MUTEXCALLBACKS}, + {"BARCRASH", XPRS_BARCRASH}, + {"HEURDIVESOFTROUNDING", XPRS_HEURDIVESOFTROUNDING}, + {"HEURSEARCHROOTSELECT", XPRS_HEURSEARCHROOTSELECT}, + {"HEURSEARCHTREESELECT", XPRS_HEURSEARCHTREESELECT}, + {"MPS18COMPATIBLE", XPRS_MPS18COMPATIBLE}, + {"ROOTPRESOLVE", XPRS_ROOTPRESOLVE}, + {"CROSSOVERDRP", XPRS_CROSSOVERDRP}, + {"FORCEOUTPUT", XPRS_FORCEOUTPUT}, + {"PRIMALOPS", XPRS_PRIMALOPS}, + {"DETERMINISTIC", XPRS_DETERMINISTIC}, + {"PREPROBING", XPRS_PREPROBING}, + {"TREEMEMORYLIMIT", XPRS_TREEMEMORYLIMIT}, + {"TREECOMPRESSION", XPRS_TREECOMPRESSION}, + {"TREEDIAGNOSTICS", XPRS_TREEDIAGNOSTICS}, + {"MAXTREEFILESIZE", XPRS_MAXTREEFILESIZE}, + {"PRECLIQUESTRATEGY", XPRS_PRECLIQUESTRATEGY}, + {"REPAIRINFEASMAXTIME", XPRS_REPAIRINFEASMAXTIME}, + {"IFCHECKCONVEXITY", XPRS_IFCHECKCONVEXITY}, + {"PRIMALUNSHIFT", XPRS_PRIMALUNSHIFT}, + {"REPAIRINDEFINITEQ", XPRS_REPAIRINDEFINITEQ}, + {"MIPRAMPUP", XPRS_MIPRAMPUP}, + {"MAXLOCALBACKTRACK", XPRS_MAXLOCALBACKTRACK}, + {"USERSOLHEURISTIC", XPRS_USERSOLHEURISTIC}, + {"FORCEPARALLELDUAL", XPRS_FORCEPARALLELDUAL}, + {"BACKTRACKTIE", XPRS_BACKTRACKTIE}, + {"BRANCHDISJ", XPRS_BRANCHDISJ}, + {"MIPFRACREDUCE", XPRS_MIPFRACREDUCE}, + {"CONCURRENTTHREADS", XPRS_CONCURRENTTHREADS}, + {"MAXSCALEFACTOR", XPRS_MAXSCALEFACTOR}, + {"HEURTHREADS", XPRS_HEURTHREADS}, + {"THREADS", XPRS_THREADS}, + {"HEURBEFORELP", XPRS_HEURBEFORELP}, + {"PREDOMROW", XPRS_PREDOMROW}, + {"BRANCHSTRUCTURAL", XPRS_BRANCHSTRUCTURAL}, + {"QUADRATICUNSHIFT", XPRS_QUADRATICUNSHIFT}, + {"BARPRESOLVEOPS", XPRS_BARPRESOLVEOPS}, + {"QSIMPLEXOPS", XPRS_QSIMPLEXOPS}, + {"MIPRESTART", XPRS_MIPRESTART}, + {"CONFLICTCUTS", XPRS_CONFLICTCUTS}, + {"PREPROTECTDUAL", XPRS_PREPROTECTDUAL}, + {"CORESPERCPU", XPRS_CORESPERCPU}, + {"RESOURCESTRATEGY", XPRS_RESOURCESTRATEGY}, + {"CLAMPING", XPRS_CLAMPING}, + {"SLEEPONTHREADWAIT", XPRS_SLEEPONTHREADWAIT}, + {"PREDUPROW", XPRS_PREDUPROW}, + {"CPUPLATFORM", XPRS_CPUPLATFORM}, + {"BARALG", XPRS_BARALG}, + {"SIFTING", XPRS_SIFTING}, + {"LPLOGSTYLE", XPRS_LPLOGSTYLE}, + {"RANDOMSEED", XPRS_RANDOMSEED}, + {"TREEQCCUTS", XPRS_TREEQCCUTS}, + {"PRELINDEP", XPRS_PRELINDEP}, + {"DUALTHREADS", XPRS_DUALTHREADS}, + {"PREOBJCUTDETECT", XPRS_PREOBJCUTDETECT}, + {"PREBNDREDQUAD", XPRS_PREBNDREDQUAD}, + {"PREBNDREDCONE", XPRS_PREBNDREDCONE}, + {"PRECOMPONENTS", XPRS_PRECOMPONENTS}, + {"MAXMIPTASKS", XPRS_MAXMIPTASKS}, + {"MIPTERMINATIONMETHOD", XPRS_MIPTERMINATIONMETHOD}, + {"PRECONEDECOMP", XPRS_PRECONEDECOMP}, + {"HEURFORCESPECIALOBJ", XPRS_HEURFORCESPECIALOBJ}, + {"HEURSEARCHROOTCUTFREQ", XPRS_HEURSEARCHROOTCUTFREQ}, + {"PREELIMQUAD", XPRS_PREELIMQUAD}, + {"PREIMPLICATIONS", XPRS_PREIMPLICATIONS}, + {"TUNERMODE", XPRS_TUNERMODE}, + {"TUNERMETHOD", XPRS_TUNERMETHOD}, + {"TUNERTARGET", XPRS_TUNERTARGET}, + {"TUNERTHREADS", XPRS_TUNERTHREADS}, + {"TUNERHISTORY", XPRS_TUNERHISTORY}, + {"TUNERPERMUTE", XPRS_TUNERPERMUTE}, + {"TUNERVERBOSE", XPRS_TUNERVERBOSE}, + {"TUNEROUTPUT", XPRS_TUNEROUTPUT}, + {"PREANALYTICCENTER", XPRS_PREANALYTICCENTER}, + {"NETCUTS", XPRS_NETCUTS}, + {"LPFLAGS", XPRS_LPFLAGS}, + {"MIPKAPPAFREQ", XPRS_MIPKAPPAFREQ}, + {"OBJSCALEFACTOR", XPRS_OBJSCALEFACTOR}, + {"TREEFILELOGINTERVAL", XPRS_TREEFILELOGINTERVAL}, + {"IGNORECONTAINERCPULIMIT", XPRS_IGNORECONTAINERCPULIMIT}, + {"IGNORECONTAINERMEMORYLIMIT", XPRS_IGNORECONTAINERMEMORYLIMIT}, + {"MIPDUALREDUCTIONS", XPRS_MIPDUALREDUCTIONS}, + {"GENCONSDUALREDUCTIONS", XPRS_GENCONSDUALREDUCTIONS}, + {"PWLDUALREDUCTIONS", XPRS_PWLDUALREDUCTIONS}, + {"BARFAILITERLIMIT", XPRS_BARFAILITERLIMIT}, + {"AUTOSCALING", XPRS_AUTOSCALING}, + {"GENCONSABSTRANSFORMATION", XPRS_GENCONSABSTRANSFORMATION}, + {"COMPUTEJOBPRIORITY", XPRS_COMPUTEJOBPRIORITY}, + {"PREFOLDING", XPRS_PREFOLDING}, + {"NETSTALLLIMIT", XPRS_NETSTALLLIMIT}, + {"SERIALIZEPREINTSOL", XPRS_SERIALIZEPREINTSOL}, + {"NUMERICALEMPHASIS", XPRS_NUMERICALEMPHASIS}, + {"PWLNONCONVEXTRANSFORMATION", XPRS_PWLNONCONVEXTRANSFORMATION}, + {"MIPCOMPONENTS", XPRS_MIPCOMPONENTS}, + {"MIPCONCURRENTNODES", XPRS_MIPCONCURRENTNODES}, + {"MIPCONCURRENTSOLVES", XPRS_MIPCONCURRENTSOLVES}, + {"OUTPUTCONTROLS", XPRS_OUTPUTCONTROLS}, + {"SIFTSWITCH", XPRS_SIFTSWITCH}, + {"HEUREMPHASIS", XPRS_HEUREMPHASIS}, + {"COMPUTEMATX", XPRS_COMPUTEMATX}, + {"COMPUTEMATX_IIS", XPRS_COMPUTEMATX_IIS}, + {"COMPUTEMATX_IISMAXTIME", XPRS_COMPUTEMATX_IISMAXTIME}, + {"BARREFITER", XPRS_BARREFITER}, + {"COMPUTELOG", XPRS_COMPUTELOG}, + {"SIFTPRESOLVEOPS", XPRS_SIFTPRESOLVEOPS}, + {"CHECKINPUTDATA", XPRS_CHECKINPUTDATA}, + {"ESCAPENAMES", XPRS_ESCAPENAMES}, + {"IOTIMEOUT", XPRS_IOTIMEOUT}, + {"AUTOCUTTING", XPRS_AUTOCUTTING}, + {"CALLBACKCHECKTIMEDELAY", XPRS_CALLBACKCHECKTIMEDELAY}, + {"MULTIOBJOPS", XPRS_MULTIOBJOPS}, + {"MULTIOBJLOG", XPRS_MULTIOBJLOG}, + {"GLOBALSPATIALBRANCHIFPREFERORIG", XPRS_GLOBALSPATIALBRANCHIFPREFERORIG}, + {"PRECONFIGURATION", XPRS_PRECONFIGURATION}, + {"FEASIBILITYJUMP", XPRS_FEASIBILITYJUMP}, }; - return mapControls; + return mapControls; } static std::map& getMapInt64Controls() { static std::map mapControls = { - {"EXTRAELEMS", XPRS_EXTRAELEMS}, - {"EXTRAPRESOLVE", XPRS_EXTRAPRESOLVE}, - {"EXTRASETELEMS", XPRS_EXTRASETELEMS} + {"EXTRAELEMS", XPRS_EXTRAELEMS}, + {"EXTRASETELEMS", XPRS_EXTRASETELEMS}, }; return mapControls; } diff --git a/ortools/xpress/environment.cc b/ortools/xpress/environment.cc index 0be81547e4e..64f3a0d4116 100644 --- a/ortools/xpress/environment.cc +++ b/ortools/xpress/environment.cc @@ -73,9 +73,9 @@ std::function XPRSgetbasis = n std::function XPRSwriteprob = nullptr; std::function XPRSgetrowtype = nullptr; std::function XPRSgetcoltype = nullptr; +std::function XPRSchgbounds = nullptr; std::function XPRSgetlpsol = nullptr; std::function XPRSgetmipsol = nullptr; -std::function XPRSchgbounds = nullptr; std::function XPRSchgobj = nullptr; std::function XPRSchgcoef = nullptr; std::function XPRSchgmcoef = nullptr; @@ -131,9 +131,9 @@ absl::Status LoadXpressFunctions(DynamicLibrary* xpress_dynamic_library) { xpress_dynamic_library->GetFunction(&XPRSwriteprob, "XPRSwriteprob"); xpress_dynamic_library->GetFunction(&XPRSgetrowtype, "XPRSgetrowtype"); xpress_dynamic_library->GetFunction(&XPRSgetcoltype, "XPRSgetcoltype"); + xpress_dynamic_library->GetFunction(&XPRSchgbounds, "XPRSchgbounds"); xpress_dynamic_library->GetFunction(&XPRSgetlpsol, "XPRSgetlpsol"); xpress_dynamic_library->GetFunction(&XPRSgetmipsol, "XPRSgetmipsol"); - xpress_dynamic_library->GetFunction(&XPRSchgbounds, "XPRSchgbounds"); xpress_dynamic_library->GetFunction(&XPRSchgobj, "XPRSchgobj"); xpress_dynamic_library->GetFunction(&XPRSchgcoef, "XPRSchgcoef"); xpress_dynamic_library->GetFunction(&XPRSchgmcoef, "XPRSchgmcoef"); diff --git a/ortools/xpress/environment.h b/ortools/xpress/environment.h index 5c2ec71b172..f58dbde9731 100644 --- a/ortools/xpress/environment.h +++ b/ortools/xpress/environment.h @@ -59,7 +59,7 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_PLUSINFINITY 1.0e+20 #define XPRS_MINUSINFINITY -1.0e+20 #define XPRS_MAXBANNERLENGTH 512 -#define XPVERSION 39 +#define XPVERSION 41 #define XPRS_MPSRHSNAME 6001 #define XPRS_MPSOBJNAME 6002 #define XPRS_MPSRANGENAME 6003 @@ -69,6 +69,9 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_TUNEROUTPUTPATH 6018 #define XPRS_TUNERSESSIONNAME 6019 #define XPRS_COMPUTEEXECSERVICE 6022 +#define XPRS_MAXCUTTIME 8149 +#define XPRS_MAXSTALLTIME 8443 +#define XPRS_TUNERMAXTIME 8364 #define XPRS_MATRIXTOL 7001 #define XPRS_PIVOTTOL 7002 #define XPRS_FEASTOL 7003 @@ -99,7 +102,6 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_BARPRIMALSTOP 7035 #define XPRS_BARSTEPSTOP 7036 #define XPRS_ELIMTOL 7042 -#define XPRS_PERTURB 7044 #define XPRS_MARKOWITZTOL 7047 #define XPRS_MIPABSGAPNOTIFY 7064 #define XPRS_MIPRELGAPNOTIFY 7065 @@ -107,6 +109,7 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_PPFACTOR 7069 #define XPRS_REPAIRINDEFINITEQMAX 7071 #define XPRS_BARGAPTARGET 7073 +#define XPRS_DUMMYCONTROL 7075 #define XPRS_BARSTARTWEIGHT 7076 #define XPRS_BARFREESCALE 7077 #define XPRS_SBEFFORT 7086 @@ -116,7 +119,6 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_EIGENVALUETOL 7097 #define XPRS_INDLINBIGM 7099 #define XPRS_TREEMEMORYSAVINGTARGET 7100 -#define XPRS_GLOBALFILEBIAS 7101 #define XPRS_INDPRELINBIGM 7102 #define XPRS_RELAXTREEMEMORYLIMIT 7105 #define XPRS_MIPABSGAPNOTIFYOBJ 7108 @@ -141,6 +143,11 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_INPUTTOL 7143 #define XPRS_MIPRESTARTFACTOR 7145 #define XPRS_BAROBJPERTURB 7146 +#define XPRS_CPIALPHA 7149 +#define XPRS_GLOBALBOUNDINGBOX 7154 +#define XPRS_TIMELIMIT 7158 +#define XPRS_SOLTIMELIMIT 7159 +#define XPRS_REPAIRINFEASTIMELIMIT 7160 #define XPRS_EXTRAROWS 8004 #define XPRS_EXTRACOLS 8005 #define XPRS_LPITERLIMIT 8007 @@ -170,7 +177,6 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_BARITERLIMIT 8045 #define XPRS_CHOLESKYALG 8046 #define XPRS_BAROUTPUT 8047 -#define XPRS_CSTYLE 8050 #define XPRS_EXTRAMIPENTS 8051 #define XPRS_REFACTOR 8052 #define XPRS_BARTHREADS 8053 @@ -204,7 +210,6 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_SYMSELECT 8117 #define XPRS_SYMMETRY 8118 #define XPRS_MAXMEMORYHARD 8119 -#define XPRS_LPTHREADS 8124 #define XPRS_MIQCPALG 8125 #define XPRS_QCCUTS 8126 #define XPRS_QCROOTALG 8127 @@ -227,10 +232,7 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_DUALGRADIENT 8145 #define XPRS_SBITERLIMIT 8146 #define XPRS_SBBEST 8147 -#define XPRS_MAXCUTTIME 8149 -#define XPRS_ACTIVESET 8152 #define XPRS_BARINDEFLIMIT 8153 -#define XPRS_HEURSTRATEGY 8154 #define XPRS_HEURFREQ 8155 #define XPRS_HEURDEPTH 8156 #define XPRS_HEURMAXSOL 8157 @@ -262,7 +264,6 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_MAXCHECKSONMAXCUTTIME 8204 #define XPRS_HISTORYCOSTS 8206 #define XPRS_ALGAFTERCROSSOVER 8208 -#define XPRS_LINELENGTH 8209 #define XPRS_MUTEXCALLBACKS 8210 #define XPRS_BARCRASH 8211 #define XPRS_HEURDIVESOFTROUNDING 8215 @@ -272,14 +273,13 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_ROOTPRESOLVE 8224 #define XPRS_CROSSOVERDRP 8227 #define XPRS_FORCEOUTPUT 8229 +#define XPRS_PRIMALOPS 8231 #define XPRS_DETERMINISTIC 8232 #define XPRS_PREPROBING 8238 -#define XPRS_EXTRAQCELEMENTS 8240 -#define XPRS_EXTRAQCROWS 8241 #define XPRS_TREEMEMORYLIMIT 8242 #define XPRS_TREECOMPRESSION 8243 #define XPRS_TREEDIAGNOSTICS 8244 -#define XPRS_MAXGLOBALFILESIZE 8245 +#define XPRS_MAXTREEFILESIZE 8245 #define XPRS_PRECLIQUESTRATEGY 8247 #define XPRS_REPAIRINFEASMAXTIME 8250 #define XPRS_IFCHECKCONVEXITY 8251 @@ -333,10 +333,8 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_TUNERMETHOD 8360 #define XPRS_TUNERTARGET 8362 #define XPRS_TUNERTHREADS 8363 -#define XPRS_TUNERMAXTIME 8364 #define XPRS_TUNERHISTORY 8365 #define XPRS_TUNERPERMUTE 8366 -#define XPRS_TUNERROOTALG 8367 #define XPRS_TUNERVERBOSE 8370 #define XPRS_TUNEROUTPUT 8372 #define XPRS_PREANALYTICCENTER 8374 @@ -344,7 +342,7 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_LPFLAGS 8385 #define XPRS_MIPKAPPAFREQ 8386 #define XPRS_OBJSCALEFACTOR 8387 -#define XPRS_GLOBALFILELOGINTERVAL 8389 +#define XPRS_TREEFILELOGINTERVAL 8389 #define XPRS_IGNORECONTAINERCPULIMIT 8390 #define XPRS_IGNORECONTAINERMEMORYLIMIT 8391 #define XPRS_MIPDUALREDUCTIONS 8392 @@ -355,9 +353,9 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_GENCONSABSTRANSFORMATION 8408 #define XPRS_COMPUTEJOBPRIORITY 8409 #define XPRS_PREFOLDING 8410 -#define XPRS_COMPUTE 8411 #define XPRS_NETSTALLLIMIT 8412 #define XPRS_SERIALIZEPREINTSOL 8413 +#define XPRS_NUMERICALEMPHASIS 8416 #define XPRS_PWLNONCONVEXTRANSFORMATION 8420 #define XPRS_MIPCOMPONENTS 8421 #define XPRS_MIPCONCURRENTNODES 8422 @@ -371,12 +369,17 @@ absl::Status LoadXpressDynamicLibrary(std::string &xpresspath); #define XPRS_BARREFITER 8431 #define XPRS_COMPUTELOG 8434 #define XPRS_SIFTPRESOLVEOPS 8435 +#define XPRS_CHECKINPUTDATA 8436 #define XPRS_ESCAPENAMES 8440 #define XPRS_IOTIMEOUT 8442 -#define XPRS_MAXSTALLTIME 8443 #define XPRS_AUTOCUTTING 8446 +#define XPRS_CALLBACKCHECKTIMEDELAY 8451 +#define XPRS_MULTIOBJOPS 8457 +#define XPRS_MULTIOBJLOG 8458 +#define XPRS_GLOBALSPATIALBRANCHIFPREFERORIG 8465 +#define XPRS_PRECONFIGURATION 8470 +#define XPRS_FEASIBILITYJUMP 8471 #define XPRS_EXTRAELEMS 8006 -#define XPRS_EXTRAPRESOLVE 8037 #define XPRS_EXTRASETELEMS 8191 #define XPRS_LPOBJVAL 2001 #define XPRS_MIPOBJVAL 2003 @@ -438,9 +441,9 @@ extern std::function XPRSgetba extern std::function XPRSwriteprob; extern std::function XPRSgetrowtype; extern std::function XPRSgetcoltype; +extern std::function XPRSchgbounds; extern std::function XPRSgetlpsol; extern std::function XPRSgetmipsol; -extern std::function XPRSchgbounds; extern std::function XPRSchgobj; extern std::function XPRSchgcoef; extern std::function XPRSchgmcoef; diff --git a/ortools/xpress/parse_header_xpress.py b/ortools/xpress/parse_header_xpress.py index 68173c35d25..9295fd5a5e5 100644 --- a/ortools/xpress/parse_header_xpress.py +++ b/ortools/xpress/parse_header_xpress.py @@ -4,7 +4,7 @@ To use, run the script ./parse_header_xpress.py -This will printout on the console 3 sections: +This will printout on the console 9 sections: ------------------- header ------------------- @@ -17,14 +17,55 @@ ------------------- assign ------------------- to copy in the assign part of environment.cc + +------------------- string parameters ------------------- + +to copy in the "getMapStringControls" function of linear_solver/xpress_interface.cc + +------------------- string parameters tests ------------------- + +to copy in the "setStringControls" TEST of linear_solver/unittests/xpress_interface.cc + +------------------- double parameters ------------------- + +to copy in the "getMapDoubleControls" function of linear_solver/xpress_interface.cc + +------------------- double parameters tests ------------------- + +to copy in the "setDoubleControls" TEST of linear_solver/unittests/xpress_interface.cc + +------------------- int parameters ------------------- + +to copy in the "getMapIntControls" function of linear_solver/xpress_interface.cc + +------------------- int parameters tests ------------------- + +to copy in the "setIntControl" TEST of linear_solver/unittests/xpress_interface.cc + +------------------- int64 parameters ------------------- + +to copy in the "getMapInt64Controls" function of linear_solver/xpress_interface.cc + +------------------- int64 parameters tests ------------------- + +to copy in the "setInt64Control" TEST of linear_solver/unittests/xpress_interface.cc """ import argparse import re +from enum import Enum # from absl import app +# This enum is used to detect different sections in the xprs.h document +class XprsDocumentSection(Enum): + STRING_PARAMS = 1 + DOUBLE_PARAMS = 2 + INT_PARAMS = 3 + INT64_PARAMS = 4 + OTHER = 5 + class XpressHeaderParser(object): """Converts xprs.h to something pastable in ./environment.h|.cc.""" @@ -37,103 +78,27 @@ def __init__(self): self.__return_type = '' self.__args = '' self.__fun_name = '' + self.__string_parameters = '' + self.__string_parameters_unittest = '' + self.__double_parameters = '' + self.__double_parameters_unittest = '' + self.__int_parameters = '' + self.__int_parameters_unittest = '' + self.__int64_parameters = '' + self.__int64_parameters_unittest = '' + # These are the definitions required for compiling the XPRESS interface, excluding control parameters self.__required_defines = {"XPRS_PLUSINFINITY", "XPRS_MINUSINFINITY", "XPRS_MAXBANNERLENGTH", "XPVERSION", - "XPRS_MPSRHSNAME", "XPRS_MPSOBJNAME", "XPRS_MPSRANGENAME", "XPRS_MPSBOUNDNAME", - "XPRS_OUTPUTMASK", "XPRS_TUNERMETHODFILE", "XPRS_TUNEROUTPUTPATH", - "XPRS_TUNERSESSIONNAME", "XPRS_COMPUTEEXECSERVICE", "XPRS_MATRIXTOL", - "XPRS_PIVOTTOL", "XPRS_FEASTOL", "XPRS_OUTPUTTOL", "XPRS_SOSREFTOL", - "XPRS_OPTIMALITYTOL", "XPRS_ETATOL", "XPRS_RELPIVOTTOL", "XPRS_MIPTOL", - "XPRS_MIPTOLTARGET", "XPRS_BARPERTURB", "XPRS_MIPADDCUTOFF", "XPRS_MIPABSCUTOFF", - "XPRS_MIPRELCUTOFF", "XPRS_PSEUDOCOST", "XPRS_PENALTY", "XPRS_BIGM", - "XPRS_MIPABSSTOP", "XPRS_MIPRELSTOP", "XPRS_CROSSOVERACCURACYTOL", - "XPRS_PRIMALPERTURB", "XPRS_DUALPERTURB", "XPRS_BAROBJSCALE", "XPRS_BARRHSSCALE", - "XPRS_CHOLESKYTOL", "XPRS_BARGAPSTOP", "XPRS_BARDUALSTOP", "XPRS_BARPRIMALSTOP", - "XPRS_BARSTEPSTOP", "XPRS_ELIMTOL", "XPRS_PERTURB", "XPRS_MARKOWITZTOL", - "XPRS_MIPABSGAPNOTIFY", "XPRS_MIPRELGAPNOTIFY", "XPRS_BARLARGEBOUND", - "XPRS_PPFACTOR", "XPRS_REPAIRINDEFINITEQMAX", "XPRS_BARGAPTARGET", - "XPRS_BARSTARTWEIGHT", "XPRS_BARFREESCALE", "XPRS_SBEFFORT", - "XPRS_HEURDIVERANDOMIZE", "XPRS_HEURSEARCHEFFORT", "XPRS_CUTFACTOR", - "XPRS_EIGENVALUETOL", "XPRS_INDLINBIGM", "XPRS_TREEMEMORYSAVINGTARGET", - "XPRS_GLOBALFILEBIAS", "XPRS_INDPRELINBIGM", "XPRS_RELAXTREEMEMORYLIMIT", - "XPRS_MIPABSGAPNOTIFYOBJ", "XPRS_MIPABSGAPNOTIFYBOUND", "XPRS_PRESOLVEMAXGROW", - "XPRS_HEURSEARCHTARGETSIZE", "XPRS_CROSSOVERRELPIVOTTOL", - "XPRS_CROSSOVERRELPIVOTTOLSAFE", "XPRS_DETLOGFREQ", "XPRS_MAXIMPLIEDBOUND", - "XPRS_FEASTOLTARGET", "XPRS_OPTIMALITYTOLTARGET", "XPRS_PRECOMPONENTSEFFORT", - "XPRS_LPLOGDELAY", "XPRS_HEURDIVEITERLIMIT", "XPRS_BARKERNEL", "XPRS_FEASTOLPERTURB", - "XPRS_CROSSOVERFEASWEIGHT", "XPRS_LUPIVOTTOL", "XPRS_MIPRESTARTGAPTHRESHOLD", - "XPRS_NODEPROBINGEFFORT", "XPRS_INPUTTOL", "XPRS_MIPRESTARTFACTOR", - "XPRS_BAROBJPERTURB", "XPRS_EXTRAROWS", "XPRS_EXTRACOLS", "XPRS_LPITERLIMIT", - "XPRS_LPLOG", "XPRS_SCALING", "XPRS_PRESOLVE", "XPRS_CRASH", "XPRS_PRICINGALG", - "XPRS_INVERTFREQ", "XPRS_INVERTMIN", "XPRS_MAXNODE", "XPRS_MAXTIME", - "XPRS_MAXMIPSOL", "XPRS_SIFTPASSES", "XPRS_DEFAULTALG", "XPRS_VARSELECTION", - "XPRS_NODESELECTION", "XPRS_BACKTRACK", "XPRS_MIPLOG", "XPRS_KEEPNROWS", - "XPRS_MPSECHO", "XPRS_MAXPAGELINES", "XPRS_OUTPUTLOG", "XPRS_BARSOLUTION", - "XPRS_CACHESIZE", "XPRS_CROSSOVER", "XPRS_BARITERLIMIT", "XPRS_CHOLESKYALG", - "XPRS_BAROUTPUT", "XPRS_CSTYLE", "XPRS_EXTRAMIPENTS", "XPRS_REFACTOR", - "XPRS_BARTHREADS", "XPRS_KEEPBASIS", "XPRS_CROSSOVEROPS", "XPRS_VERSION", - "XPRS_CROSSOVERTHREADS", "XPRS_BIGMMETHOD", "XPRS_MPSNAMELENGTH", "XPRS_ELIMFILLIN", - "XPRS_PRESOLVEOPS", "XPRS_MIPPRESOLVE", "XPRS_MIPTHREADS", "XPRS_BARORDER", - "XPRS_BREADTHFIRST", "XPRS_AUTOPERTURB", "XPRS_DENSECOLLIMIT", - "XPRS_CALLBACKFROMMASTERTHREAD", "XPRS_MAXMCOEFFBUFFERELEMS", "XPRS_REFINEOPS", - "XPRS_LPREFINEITERLIMIT", "XPRS_MIPREFINEITERLIMIT", "XPRS_DUALIZEOPS", - "XPRS_CROSSOVERITERLIMIT", "XPRS_PREBASISRED", "XPRS_PRESORT", "XPRS_PREPERMUTE", - "XPRS_PREPERMUTESEED", "XPRS_MAXMEMORYSOFT", "XPRS_CUTFREQ", "XPRS_SYMSELECT", - "XPRS_SYMMETRY", "XPRS_MAXMEMORYHARD", "XPRS_LPTHREADS", "XPRS_MIQCPALG", - "XPRS_QCCUTS", "XPRS_QCROOTALG", "XPRS_PRECONVERTSEPARABLE", "XPRS_ALGAFTERNETWORK", - "XPRS_TRACE", "XPRS_MAXIIS", "XPRS_CPUTIME", "XPRS_COVERCUTS", "XPRS_GOMCUTS", - "XPRS_LPFOLDING", "XPRS_MPSFORMAT", "XPRS_CUTSTRATEGY", "XPRS_CUTDEPTH", - "XPRS_TREECOVERCUTS", "XPRS_TREEGOMCUTS", "XPRS_CUTSELECT", "XPRS_TREECUTSELECT", - "XPRS_DUALIZE", "XPRS_DUALGRADIENT", "XPRS_SBITERLIMIT", "XPRS_SBBEST", - "XPRS_MAXCUTTIME", "XPRS_ACTIVESET", "XPRS_BARINDEFLIMIT", "XPRS_HEURSTRATEGY", - "XPRS_HEURFREQ", "XPRS_HEURDEPTH", "XPRS_HEURMAXSOL", "XPRS_HEURNODES", - "XPRS_LNPBEST", "XPRS_LNPITERLIMIT", "XPRS_BRANCHCHOICE", "XPRS_BARREGULARIZE", - "XPRS_SBSELECT", "XPRS_LOCALCHOICE", "XPRS_LOCALBACKTRACK", "XPRS_DUALSTRATEGY", - "XPRS_HEURDIVESTRATEGY", "XPRS_HEURSELECT", "XPRS_BARSTART", - "XPRS_PRESOLVEPASSES", "XPRS_BARNUMSTABILITY", "XPRS_BARORDERTHREADS", - "XPRS_EXTRASETS", "XPRS_FEASIBILITYPUMP", "XPRS_PRECOEFELIM", "XPRS_PREDOMCOL", - "XPRS_HEURSEARCHFREQ", "XPRS_HEURDIVESPEEDUP", "XPRS_SBESTIMATE", "XPRS_BARCORES", - "XPRS_MAXCHECKSONMAXTIME", "XPRS_MAXCHECKSONMAXCUTTIME", "XPRS_HISTORYCOSTS", - "XPRS_ALGAFTERCROSSOVER", "XPRS_LINELENGTH", "XPRS_MUTEXCALLBACKS", "XPRS_BARCRASH", - "XPRS_HEURDIVESOFTROUNDING", "XPRS_HEURSEARCHROOTSELECT", - "XPRS_HEURSEARCHTREESELECT", "XPRS_ROOTPRESOLVE", "XPRS_MPS18COMPATIBLE", - "XPRS_CROSSOVERDRP", "XPRS_FORCEOUTPUT", "XPRS_DETERMINISTIC", "XPRS_PREPROBING", - "XPRS_EXTRAQCELEMENTS", "XPRS_EXTRAQCROWS", "XPRS_TREEMEMORYLIMIT", - "XPRS_TREECOMPRESSION", "XPRS_TREEDIAGNOSTICS", "XPRS_MAXGLOBALFILESIZE", - "XPRS_PRECLIQUESTRATEGY", "XPRS_REPAIRINFEASMAXTIME", "XPRS_IFCHECKCONVEXITY", - "XPRS_PRIMALUNSHIFT", "XPRS_REPAIRINDEFINITEQ", "XPRS_MIPRAMPUP", - "XPRS_MAXLOCALBACKTRACK", "XPRS_USERSOLHEURISTIC", "XPRS_FORCEPARALLELDUAL", - "XPRS_BACKTRACKTIE", "XPRS_BRANCHDISJ", "XPRS_MIPFRACREDUCE", - "XPRS_CONCURRENTTHREADS", "XPRS_MAXSCALEFACTOR", "XPRS_HEURTHREADS", "XPRS_THREADS", - "XPRS_HEURBEFORELP", "XPRS_PREDOMROW", "XPRS_BRANCHSTRUCTURAL", - "XPRS_QUADRATICUNSHIFT", "XPRS_BARPRESOLVEOPS", "XPRS_QSIMPLEXOPS", - "XPRS_MIPRESTART", "XPRS_CONFLICTCUTS", "XPRS_PREPROTECTDUAL", "XPRS_CORESPERCPU", - "XPRS_RESOURCESTRATEGY", "XPRS_CLAMPING", "XPRS_SLEEPONTHREADWAIT", "XPRS_PREDUPROW", - "XPRS_CPUPLATFORM", "XPRS_BARALG", "XPRS_SIFTING", "XPRS_LPLOGSTYLE", - "XPRS_RANDOMSEED", "XPRS_TREEQCCUTS", "XPRS_PRELINDEP", "XPRS_DUALTHREADS", - "XPRS_PREOBJCUTDETECT", "XPRS_PREBNDREDQUAD", "XPRS_PREBNDREDCONE", - "XPRS_PRECOMPONENTS", "XPRS_MAXMIPTASKS", "XPRS_MIPTERMINATIONMETHOD", - "XPRS_PRECONEDECOMP", "XPRS_HEURFORCESPECIALOBJ", "XPRS_HEURSEARCHROOTCUTFREQ", - "XPRS_PREELIMQUAD", "XPRS_PREIMPLICATIONS", "XPRS_TUNERMODE", "XPRS_TUNERMETHOD", - "XPRS_TUNERTARGET", "XPRS_TUNERTHREADS", "XPRS_TUNERMAXTIME", "XPRS_TUNERHISTORY", - "XPRS_TUNERPERMUTE", "XPRS_TUNERROOTALG", "XPRS_TUNERVERBOSE", "XPRS_TUNEROUTPUT", - "XPRS_PREANALYTICCENTER", "XPRS_NETCUTS", "XPRS_LPFLAGS", "XPRS_MIPKAPPAFREQ", - "XPRS_OBJSCALEFACTOR", "XPRS_GLOBALFILELOGINTERVAL", "XPRS_IGNORECONTAINERCPULIMIT", - "XPRS_IGNORECONTAINERMEMORYLIMIT", "XPRS_MIPDUALREDUCTIONS", - "XPRS_GENCONSDUALREDUCTIONS", "XPRS_PWLDUALREDUCTIONS", "XPRS_BARFAILITERLIMIT", - "XPRS_AUTOSCALING", "XPRS_GENCONSABSTRANSFORMATION", "XPRS_COMPUTEJOBPRIORITY", - "XPRS_PREFOLDING", "XPRS_COMPUTE", "XPRS_NETSTALLLIMIT", "XPRS_SERIALIZEPREINTSOL", - "XPRS_PWLNONCONVEXTRANSFORMATION", "XPRS_MIPCOMPONENTS", "XPRS_MIPCONCURRENTNODES", - "XPRS_MIPCONCURRENTSOLVES", "XPRS_OUTPUTCONTROLS", "XPRS_SIFTSWITCH", - "XPRS_HEUREMPHASIS", "XPRS_COMPUTEMATX", "XPRS_COMPUTEMATX_IIS", - "XPRS_COMPUTEMATX_IISMAXTIME", "XPRS_BARREFITER", "XPRS_COMPUTELOG", - "XPRS_SIFTPRESOLVEOPS", "XPRS_ESCAPENAMES", "XPRS_IOTIMEOUT", "XPRS_MAXSTALLTIME", - "XPRS_AUTOCUTTING", "XPRS_EXTRAELEMS", "XPRS_EXTRAPRESOLVE", "XPRS_EXTRASETELEMS", "XPRS_LPOBJVAL", "XPRS_MIPOBJVAL", "XPRS_BESTBOUND", "XPRS_OBJRHS", "XPRS_OBJSENSE", "XPRS_ROWS", "XPRS_SIMPLEXITER", "XPRS_LPSTATUS", "XPRS_MIPSTATUS", "XPRS_NODES", "XPRS_COLS", "XPRS_LP_OPTIMAL", "XPRS_LP_INFEAS", "XPRS_LP_UNBOUNDED", "XPRS_MIP_SOLUTION", "XPRS_MIP_INFEAS", "XPRS_MIP_OPTIMAL", "XPRS_MIP_UNBOUNDED", - "XPRS_OBJ_MINIMIZE", "XPRS_OBJ_MAXIMIZE", "XPRS_L1CACHE"} + "XPRS_OBJ_MINIMIZE", "XPRS_OBJ_MAXIMIZE"} self.__missing_required_defines = self.__required_defines + # These enum will detect control parameters that will all be imported + self.__doc_section = XprsDocumentSection.OTHER + # These parameters are not supported + self.__excluded_defines = {"XPRS_COMPUTE"} + # These are the functions required for compiling the XPRESS interface self.__required_functions = {"XPRScreateprob", "XPRSdestroyprob", "XPRSinit", "XPRSfree", "XPRSgetlicerrmsg", "XPRSlicense", "XPRSgetbanner", "XPRSgetversion", "XPRSsetdefaultcontrol", "XPRSsetintcontrol", "XPRSsetintcontrol64", "XPRSsetdblcontrol", @@ -145,12 +110,35 @@ def __init__(self): "XPRSpostsolve", "XPRSchgobjsense", "XPRSgetlasterror", "XPRSgetbasis", "XPRSwriteprob", "XPRSgetrowtype", "XPRSgetcoltype", "XPRSgetlpsol", "XPRSgetmipsol", "XPRSchgbounds", "XPRSchgobj", "XPRSchgcoef", "XPRSchgmcoef", - "XPRSchgrhs", "XPRSchgrhsrange", "XPRSchgrowtype", "XPRSsetcbmessage", "XPRSminim", - "XPRSmaxim"} + "XPRSchgrhs", "XPRSchgrhsrange", "XPRSchgrowtype", "XPRSsetcbmessage", + "XPRSminim", "XPRSmaxim"} self.__missing_required_functions = self.__required_functions + self.__XPRSprob_section = False def write_define(self, symbol, value): - if symbol in self.__required_defines: + if symbol in self.__excluded_defines: + print('skipping ' + symbol) + return + + # If it is a control parameter, import it to expose it to the user + # Else import it only if required + if self.__doc_section in [XprsDocumentSection.STRING_PARAMS, XprsDocumentSection.DOUBLE_PARAMS, + XprsDocumentSection.INT_PARAMS, XprsDocumentSection.INT64_PARAMS]: + self.__header += f'#define {symbol} {value}\n' + ortools_symbol = symbol.replace("XPRS_", "") + if self.__doc_section == XprsDocumentSection.STRING_PARAMS: + self.__string_parameters += f'{{\"{ortools_symbol}\", {symbol}}},\n' + self.__string_parameters_unittest += f'{{\"{ortools_symbol}\", {symbol}, "default_value"}},\n' + elif self.__doc_section == XprsDocumentSection.DOUBLE_PARAMS: + self.__double_parameters += f'{{\"{ortools_symbol}\", {symbol}}},\n' + self.__double_parameters_unittest += f'{{\"{ortools_symbol}\", {symbol}, 1.}},\n' + elif self.__doc_section == XprsDocumentSection.INT_PARAMS: + self.__int_parameters += f'{{\"{ortools_symbol}\", {symbol}}},\n' + self.__int_parameters_unittest += f'{{\"{ortools_symbol}\", {symbol}, 1}},\n' + elif self.__doc_section == XprsDocumentSection.INT64_PARAMS: + self.__int64_parameters += f'{{\"{ortools_symbol}\", {symbol}}},\n' + self.__int64_parameters_unittest += f'{{\"{ortools_symbol}\", {symbol}, 1}},\n' + elif symbol in self.__required_defines: self.__header += f'#define {symbol} {value}\n' self.__missing_required_defines.remove(symbol) else: @@ -172,11 +160,28 @@ def parse(self, filepath): with open(filepath) as fp: all_lines = fp.read() + self.__XPRSprob_section = False + for line in all_lines.splitlines(): if not line: # Ignore empty lines. continue - if re.match(r'/\*', line, re.M): # Ignore comments. - continue + + self.detect_XPRSprob_section(line) + + if re.match(r'/\*', line, re.M): # Comments in xprs.h indicate the section + if self.__XPRSprob_section: + if "string control parameters" in line.lower(): + self.__doc_section = XprsDocumentSection.STRING_PARAMS + elif "double control parameters" in line.lower(): + self.__doc_section = XprsDocumentSection.DOUBLE_PARAMS + elif "integer control parameters" in line.lower() and "64-bit" in line.lower(): + self.__doc_section = XprsDocumentSection.INT64_PARAMS + elif "integer control parameters" in line.lower(): + self.__doc_section = XprsDocumentSection.INT_PARAMS + else: + self.__doc_section = XprsDocumentSection.OTHER + else: + self.__doc_section = XprsDocumentSection.OTHER if self.__state == 0: match_def = re.match(r'#define ([A-Z0-9_]*)\s+([^/]+)', line, @@ -248,6 +253,19 @@ def parse(self, filepath): self.__args += match_fun.group(1) continue + def detect_XPRSprob_section(self, line): + """This method detects the section between these commented lines: + /***************************************************************************\ + * control parameters for XPRSprob * + ... + /***************************************************************************\ + """ + if " * control parameters for XPRSprob" in line: + self.__XPRSprob_section = True + elif self.__XPRSprob_section and \ + "/***************************************************************************\\" in line: + self.__XPRSprob_section = False + def output(self): """Output the 3 generated code on standard out.""" print('------------------- header (to copy in environment.h) -------------------') @@ -259,6 +277,30 @@ def output(self): print('------------------- assign (to copy in the assign part of environment.cc) -------------------') print(self.__assign) + print('------------------- string params (to copy in the "getMapStringControls" function of linear_solver/xpress_interface.cc) -------------------') + print(self.__string_parameters) + + print('------------------- string params test (to copy in the "setStringControls" TEST of linear_solver/unittests/xpress_interface.cc) -------------------') + print(self.__string_parameters_unittest) + + print('------------------- double params (to copy in the "getMapDoubleControls" function of linear_solver/xpress_interface.cc) -------------------') + print(self.__double_parameters) + + print('------------------- double params test (to copy in the "setDoubleControls" TEST of linear_solver/unittests/xpress_interface.cc) -------------------') + print(self.__double_parameters_unittest) + + print('------------------- int params (to copy in the "getMapIntControls" function of linear_solver/xpress_interface.cc) -------------------') + print(self.__int_parameters) + + print('------------------- int params test (to copy in the "setIntControls" TEST of linear_solver/unittests/xpress_interface.cc) -------------------') + print(self.__int_parameters_unittest) + + print('------------------- int64 params (to copy in the "getMapInt64Controls" function of linear_solver/xpress_interface.cc) -------------------') + print(self.__int64_parameters) + + print('------------------- int64 params test (to copy in the "setInt64Controls" TEST of linear_solver/unittests/xpress_interface.cc) -------------------') + print(self.__int64_parameters_unittest) + def print_missing_elements(self): if self.__missing_required_defines: print('------WARNING------ missing required defines -------------------')