-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,256 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Summary of recent updates to SCIP for AMPL | ||
========================================== | ||
|
||
|
||
## unreleased | ||
- First release of the MP2NL driver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
MP2NL driver for AMPL | ||
==================== | ||
|
||
MP2NL is a metadriver to run existing NL solvers through | ||
the MP library. See documentation at https://mp.ampl.com/. | ||
|
||
Normally MP2NL is invoked by AMPL's solve command, which gives the | ||
invocation | ||
|
||
mp2nl stub -AMPL | ||
|
||
in which stub.nl is an AMPL generic output file (possibly written | ||
by "ampl -obstub" or "ampl -ogstub"). After solving the problem, | ||
mp2nl writes a stub.sol file for use by AMPL's solve and solution | ||
commands. When you run ampl, this all happens automatically if you | ||
give the AMPL commands | ||
|
||
option solver mp2nl; | ||
solve; | ||
|
||
You can control mp2nl either by setting the environment variable | ||
mp2nl_options appropriately (either by using ampl's option command, | ||
or by using the shell's set and export commands before you invoke ampl), | ||
or by passing the options on the command line: | ||
|
||
mp2nl stub [-AMPL] option1=value option2=value ... | ||
|
||
You can put one or more (white-space separated) phrases in $mp2nl_options. | ||
To see the possibilities, invoke | ||
|
||
mp2nl -= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#include "mp/backend-app.h" | ||
|
||
std::unique_ptr<mp::BasicBackend> CreateMP2NLBackend(); | ||
|
||
#ifndef SOLVER_LICNAME | ||
int main(int, char** argv) { | ||
return mp::RunBackendApp(argv, CreateMP2NLBackend); | ||
} | ||
#endif | ||
|
||
extern "C" int main2(int, char** argv, CCallbacks cb) { | ||
return mp::RunBackendApp(argv, CreateMP2NLBackend, cb); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* Generate ModelManagerWithPB<mp::Problem> | ||
* | ||
* Having a separate .cc should improve compilation speed | ||
*/ | ||
|
||
#include "mp/model-mgr-with-std-pb.hpp" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifndef SCIPAMPLSCAPI_H | ||
#define SCIPAMPLSCAPI_H | ||
/* | ||
* C API for MP/Scip | ||
*/ | ||
|
||
#include "mp/ampls-c-api.h" | ||
|
||
|
||
DECLARE_SOLVER_API_FUNCTIONS(MP2NL) | ||
|
||
|
||
#endif // SCIPAMPLSCAPI_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "mp2nl/mp2nl-ampls-c-api.h" | ||
|
||
AMPLS_C_EXPORT AMPLS_MP_Solver* AMPLSOpen_scip(int argc, char** argv) | ||
{ | ||
CCallbacks cb = { NULL }; | ||
return Open_MP2NL(cb); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "mp/flat/redef/MIP/converter_mip.h" | ||
#include "mp/flat/model_api_connect.h" | ||
|
||
#include "mp2nlmodelapi.h" | ||
|
||
|
||
namespace mp { | ||
|
||
/// Defining the function in ...-modelapi-connect.cc | ||
/// for recompilation speed | ||
std::unique_ptr<BasicModelManager> | ||
CreateMP2NLModelMgr(MP2NLCommon& cc, Env& e, | ||
pre::BasicValuePresolver*& pPre) { | ||
return CreateModelMgrWithFlatConverter< | ||
MP2NLModelAPI, MIPFlatConverter >(cc, e, pPre); | ||
} | ||
|
||
} // namespace mp |
Oops, something went wrong.