Scippy

SCIP

Solving Constraint Integer Programs

main.c File Reference

Detailed Description

main file for the Pseudo-Boolean solver application

Author
Alexander Hoen
Gioni Mexi
Dominik Kamp

Definition in file main.c.

#include <stdio.h>
#include <string.h>
#include <time.h>
#include "scip/scipdefplugins.h"
#include "scip/scipshell.h"
#include "message_pb.h"
#include "event_bestsol.h"

Go to the source code of this file.

Macros

#define SETOBJ   FALSE
 
#define HEURISTICS_OFF   FALSE
 
#define MAXINTSIZE   47
 
#define MAXMEMUSAGE   0.9
 
#define POSTTIME   3.0
 

Functions

static SCIP_RETCODE loadSettingsPureSat (SCIP *scip)
 
static SCIP_RETCODE loadSettingsMaxSAT (SCIP *scip)
 
static SCIP_RETCODE fromCommandLine (SCIP *scip, const char *settingsfilename, const char *problemfilename, SCIP_Real timelimit, clock_t startclock)
 
static SCIP_RETCODE processShellArguments (SCIP *scip, int argc, char **argv, clock_t startclock, const char *defaultsetname)
 
static SCIP_RETCODE runShell (int argc, char **argv, clock_t startclock, const char *defaultsetname)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ SETOBJ

#define SETOBJ   FALSE

insert objective function if no exists

Definition at line 45 of file main.c.

◆ HEURISTICS_OFF

#define HEURISTICS_OFF   FALSE

turn off heuristics

Definition at line 46 of file main.c.

◆ MAXINTSIZE

#define MAXINTSIZE   47

maximal intsize accepted in problem instance

Definition at line 47 of file main.c.

◆ MAXMEMUSAGE

#define MAXMEMUSAGE   0.9

maximal memory usage relative to given memory limit

Definition at line 48 of file main.c.

◆ POSTTIME

#define POSTTIME   3.0

time in seconds saved in the end to display solution and free everything

Definition at line 49 of file main.c.

Function Documentation

◆ loadSettingsPureSat()

static SCIP_RETCODE loadSettingsPureSat ( SCIP scip)
static

sets parameters for pure satisfiability problems

Parameters
scipSCIP data structure

Definition at line 54 of file main.c.

References SCIP_OKAY.

Referenced by fromCommandLine().

◆ loadSettingsMaxSAT()

static SCIP_RETCODE loadSettingsMaxSAT ( SCIP scip)
static

sets parameters for maximum satisfiability instances

Parameters
scipSCIP data structure

Definition at line 64 of file main.c.

References SCIP_OKAY.

Referenced by fromCommandLine().

◆ fromCommandLine()

static SCIP_RETCODE fromCommandLine ( SCIP scip,
const char *  settingsfilename,
const char *  problemfilename,
SCIP_Real  timelimit,
clock_t  startclock 
)
static

◆ processShellArguments()

static SCIP_RETCODE processShellArguments ( SCIP scip,
int  argc,
char **  argv,
clock_t  startclock,
const char *  defaultsetname 
)
static

evaluates command line parameters and runs SCIP appropriately in the given SCIP instance

Parameters
scipSCIP data structure
argcnumber of shell parameters
argvarray with shell parameters
startclockclock at which the process started
defaultsetnamename of default settings file

Definition at line 303 of file main.c.

References FALSE, fromCommandLine(), interactive(), MAXMEMUSAGE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CALL_FINALLY, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddDialogInputLine(), SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfileExists(), SCIPfopen(), SCIPgetMessagehdlr(), SCIPinfoMessage(), SCIPmessagehdlrGetData(), SCIPprintExternalCodes(), SCIPprintVersion(), SCIPreadParams(), SCIPsetIntParam(), SCIPsetMessagehdlrLogfile(), SCIPsetMessagehdlrQuiet(), SCIPsetRealParam(), SCIPstartInteraction(), and TRUE.

Referenced by runShell().

◆ runShell()

static SCIP_RETCODE runShell ( int  argc,
char **  argv,
clock_t  startclock,
const char *  defaultsetname 
)
static

creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately, and frees the SCIP instance

Parameters
argcnumber of shell parameters
argvarray with shell parameters
startclockclock at which the process started
defaultsetnamename of default settings file

Definition at line 535 of file main.c.

References BMScheckEmptyMemory, FALSE, NULL, processShellArguments(), SCIP_CALL, SCIP_OKAY, SCIPcreate(), SCIPcreateMessagehdlrPbSolver(), SCIPfree(), SCIPincludeDefaultPlugins(), SCIPmessagehdlrRelease(), SCIPsetMessagehdlr(), and TRUE.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

main method starting the PBSolver

Parameters
argcnumber of arguments
argvstring array with arguments

Definition at line 581 of file main.c.

References runShell(), and SCIP_OKAY.