Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

AMPL .nl file reader and writer.

Author
Stefan Vigerske

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.

TODO:

  • writing of logical constraints (and, or, xor)
  • writing of SOS constraints (into suffixes)

Definition in file reader_nl.cpp.

#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <cstdlib>
#include <unistd.h>
#include "scip/reader_nl.h"
#include "scip/cons_linear.h"
#include "scip/cons_setppc.h"
#include "scip/cons_logicor.h"
#include "scip/cons_knapsack.h"
#include "scip/cons_varbound.h"
#include "scip/cons_nonlinear.h"
#include "scip/cons_sos1.h"
#include "scip/cons_sos2.h"
#include "scip/cons_and.h"
#include "scip/cons_or.h"
#include "scip/cons_xor.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"
#include "mp/nl-writer2.hpp"
#include "mp/nl-opcodes.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
 
class  SCIPNLFeeder
 

Macros

#define READER_NAME   "nlreader"
 
#define READER_DESC   "AMPL .nl file reader"
 
#define READER_EXTENSION   "nl"
 
#define SCIP_CALL_THROW(x)
 
#define PATHSEP   "/"
 

Typedefs

typedef struct SCIP_ProbNlData SCIP_PROBNLDATA
 

Functions

static SCIP_DECL_PROBDELORIG (probdataDelOrigNl)
 
static SCIP_DECL_READERCOPY (readerCopyNl)
 
static SCIP_DECL_READERREAD (readerReadNl)
 
static SCIP_DECL_READERWRITE (readerWriteNl)
 
SCIP_RETCODE SCIPincludeReaderNl (SCIP *scip)
 
SCIP_RETCODE SCIPwriteSolutionNl (SCIP *scip)
 

Macro Definition Documentation

◆ READER_NAME

#define READER_NAME   "nlreader"

Definition at line 95 of file reader_nl.cpp.

◆ READER_DESC

#define READER_DESC   "AMPL .nl file reader"

Definition at line 96 of file reader_nl.cpp.

◆ READER_EXTENSION

#define READER_EXTENSION   "nl"

Definition at line 97 of file reader_nl.cpp.

◆ SCIP_CALL_THROW

#define SCIP_CALL_THROW (   x)
Value:
do \
{ \
SCIP_RETCODE throw_retcode; \
if( ((throw_retcode) = (x)) != SCIP_OKAY ) \
throw std::logic_error("Error <" + std::to_string((long long)throw_retcode) + "> in function call at reader_nl.cpp:" + std::to_string(__LINE__)); \
} \
while( false )
SCIP_VAR ** x
Definition: circlepacking.c:63
@ SCIP_OKAY
Definition: type_retcode.h:42

Definition at line 101 of file reader_nl.cpp.

◆ PATHSEP

#define PATHSEP   "/"

Definition at line 2974 of file reader_nl.cpp.

Typedef Documentation

◆ SCIP_PROBNLDATA

typedef struct SCIP_ProbNlData SCIP_PROBNLDATA

Definition at line 131 of file reader_nl.cpp.

Function Documentation

◆ SCIP_DECL_PROBDELORIG()

static SCIP_DECL_PROBDELORIG ( probdataDelOrigNl  )
static

frees user data of original problem (called when the original problem is freed)

Definition at line 2863 of file reader_nl.cpp.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemoryArrayNull, SCIPfreeMemory, SCIPreleaseCons(), and SCIPreleaseVar().

◆ SCIP_DECL_READERCOPY()

static SCIP_DECL_READERCOPY ( readerCopyNl  )
static

copy method for reader plugins (called when SCIP copies plugins)

Definition at line 2897 of file reader_nl.cpp.

References NULL, SCIP_CALL, SCIP_OKAY, and SCIPincludeReaderNl().

◆ SCIP_DECL_READERREAD()

static SCIP_DECL_READERREAD ( readerReadNl  )
static

◆ SCIP_DECL_READERWRITE()

◆ SCIPincludeReaderNl()

SCIP_RETCODE SCIPincludeReaderNl ( SCIP scip)

◆ SCIPwriteSolutionNl()