Detailed Description
AMPL .nl file reader and writer.
- Reading Functionality
The reader supports linear, nonlinear, and logic constraints, with the following limitations:
- For nonlinear expressions, only unary operators minus (negation), abs, pow2, sqrt, log, log10, exp, sin, cos, binary operators add, sub, mul, div, pow, and n-ary operator sum are supported.
- For logical constraints, only operators not, or, and, iff, eq, and ne are supported and all arguments must be either boolean values or binary variables! The reader currently does not support logical operations that use algebraic or linear expressions, and therefore not the creation of indicator constraints.
In addition, the reader creates special ordered set (SOS) constraints of type 1 and 2 if they were specified via sosnr suffixes. Values specified via ref suffix are passed on as weights to the SOS constraint handlers. For SOS of type 2, the weights determine the order of variables in the SOS.
Next to SOS, suffixes can be used to specify flags of variables (see SCIPcreateVar()) and constraints (see SCIPcreateCons()). For variables, supported suffixes are initial and removable. For constraints, supported suffixes are initial, separate, enforce, check, propagate, dynamic, and removable.
- Writing Functionality
The writer currently supports the constraint handlers linear, setppc, logicor, knapsack, varbound, and nonlinear only. When writing nonlinear constraints, expression handlers entropy and signpower are currently not supported.
Definition in file reader_nl.h.
#include "scip/scip.h"Go to the source code of this file.
Functions | |
| SCIP_RETCODE | SCIPincludeReaderNl (SCIP *scip) |
| SCIP_RETCODE | SCIPwriteSolutionNl (SCIP *scip) |
Function Documentation
◆ SCIPincludeReaderNl()
| SCIP_RETCODE SCIPincludeReaderNl | ( | SCIP * | scip | ) |
includes the .nl file reader into SCIP
includes the AMPL .nl file reader in SCIP
- Parameters
-
scip SCIP data structure
Definition at line 3223 of file reader_nl.cpp.
References FALSE, NULL, READER_DESC, READER_EXTENSION, READER_NAME, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPincludeExternalCodeInformation(), SCIPincludeReaderBasic(), SCIPsetReaderCopy(), SCIPsetReaderRead(), and SCIPsetReaderWrite().
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 3255 of file reader_nl.cpp.
References NULL, SCIP_CALL, SCIP_ERROR, SCIP_INVALID, SCIP_OBJSENSE_MINIMIZE, SCIP_OKAY, SCIP_Real, SCIP_STAGE_SOLVED, SCIP_STATUS_BESTSOLLIMIT, SCIP_STATUS_DUALLIMIT, SCIP_STATUS_GAPLIMIT, SCIP_STATUS_INFEASIBLE, SCIP_STATUS_INFORUNBD, SCIP_STATUS_MEMLIMIT, SCIP_STATUS_NODELIMIT, SCIP_STATUS_OPTIMAL, SCIP_STATUS_PRIMALLIMIT, SCIP_STATUS_RESTARTLIMIT, SCIP_STATUS_SOLLIMIT, SCIP_STATUS_STALLNODELIMIT, SCIP_STATUS_TERMINATE, 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().