Scippy

SCIP

Solving Constraint Integer Programs

disp.c File Reference

Detailed Description

methods and datastructures for displaying runtime statistics

Author
Tobias Achterberg
Timo Berthold

Definition in file disp.c.

#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/set.h"
#include "scip/stat.h"
#include "scip/scip.h"
#include "scip/disp.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/struct_disp.h"

Go to the source code of this file.

Macros

#define MAXDECPOWER   6
 
#define MAXTIMEPOWER   4
 

Functions

 SCIP_DECL_PARAMCHGD (SCIPparamChgdDispActive)
 
SCIP_RETCODE SCIPdispCopyInclude (SCIP_DISP *disp, SCIP_SET *set)
 
SCIP_RETCODE SCIPdispCreate (SCIP_DISP **disp, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, const char *header, SCIP_DISPSTATUS dispstatus, SCIP_DECL_DISPCOPY((*dispcopy)), SCIP_DECL_DISPFREE((*dispfree)), SCIP_DECL_DISPINIT((*dispinit)), SCIP_DECL_DISPEXIT((*dispexit)), SCIP_DECL_DISPINITSOL((*dispinitsol)), SCIP_DECL_DISPEXITSOL((*dispexitsol)), SCIP_DECL_DISPOUTPUT((*dispoutput)), SCIP_DISPDATA *dispdata, int width, int priority, int position, SCIP_Bool stripline)
 
SCIP_RETCODE SCIPdispFree (SCIP_DISP **disp, SCIP_SET *set)
 
SCIP_RETCODE SCIPdispInit (SCIP_DISP *disp, SCIP_SET *set)
 
SCIP_RETCODE SCIPdispExit (SCIP_DISP *disp, SCIP_SET *set)
 
SCIP_RETCODE SCIPdispInitsol (SCIP_DISP *disp, SCIP_SET *set)
 
SCIP_RETCODE SCIPdispExitsol (SCIP_DISP *disp, SCIP_SET *set)
 
SCIP_RETCODE SCIPdispOutput (SCIP_DISP *disp, SCIP_SET *set, FILE *file)
 
SCIP_DISPDATASCIPdispGetData (SCIP_DISP *disp)
 
void SCIPdispSetData (SCIP_DISP *disp, SCIP_DISPDATA *dispdata)
 
const char * SCIPdispGetName (SCIP_DISP *disp)
 
const char * SCIPdispGetDesc (SCIP_DISP *disp)
 
const char * SCIPdispGetHeader (SCIP_DISP *disp)
 
int SCIPdispGetWidth (SCIP_DISP *disp)
 
int SCIPdispGetPriority (SCIP_DISP *disp)
 
int SCIPdispGetPosition (SCIP_DISP *disp)
 
SCIP_DISPSTATUS SCIPdispGetStatus (SCIP_DISP *disp)
 
SCIP_Bool SCIPdispIsInitialized (SCIP_DISP *disp)
 
SCIP_RETCODE SCIPdispPrintLine (SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, FILE *file, SCIP_Bool forcedisplay, SCIP_Bool endline)
 
static SCIP_DECL_SORTPTRCOMP (dispComp)
 
SCIP_RETCODE SCIPdispAutoActivate (SCIP_SET *set)
 
void SCIPdispLongint (SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_Longint val, int width)
 
void SCIPdispInt (SCIP_MESSAGEHDLR *messagehdlr, FILE *file, int val, int width)
 
void SCIPdispTime (SCIP_MESSAGEHDLR *messagehdlr, FILE *file, SCIP_Real val, int width)
 

Variables

static const char decpowerchar [] = {' ', 'k', 'M', 'G', 'T', 'P', 'E'}
 
static const char timepowerchar [] = {'s', 'm', 'h', 'd', 'y'}
 
const SCIP_Real timepowerval [] = {1.0, 60.0, 60.0, 24.0, 365.0}
 

Macro Definition Documentation

#define MAXDECPOWER   6

Definition at line 506 of file disp.c.

Referenced by SCIPdispLongint().

#define MAXTIMEPOWER   4

Definition at line 569 of file disp.c.

Referenced by SCIPdispTime().

Function Documentation

SCIP_DECL_PARAMCHGD ( SCIPparamChgdDispActive  )

parameter change information method to autoselect display columns again

Definition at line 46 of file disp.c.

References SCIP_CALL, SCIP_OKAY, and SCIPautoselectDisps().

SCIP_RETCODE SCIPdispCopyInclude ( SCIP_DISP disp,
SCIP_SET set 
)

copies the given display to a new scip

Parameters
dispdisplay column
setSCIP_SET of SCIP to copy to

Definition at line 55 of file disp.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, and SCIPdispGetName().

Referenced by SCIPsetCopyPlugins().

SCIP_RETCODE SCIPdispCreate ( SCIP_DISP **  disp,
SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
BMS_BLKMEM blkmem,
const char *  name,
const char *  desc,
const char *  header,
SCIP_DISPSTATUS  dispstatus,
SCIP_DECL_DISPCOPY((*dispcopy))  ,
SCIP_DECL_DISPFREE((*dispfree))  ,
SCIP_DECL_DISPINIT((*dispinit))  ,
SCIP_DECL_DISPEXIT((*dispexit))  ,
SCIP_DECL_DISPINITSOL((*dispinitsol))  ,
SCIP_DECL_DISPEXITSOL((*dispexitsol))  ,
SCIP_DECL_DISPOUTPUT((*dispoutput))  ,
SCIP_DISPDATA dispdata,
int  width,
int  priority,
int  position,
SCIP_Bool  stripline 
)

creates a display column

Parameters
disppointer to store display column
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of display column
descdescription of display column
headerhead line of display column
dispstatusdisplay activation status of display column
dispdatadisplay column data
widthwidth of display column (no. of chars used)
prioritypriority of display column
positionrelative position of display column
striplineshould the column be separated with a line from its right neighbor?

Definition at line 73 of file disp.c.

References BMSallocMemory, BMSduplicateMemoryArray, FALSE, NULL, paramname, SCIP_ALLOC, SCIP_CALL, SCIP_DISPSTATUS_ON, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPsetAddIntParam(), and SCIPsnprintf().

Referenced by SCIPincludeDisp().

SCIP_RETCODE SCIPdispFree ( SCIP_DISP **  disp,
SCIP_SET set 
)

frees memory of display column

Parameters
disppointer to display column data structure
setglobal SCIP settings

Definition at line 136 of file disp.c.

References BMSfreeMemory, BMSfreeMemoryArray, NULL, SCIP_CALL, and SCIP_OKAY.

SCIP_RETCODE SCIPdispInit ( SCIP_DISP disp,
SCIP_SET set 
)

initializes display column

Parameters
dispdisplay column
setglobal SCIP settings

Definition at line 161 of file disp.c.

References SCIP_Disp::initialized, SCIP_Disp::name, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPerrorMessage, and TRUE.

Referenced by SCIPsetInitPlugins().

SCIP_RETCODE SCIPdispExit ( SCIP_DISP disp,
SCIP_SET set 
)

deinitializes display column

Parameters
dispdisplay column
setglobal SCIP settings

Definition at line 185 of file disp.c.

References FALSE, SCIP_Disp::initialized, SCIP_Disp::name, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, and SCIPerrorMessage.

Referenced by SCIPsetExitPlugins().

SCIP_RETCODE SCIPdispInitsol ( SCIP_DISP disp,
SCIP_SET set 
)

informs display column that the branch and bound process is being started

Parameters
dispdisplay column
setglobal SCIP settings

Definition at line 209 of file disp.c.

References NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPsetInitsolPlugins().

SCIP_RETCODE SCIPdispExitsol ( SCIP_DISP disp,
SCIP_SET set 
)

informs display column that the branch and bound process data is being freed

Parameters
dispdisplay column
setglobal SCIP settings

Definition at line 227 of file disp.c.

References NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPsetExitsolPlugins().

SCIP_RETCODE SCIPdispOutput ( SCIP_DISP disp,
SCIP_SET set,
FILE *  file 
)

output display column to screen

Parameters
dispdisplay column
setglobal SCIP settings
fileoutput file (or NULL for standard output)

Definition at line 245 of file disp.c.

References NULL, SCIP_CALL, and SCIP_OKAY.

Referenced by SCIPdispPrintLine().

SCIP_DISPDATA* SCIPdispGetData ( SCIP_DISP disp)

gets user data of display column

Parameters
dispdisplay column

Definition at line 261 of file disp.c.

References SCIP_Disp::dispdata, and NULL.

Referenced by SCIP_DECL_DISPCOPY(), SCIP_DECL_DISPEXIT(), SCIP_DECL_DISPEXITSOL(), SCIP_DECL_DISPFREE(), SCIP_DECL_DISPINIT(), SCIP_DECL_DISPINITSOL(), SCIP_DECL_DISPOUTPUT(), SCIPfindObjDisp(), and SCIPgetObjDisp().

void SCIPdispSetData ( SCIP_DISP disp,
SCIP_DISPDATA dispdata 
)

sets user data of display column; user has to free old data in advance!

Parameters
dispdisplay column
dispdatanew display column user data

Definition at line 271 of file disp.c.

References SCIP_Disp::dispdata, and NULL.

Referenced by SCIP_DECL_DISPFREE(), SCIP_DECL_DISPINITSOL(), and SCIP_DECL_DISPOUTPUT().

const char* SCIPdispGetName ( SCIP_DISP disp)

gets name of display column

Parameters
dispdisplay column

Definition at line 282 of file disp.c.

References SCIP_Disp::name, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIP_DECL_DISPINITSOL(), SCIP_DECL_DISPOUTPUT(), SCIPdispCopyInclude(), SCIPincludeDialogDefaultFix(), and SCIPincludeDialogDefaultSet().

const char* SCIPdispGetDesc ( SCIP_DISP disp)

gets description of display column

Parameters
dispdisplay column

Definition at line 292 of file disp.c.

References SCIP_Disp::desc, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC(), SCIPincludeDialogDefaultFix(), and SCIPincludeDialogDefaultSet().

const char* SCIPdispGetHeader ( SCIP_DISP disp)

gets head line of display column

Parameters
dispdisplay column

Definition at line 302 of file disp.c.

References SCIP_Disp::header, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC().

int SCIPdispGetWidth ( SCIP_DISP disp)

gets width of display column

Parameters
dispdisplay column

Definition at line 312 of file disp.c.

References NULL, and SCIP_Disp::width.

Referenced by SCIP_DECL_DIALOGEXEC().

int SCIPdispGetPriority ( SCIP_DISP disp)

gets priority of display column

Parameters
dispdisplay column

Definition at line 322 of file disp.c.

References NULL, and SCIP_Disp::priority.

Referenced by SCIP_DECL_DIALOGEXEC().

int SCIPdispGetPosition ( SCIP_DISP disp)

gets position of display column

Parameters
dispdisplay column

Definition at line 332 of file disp.c.

References NULL, and SCIP_Disp::position.

Referenced by SCIP_DECL_DIALOGEXEC(), and SCIPsetFindBranchrule().

SCIP_DISPSTATUS SCIPdispGetStatus ( SCIP_DISP disp)

gets status of display column

Parameters
dispdisplay column

Definition at line 342 of file disp.c.

References SCIP_Disp::dispstatus, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_Bool SCIPdispIsInitialized ( SCIP_DISP disp)

is display column initialized?

Parameters
dispdisplay column

Definition at line 352 of file disp.c.

References SCIP_Disp::initialized, and NULL.

Referenced by SCIPsetFindBranchrule().

SCIP_RETCODE SCIPdispPrintLine ( SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_STAT stat,
FILE *  file,
SCIP_Bool  forcedisplay,
SCIP_Bool  endline 
)

prints one line of output with the active display columns

Parameters
setglobal SCIP settings
messagehdlrmessage handler
statproblem statistics data
fileoutput file (or NULL for standard output)
forcedisplayshould the line be printed without regarding frequency?
endlineshould the line be terminated with a newline symbol?

Definition at line 362 of file disp.c.

References FALSE, SCIP_Stat::lastdispnode, SCIP_Stat::ndisplines, SCIP_Stat::nnodes, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VERBLEVEL_NORMAL, SCIPdispOutput(), and SCIPmessageFPrintInfo().

Referenced by priceAndCutLoop(), primalAddSol(), SCIPpriceLoop(), SCIPprintDisplayLine(), and SCIPsolveCIP().

static SCIP_DECL_SORTPTRCOMP ( dispComp  )
static

comparison method for display columns

Definition at line 442 of file disp.c.

SCIP_RETCODE SCIPdispAutoActivate ( SCIP_SET set)

activates all display lines fitting in the display w.r. to priority

Parameters
setglobal SCIP settings

Definition at line 448 of file disp.c.

References SCIP_Disp::active, BMSduplicateMemoryArray, BMSfreeMemoryArray, FALSE, NULL, SCIP_ALLOC, SCIP_DISPSTATUS_AUTO, SCIP_DISPSTATUS_ON, SCIP_OKAY, SCIPsortPtr(), TRUE, and SCIP_Disp::width.

Referenced by SCIPautoselectDisps(), and SCIPsetInitPlugins().

void SCIPdispLongint ( SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
SCIP_Longint  val,
int  width 
)

displays a long integer in decimal form fitting in a given width

Parameters
messagehdlrmessage handler
fileoutput stream
valvalue to display
widthwidth to fit into

Definition at line 509 of file disp.c.

References MAXDECPOWER, SCIP_Longint, SCIP_MAXSTRLEN, SCIPmessageFPrintInfo(), and SCIPsnprintf().

Referenced by SCIP_DECL_DISPOUTPUT(), and SCIPdispInt().

void SCIPdispInt ( SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
int  val,
int  width 
)

displays an integer in decimal form fitting in a given width

Parameters
messagehdlrmessage handler
fileoutput stream
valvalue to display
widthwidth to fit into

Definition at line 555 of file disp.c.

References SCIP_Longint, and SCIPdispLongint().

Referenced by SCIP_DECL_DISPOUTPUT().

void SCIPdispTime ( SCIP_MESSAGEHDLR messagehdlr,
FILE *  file,
SCIP_Real  val,
int  width 
)

displays a time value fitting in a given width

Parameters
messagehdlrmessage handler
fileoutput stream
valvalue in seconds to display
widthwidth to fit into

Definition at line 572 of file disp.c.

References MAXTIMEPOWER, REALABS, SCIP_Longint, SCIP_MAXSTRLEN, SCIPmessageFPrintInfo(), and SCIPsnprintf().

Referenced by SCIP_DECL_DISPOUTPUT().

Variable Documentation

const char decpowerchar[] = {' ', 'k', 'M', 'G', 'T', 'P', 'E'}
static

Definition at line 505 of file disp.c.

const char timepowerchar[] = {'s', 'm', 'h', 'd', 'y'}
static

Definition at line 567 of file disp.c.

const SCIP_Real timepowerval[] = {1.0, 60.0, 60.0, 24.0, 365.0}

Definition at line 568 of file disp.c.