Detailed Description
AMPL .nl file reader.
For documentation on ampl::mp, see https://ampl.github.io and https://www.zverovich.net/2014/09/19/reading-nl-files.html. For documentation on .nl files, see https://ampl.com/REFS/hooking2.pdf.
Definition in file reader_nl.cpp.
#include <string>
#include <vector>
#include <map>
#include "scip/reader_nl.h"
#include "scip/cons_linear.h"
#include "scip/cons_nonlinear.h"
#include "scip/cons_sos1.h"
#include "scip/cons_sos2.h"
#include "scip/expr_var.h"
#include "scip/expr_value.h"
#include "scip/expr_sum.h"
#include "scip/expr_product.h"
#include "scip/expr_pow.h"
#include "scip/expr_log.h"
#include "scip/expr_exp.h"
#include "scip/expr_trig.h"
#include "scip/expr_abs.h"
#include "mp/nl-reader.h"
Go to the source code of this file.
Data Structures | |
class | AMPLProblemHandler |
implementation of AMPL/MPs NLHandler that constructs a SCIP problem while a .nl file is read More... | |
class | AMPLProblemHandler::NumericArgHandler |
class | AMPLProblemHandler::LinearExprHandler |
class | AMPLProblemHandler::SuffixHandler< T > |
class | AMPLProblemHandler::LinearPartHandler |
Macros | |
#define | READER_NAME "nlreader" |
#define | READER_DESC "AMPL .nl file reader" |
#define | READER_EXTENSION "nl" |
#define | SCIP_CALL_THROW(x) |
Functions | |
static | SCIP_DECL_PROBDELORIG (probdataDelOrigNl) |
static | SCIP_DECL_READERCOPY (readerCopyNl) |
static | SCIP_DECL_READERREAD (readerReadNl) |
SCIP_RETCODE | SCIPincludeReaderNl (SCIP *scip) |
SCIP_RETCODE | SCIPwriteSolutionNl (SCIP *scip) |
Macro Definition Documentation
◆ READER_NAME
#define READER_NAME "nlreader" |
Definition at line 66 of file reader_nl.cpp.
Referenced by SCIPincludeReaderNl().
◆ READER_DESC
#define READER_DESC "AMPL .nl file reader" |
Definition at line 67 of file reader_nl.cpp.
Referenced by SCIPincludeReaderNl().
◆ READER_EXTENSION
#define READER_EXTENSION "nl" |
Definition at line 68 of file reader_nl.cpp.
Referenced by SCIPincludeReaderNl().
◆ SCIP_CALL_THROW
#define SCIP_CALL_THROW | ( | x | ) |
Definition at line 72 of file reader_nl.cpp.
Referenced by AMPLProblemHandler::LinearExprHandler::AddTerm(), AMPLProblemHandler::LinearPartHandler::AddTerm(), AMPLProblemHandler::AMPLProblemHandler(), AMPLProblemHandler::EndCommonExpr(), AMPLProblemHandler::EndInput(), AMPLProblemHandler::EndSum(), AMPLProblemHandler::LinearExprHandler::LinearExprHandler(), AMPLProblemHandler::OnAlgebraicCon(), AMPLProblemHandler::OnBinary(), AMPLProblemHandler::OnConBounds(), AMPLProblemHandler::OnHeader(), AMPLProblemHandler::OnInitialValue(), AMPLProblemHandler::OnNumber(), AMPLProblemHandler::OnObj(), AMPLProblemHandler::OnUnary(), AMPLProblemHandler::OnVarBounds(), and AMPLProblemHandler::SuffixHandler< T >::SetValue().
Function Documentation
◆ SCIP_DECL_PROBDELORIG()
|
static |
frees user data of original problem (called when the original problem is freed)
Definition at line 1286 of file reader_nl.cpp.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemoryArrayNull, SCIPfreeMemory, SCIPreleaseCons(), and SCIPreleaseVar().
◆ SCIP_DECL_READERCOPY()
|
static |
copy method for reader plugins (called when SCIP copies plugins)
Definition at line 1318 of file reader_nl.cpp.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPincludeReaderNl().
◆ SCIP_DECL_READERREAD()
|
static |
problem reading method of reader
Definition at line 1329 of file reader_nl.cpp.
References AMPLProblemHandler::cleanup(), NULL, SCIP_CALL, SCIP_ERROR, SCIP_NOFILE, SCIP_NOMEMORY, SCIP_OKAY, SCIP_READERROR, SCIP_SUCCESS, and SCIPerrorMessage.
◆ SCIPincludeReaderNl()
SCIP_RETCODE SCIPincludeReaderNl | ( | SCIP * | scip | ) |
includes the AMPL .nl file reader in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 1395 of file reader_nl.cpp.
References NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludeExternalCodeInformation(), SCIPincludeReaderBasic(), SCIPsetReaderCopy(), and SCIPsetReaderRead().
Referenced by SCIP_DECL_READERCOPY(), and SCIPincludeDefaultPlugins().
◆ SCIPwriteSolutionNl()
SCIP_RETCODE SCIPwriteSolutionNl | ( | SCIP * | scip | ) |
writes AMPL solution file
problem must have been read with .nl reader
- Parameters
-
scip SCIP data structure
Definition at line 1418 of file reader_nl.cpp.
References NULL, SCIP_CALL, SCIP_ERROR, SCIP_INVALID, SCIP_INVALIDDATA, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIP_STAGE_SOLVED, SCIP_STATUS_BESTSOLLIMIT, SCIP_STATUS_GAPLIMIT, SCIP_STATUS_INFEASIBLE, SCIP_STATUS_INFORUNBD, SCIP_STATUS_MEMLIMIT, SCIP_STATUS_NODELIMIT, SCIP_STATUS_OPTIMAL, SCIP_STATUS_SOLLIMIT, SCIP_STATUS_STALLNODELIMIT, SCIP_STATUS_TIMELIMIT, SCIP_STATUS_TOTALNODELIMIT, SCIP_STATUS_UNBOUNDED, SCIP_STATUS_UNKNOWN, SCIP_STATUS_USERINTERRUPT, SCIP_WRITEERROR, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPdebug, SCIPerrorMessage, SCIPgetBestSol(), SCIPgetDualsolLinear(), SCIPgetObjsense(), SCIPgetProbData(), SCIPgetSolVal(), SCIPgetStage(), SCIPgetStatus(), SCIPgetTransformedCons(), SCIPhasPerformedPresolve(), SCIPinfoMessage(), SCIPprintSol(), SCIPprintStatus(), and TRUE.
Referenced by fromAmpl().