Scippy

SCIP

Solving Constraint Integer Programs

scip_exception.hpp File Reference

Detailed Description

exception handling for SCIP

Author
Cornelius Schwarz

Definition in file scip_exception.hpp.

#include <exception>
#include <string>
#include <scip/scip.h>
#include <scip/misc.h>

Go to the source code of this file.

Data Structures

class  SCIPException
 exception handling class for SCIP More...
 

Macros

#define SCIP_MSG_MAX   100
 maximal number of characters in an error messages More...
 
#define SCIP_CALL_EXC(x)
 macro to call scip function with exception handling More...
 

Functions

char * SCIPgetErrorString (SCIP_RETCODE retcode, char *buffer_str, int buffersize)
 translates a SCIP_RETCODE into an error string More...
 

Macro Definition Documentation

◆ SCIP_MSG_MAX

#define SCIP_MSG_MAX   100

maximal number of characters in an error messages

Definition at line 30 of file scip_exception.hpp.

Referenced by SCIPException::SCIPException().

◆ SCIP_CALL_EXC

#define SCIP_CALL_EXC (   x)
Value:
{ \
SCIP_RETCODE retcode; \
if( (retcode = (x)) != SCIP_OKAY) \
{ \
throw SCIPException(retcode); \
} \
}
SCIP_VAR ** x
Definition: circlepacking.c:54
exception handling class for SCIP

macro to call scip function with exception handling

this macro calls a SCIP function and throws an instance of SCIPException if anything went wrong

Definition at line 156 of file scip_exception.hpp.

Referenced by scipexamples::QueensSolver::QueensSolver(), scipexamples::QueensSolver::solve(), and scipexamples::QueensSolver::~QueensSolver().

Function Documentation

◆ SCIPgetErrorString()

char* SCIPgetErrorString ( SCIP_RETCODE  retcode,
char *  buffer_str,
int  buffersize 
)
inline

translates a SCIP_RETCODE into an error string

Parameters
[in]retcodeSCIP_RETCODE you want to translate
[in]buffersizesize of buffer
[out]buffer_strbuffer to character array to store translated message, this must be at least of size SCIP_MSG_MAX
Returns
buffer_str or NULL, if retcode could not be translated

Definition at line 40 of file scip_exception.hpp.

References NULL, SCIP_BRANCHERROR, SCIP_ERROR, SCIP_FILECREATEERROR, SCIP_INVALIDCALL, SCIP_INVALIDDATA, SCIP_INVALIDRESULT, SCIP_KEYALREADYEXISTING, SCIP_LPERROR, SCIP_MAXDEPTHLEVEL, SCIP_NOFILE, SCIP_NOMEMORY, SCIP_NOPROBLEM, SCIP_OKAY, SCIP_PARAMETERUNKNOWN, SCIP_PARAMETERWRONGTYPE, SCIP_PARAMETERWRONGVAL, SCIP_PLUGINNOTFOUND, SCIP_READERROR, SCIP_WRITEERROR, and SCIPsnprintf().

Referenced by SCIPException::SCIPException().