Skip to content

Commit 9e13056

Browse files
committed
Merge remote-tracking branch 'origin/v10-minor'
2 parents 86b2ef7 + a5578f1 commit 9e13056

File tree

6 files changed

+65
-22
lines changed

6 files changed

+65
-22
lines changed

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Fixed bugs
7373
- correct memory reallocation in storeSubproblemMasterVar() of benders.c to avoid freeing errors
7474
- also set real solution in SCIPsolSetValExact() to maintain approximation
7575
- handle exact solutions in SCIPsolCheckOrig(), SCIPcheckSolOrig(), and SCIPrecomputeSolObj() to correctly check exact initial solutions in SCIPtransformProb()
76+
- fixed use of interactive option (-i) of AMPL interface
7677

7778
Miscellaneous
7879
-------------

doc/inc/faq/faqtext.txt

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,18 @@ SECTION: General Questions about SCIP
6666
<p>Unless you want to use SCIP as a pure CP-Solver (see <a href="#scipascpsolver">here</a>),
6767
you need an underlying LP-Solver installed and linked to the libraries
6868
(see the <code><a href="PATHTODOC/INSTALL.LINKEXT">INSTALL</a></code> file in the SCIP root directory).
69-
LP-solvers currently supported by SCIP are:
69+
See <a href="PATHTODOC/LPI.LINKEXT">here</a> for LP-solvers currently supported by SCIP.
70+
When solving MIPs exactly, an <a href="PATHTODOC/LPIEXACT.LINKEXT">exact LP solver supported by SCIP</a> is required.
7071
</p>
71-
<ul>
72-
<li><a href="https://soplex.zib.de/">SoPlex</a></li>
73-
<li><a href="http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/">IBM ILOG CPLEX</a></li>
74-
<li><a href="http://www.fico.com/en/Products/DMTools/Pages/FICO-Xpress-Optimization-Suite.aspx">FICO XPress</a></li>
75-
<li><a href="http://www.gurobi.com/">Gurobi</a> (version at least 7.0.2 required)</li>
76-
<li><a href="https://projects.coin-or.org/Clp/">CLP</a> (interface currently sometimes produces wrong results)</li>
77-
<li><a href="https://github.com/google/or-tools">Glop, Google OR tools</a> (experimental, LPI contained in OR tools)</li>
78-
<li><a href="http://www.mosek.com/">Mosek</a></li>
79-
<li><a href="http://www2.isye.gatech.edu/~wcook/qsopt/">QSopt</a> (experimental)</li>
80-
</ul>
8172
<p>
82-
If you want to use SCIP for mixed integer nonlinear programming, you might want to use an underlying NLP solver (e.g.,
83-
<a href="https://projects.coin-or.org/Ipopt">Ipopt</a> or <a href="https://www.conopt.com">CONOPT</a>). SCIP already
84-
comes with the CppAD expression interpreter (e.g., <a href="http://www.coin-or.org/CppAD/">CppAD</a>) as part of the source code.
73+
If you want to use SCIP for mixed integer nonlinear programming, linking an <a href="PATHTODOC/NLPISOLVERS.LINKEXT">NLP solver supported by SCIP</a> is strongly advised.
74+
The automatic differentiation library <a href="https://github.com/coin-or/CppAD">CppAD</a> is redistributed as part of the SCIP source code.
8575
</p>
8676
<p>
8777
Besides that, you might need a modeling language like <a href="https://zimpl.zib.de/">ZIMPL</a> to generate *.mps
8878
or *.lp files. ZIMPL files (.zpl extension) can also be read directly into SCIP.
89-
Downloading the SCIP Optimization Suite includes SCIP, SoPlex and ZIMPL, as well as GCG and UG. Find installers for different platforms
79+
Further, linking <a href="https://github.com/scipopt/papilo">PaPILO</a> can provide a stronger presolve when solving MIP.
80+
Downloading the SCIP Optimization Suite includes SCIP, SoPlex and ZIMPL, as well as GCG, PaPILO, and UG. Find installers for different platforms
9081
and the source code bundle of all versions <a href="https://scipopt.org/#download">here</a>.
9182
</p>
9283

doc/xternal.c

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9197,14 +9197,33 @@
91979197
* - <a href="https://zimpl.zib.de">ZIMPL</a>, a modeling language for constraint programming,
91989198
* - both <a href="http://www.ampl.com/">AMPL</a> and <a href="http://www.gams.com">GAMS</a>,
91999199
* are well-suited for modeling mixed-integer linear and nonlinear optimization problems,
9200-
* - and <a href="https://projects.coin-or.org/Cmpl">CMPL</a> for mixed-integer linear problems.
9200+
* - and <a href="https://coliop.org/">CMPL</a> for mixed-integer linear problems.
92019201
* - <a href="https://jump.dev/JuMP.jl/stable/">JuMP</a> accesses SCIP through the Julia interface.
92029202
* - <a href="http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.HomePage">YALMIP</a> by Johan L&ouml;fberg provides a
92039203
* free modeling language.
92049204
*
92059205
* The AMPL and ZIMPL interfaces are included in the \SCIP distribution,
92069206
* the GAMS interface is available <a href="https://github.com/coin-or/GAMSlinks">here</a>.
92079207
*
9208+
* @subsection AMPL AMPL Interface
9209+
*
9210+
* The AMPL interface is part of the main \SCIP executable.
9211+
* It is activated when the executable is called with the name of the AMPL `.nl` file as first argument and `-AMPL` as second argument.
9212+
* In this case, \SCIP will employ the \ref reader_nl.h "NL reader" to read the `.nl` file (and `.col` and `.row` files with variable and constraint names, if available),
9213+
* read parameter settings from a `scip.set` file (if present), attempt to solve the problem, write an AMPL solution file with the solve output, and exit.
9214+
* However, if `-i` is given as third argument, then solving the problem is replaced by opening the \ref SHELL "interactive shell".
9215+
*
9216+
* Next to a `scip.set` file, parameter settings can also be given via an `option` command in AMPL, e.g.,
9217+
* ```
9218+
* option scip_options 'limits/gap = 1e-4 display/statistics = TRUE';
9219+
* ```
9220+
* Parameter `display/statistics` is specific to using \SCIP via the AMPL interface and triggers a call to \ref SCIPprintStatistics after the problem has been solved (or the interactive shell has been exited).
9221+
* In addition, a parameter `display/logfile` is available to specify a file to which to print \SCIP output in addition to stdout.
9222+
*
9223+
* For most problems, \SCIP computes a primal solution only.
9224+
* A dual solution is written to an AMPL solution file only if an LP has been solved with presolve disabled.
9225+
*
9226+
* \SCIP is also able to write AMPL `.nl` files (and `.col` and `.row` files with variable and constraint names). See \ref reader_nl.h for currently supported constraint types.
92089227
*/
92099228

92109229
/**@defgroup PUBLICAPI Public API of SCIP

src/scip/reader_nl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,7 @@ class AMPLProblemHandler : public mp::NLHandler<AMPLProblemHandler, SCIP_EXPR*>
963963

964964
/// handling of suffices for variable and constraint flags and SOS constraints
965965
///
966-
/// regarding SOS in AMPL, see https://ampl.com/faqs/how-can-i-use-the-solvers-special-ordered-sets-feature/
966+
/// regarding SOS in AMPL, see https://discuss.ampl.com/t/how-can-i-use-the-solver-s-special-ordered-sets-feature/45
967967
/// we pass the .ref suffix as weight to the SOS constraint handlers
968968
/// for a SOS2, the weights determine the order of variables in the set
969969
template<typename T> class SuffixHandler

src/scip/reader_nl.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,29 @@
2626
* @ingroup FILEREADERS
2727
* @brief AMPL .nl file reader and writer
2828
* @author Stefan Vigerske
29+
*
30+
* \par Reading Functionality
31+
*
32+
* The reader supports linear, nonlinear, and logic constraints, with the following limitations:
33+
* - For nonlinear expressions, only unary operators minus (negation), abs, pow2, sqrt, log, log10, exp, sin, cos,
34+
* binary operators add, sub, mul, div, pow, and n-ary operator sum are supported.
35+
* - For logical constraints, only operators not, or, and, iff, eq, and ne are supported and all arguments must
36+
* be either boolean values or binary variables! The reader currently does not support logical operations that
37+
* use algebraic or linear expressions, and therefore not the creation of indicator constraints.
38+
*
39+
* In addition, the reader creates special ordered set (SOS) constraints of type 1 and 2 if they were specified via
40+
* [`sosnr` suffixes](https://discuss.ampl.com/t/how-can-i-use-the-solver-s-special-ordered-sets-feature/45).
41+
* Values specified via `ref` suffix are passed on as weights to the SOS constraint handlers.
42+
* For SOS of type 2, the weights determine the order of variables in the SOS.
43+
*
44+
* Next to SOS, suffixes can be used to specify flags of variables (see \ref SCIPcreateVar()) and constraints
45+
* (see \ref SCIPcreateCons()). For variables, supported suffixes are `initial` and `removable`. For constraints,
46+
* supported suffixes are `initial`, `separate`, `enforce`, `check`, `propagate`, `dynamic`, and `removable`.
47+
*
48+
* \par Writing Functionality
49+
*
50+
* The writer currently supports the constraint handlers linear, setppc, logicor, knapsack, varbound, and nonlinear only.
51+
* When writing nonlinear constraints, expression handlers entropy and signpower are currently not supported.
2952
*/
3053

3154
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/

src/scip/scipshell.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,17 +248,23 @@ SCIP_RETCODE fromAmpl(
248248
(void) SCIPsnprintf(fullnlfilename, SCIP_MAXSTRLEN, "%s", nlfilename);
249249
else
250250
(void) SCIPsnprintf(fullnlfilename, SCIP_MAXSTRLEN, "%s.nl", nlfilename);
251-
SCIPinfoMessage(scip, NULL, "read problem <%s>\n", fullnlfilename);
252-
SCIPinfoMessage(scip, NULL, "============\n\n");
253-
254-
SCIP_CALL( SCIPreadProb(scip, fullnlfilename, "nl") );
255251

256252
if( interactive )
257253
{
254+
char readcommand[SCIP_MAXSTRLEN+6];
255+
256+
(void) SCIPsnprintf(readcommand, (int)sizeof(readcommand), "read %s", fullnlfilename);
257+
SCIP_CALL( SCIPaddDialogInputLine(scip, readcommand) );
258+
258259
SCIP_CALL( SCIPstartInteraction(scip) );
259260
}
260261
else
261262
{
263+
SCIPinfoMessage(scip, NULL, "read problem <%s>\n", fullnlfilename);
264+
SCIPinfoMessage(scip, NULL, "============\n\n");
265+
266+
SCIP_CALL( SCIPreadProb(scip, fullnlfilename, "nl") );
267+
262268
SCIPinfoMessage(scip, NULL, "\nsolve problem\n");
263269
SCIPinfoMessage(scip, NULL, "=============\n\n");
264270

@@ -274,7 +280,10 @@ SCIP_RETCODE fromAmpl(
274280
SCIP_CALL( SCIPprintStatistics(scip, NULL) );
275281
}
276282

277-
SCIP_CALL( SCIPwriteSolutionNl(scip) );
283+
if( SCIPgetStage(scip) > SCIP_STAGE_PROBLEM )
284+
{
285+
SCIP_CALL( SCIPwriteSolutionNl(scip) );
286+
}
278287

279288
return SCIP_OKAY;
280289

0 commit comments

Comments
 (0)