Scippy

SCIP

Solving Constraint Integer Programs

presol.c File Reference

Detailed Description

methods for presolvers

Author
Tobias Achterberg
Timo Berthold

Definition in file presol.c.

#include <assert.h>
#include <string.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/set.h"
#include "scip/clock.h"
#include "scip/paramset.h"
#include "scip/scip.h"
#include "scip/pub_misc.h"
#include "scip/presol.h"
#include "scip/struct_presol.h"

Go to the source code of this file.

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPpresolComp)
 
 SCIP_DECL_SORTPTRCOMP (SCIPpresolCompName)
 
static SCIP_DECL_PARAMCHGD (paramChgdPresolPriority)
 
SCIP_RETCODE SCIPpresolCopyInclude (SCIP_PRESOL *presol, SCIP_SET *set)
 
SCIP_RETCODE SCIPpresolCreate (SCIP_PRESOL **presol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int maxrounds, SCIP_Bool delay, SCIP_DECL_PRESOLCOPY((*presolcopy)), SCIP_DECL_PRESOLFREE((*presolfree)), SCIP_DECL_PRESOLINIT((*presolinit)), SCIP_DECL_PRESOLEXIT((*presolexit)), SCIP_DECL_PRESOLINITPRE((*presolinitpre)), SCIP_DECL_PRESOLEXITPRE((*presolexitpre)), SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
 
SCIP_RETCODE SCIPpresolFree (SCIP_PRESOL **presol, SCIP_SET *set)
 
SCIP_RETCODE SCIPpresolInit (SCIP_PRESOL *presol, SCIP_SET *set)
 
SCIP_RETCODE SCIPpresolExit (SCIP_PRESOL *presol, SCIP_SET *set)
 
SCIP_RETCODE SCIPpresolInitpre (SCIP_PRESOL *presol, SCIP_SET *set)
 
SCIP_RETCODE SCIPpresolExitpre (SCIP_PRESOL *presol, SCIP_SET *set)
 
SCIP_RETCODE SCIPpresolExec (SCIP_PRESOL *presol, SCIP_SET *set, SCIP_Bool execdelayed, int nrounds, int *nfixedvars, int *naggrvars, int *nchgvartypes, int *nchgbds, int *naddholes, int *ndelconss, int *naddconss, int *nupgdconss, int *nchgcoefs, int *nchgsides, SCIP_RESULT *result)
 
SCIP_PRESOLDATASCIPpresolGetData (SCIP_PRESOL *presol)
 
void SCIPpresolSetData (SCIP_PRESOL *presol, SCIP_PRESOLDATA *presoldata)
 
void SCIPpresolSetCopy (SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
 
void SCIPpresolSetFree (SCIP_PRESOL *presol, SCIP_DECL_PRESOLFREE((*presolfree)))
 
void SCIPpresolSetInit (SCIP_PRESOL *presol, SCIP_DECL_PRESOLINIT((*presolinit)))
 
void SCIPpresolSetExit (SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXIT((*presolexit)))
 
void SCIPpresolSetInitpre (SCIP_PRESOL *presol, SCIP_DECL_PRESOLINITPRE((*presolinitpre)))
 
void SCIPpresolSetExitpre (SCIP_PRESOL *presol, SCIP_DECL_PRESOLEXITPRE((*presolexitpre)))
 
const char * SCIPpresolGetName (SCIP_PRESOL *presol)
 
const char * SCIPpresolGetDesc (SCIP_PRESOL *presol)
 
int SCIPpresolGetPriority (SCIP_PRESOL *presol)
 
void SCIPpresolSetPriority (SCIP_PRESOL *presol, SCIP_SET *set, int priority)
 
SCIP_Bool SCIPpresolIsDelayed (SCIP_PRESOL *presol)
 
SCIP_Bool SCIPpresolWasDelayed (SCIP_PRESOL *presol)
 
SCIP_Bool SCIPpresolIsInitialized (SCIP_PRESOL *presol)
 
SCIP_Real SCIPpresolGetSetupTime (SCIP_PRESOL *presol)
 
SCIP_Real SCIPpresolGetTime (SCIP_PRESOL *presol)
 
int SCIPpresolGetNFixedVars (SCIP_PRESOL *presol)
 
int SCIPpresolGetNAggrVars (SCIP_PRESOL *presol)
 
int SCIPpresolGetNChgVarTypes (SCIP_PRESOL *presol)
 
int SCIPpresolGetNChgBds (SCIP_PRESOL *presol)
 
int SCIPpresolGetNAddHoles (SCIP_PRESOL *presol)
 
int SCIPpresolGetNDelConss (SCIP_PRESOL *presol)
 
int SCIPpresolGetNAddConss (SCIP_PRESOL *presol)
 
int SCIPpresolGetNUpgdConss (SCIP_PRESOL *presol)
 
int SCIPpresolGetNChgCoefs (SCIP_PRESOL *presol)
 
int SCIPpresolGetNChgSides (SCIP_PRESOL *presol)
 
int SCIPpresolGetNCalls (SCIP_PRESOL *presol)
 

Function Documentation

SCIP_DECL_SORTPTRCOMP ( SCIPpresolComp  )

compares two presolvers w. r. to their priority

Definition at line 45 of file presol.c.

SCIP_DECL_SORTPTRCOMP ( SCIPpresolCompName  )

comparison method for sorting presolvers w.r.t. to their name

Definition at line 51 of file presol.c.

References SCIPpresolGetName().

static SCIP_DECL_PARAMCHGD ( paramChgdPresolPriority  )
static

method to call, when the priority of a presolver was changed

Definition at line 58 of file presol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPparamGetData(), SCIPparamGetInt(), and SCIPsetPresolPriority().

SCIP_RETCODE SCIPpresolCopyInclude ( SCIP_PRESOL presol,
SCIP_SET set 
)

copies the given presolver to a new scip

Parameters
presolpresolver
setSCIP_SET of SCIP to copy to

Definition at line 72 of file presol.c.

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

Referenced by SCIPsetCopyPlugins().

SCIP_RETCODE SCIPpresolCreate ( SCIP_PRESOL **  presol,
SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
BMS_BLKMEM blkmem,
const char *  name,
const char *  desc,
int  priority,
int  maxrounds,
SCIP_Bool  delay,
SCIP_DECL_PRESOLCOPY((*presolcopy))  ,
SCIP_DECL_PRESOLFREE((*presolfree))  ,
SCIP_DECL_PRESOLINIT((*presolinit))  ,
SCIP_DECL_PRESOLEXIT((*presolexit))  ,
SCIP_DECL_PRESOLINITPRE((*presolinitpre))  ,
SCIP_DECL_PRESOLEXITPRE((*presolexitpre))  ,
SCIP_DECL_PRESOLEXEC((*presolexec))  ,
SCIP_PRESOLDATA presoldata 
)

creates a presolver

Parameters
presolpointer to store presolver
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of presolver
descdescription of presolver
prioritypriority of the presolver (>= 0: before, < 0: after constraint handlers)
maxroundsmaximal number of presolving rounds the presolver participates in (-1: no limit)
delayshould presolver be delayed, if other presolvers found reductions?
presoldatapresolver data

Definition at line 90 of file presol.c.

References BMSallocMemory, BMSduplicateMemoryArray, FALSE, NULL, paramname, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPclockCreate(), SCIPsetAddBoolParam(), SCIPsetAddIntParam(), SCIPsnprintf(), and TRUE.

Referenced by SCIPincludePresol(), and SCIPincludePresolBasic().

SCIP_RETCODE SCIPpresolFree ( SCIP_PRESOL **  presol,
SCIP_SET set 
)

frees memory of presolver

Parameters
presolpointer to presolver data structure
setglobal SCIP settings

Definition at line 154 of file presol.c.

References BMSfreeMemory, BMSfreeMemoryArray, NULL, SCIP_CALL, SCIP_OKAY, and SCIPclockFree().

Referenced by SCIPsetFree().

SCIP_RETCODE SCIPpresolExit ( SCIP_PRESOL presol,
SCIP_SET set 
)

deinitializes presolver

Parameters
presolpresolver
setglobal SCIP settings

Definition at line 240 of file presol.c.

References FALSE, SCIP_Presol::initialized, SCIP_Presol::name, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), SCIPerrorMessage, and SCIP_Presol::setuptime.

Referenced by SCIPsetExitPlugins().

SCIP_RETCODE SCIPpresolExitpre ( SCIP_PRESOL presol,
SCIP_SET set 
)

informs presolver that the presolving process is finished

Parameters
presolpresolver
setglobal SCIP settings

Definition at line 307 of file presol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIP_Presol::setuptime.

Referenced by SCIPsetExitprePlugins().

SCIP_RETCODE SCIPpresolExec ( SCIP_PRESOL presol,
SCIP_SET set,
SCIP_Bool  execdelayed,
int  nrounds,
int *  nfixedvars,
int *  naggrvars,
int *  nchgvartypes,
int *  nchgbds,
int *  naddholes,
int *  ndelconss,
int *  naddconss,
int *  nupgdconss,
int *  nchgcoefs,
int *  nchgsides,
SCIP_RESULT result 
)

executes presolver

Parameters
presolpresolver
setglobal SCIP settings
execdelayedexecute presolver even if it is marked to be delayed
nroundsnumber of presolving rounds already done
nfixedvarspointer to total number of variables fixed of all presolvers
naggrvarspointer to total number of variables aggregated of all presolvers
nchgvartypespointer to total number of variable type changes of all presolvers
nchgbdspointer to total number of variable bounds tightened of all presolvers
naddholespointer to total number of domain holes added of all presolvers
ndelconsspointer to total number of deleted constraints of all presolvers
naddconsspointer to total number of added constraints of all presolvers
nupgdconsspointer to total number of upgraded constraints of all presolvers
nchgcoefspointer to total number of changed coefficients of all presolvers
nchgsidespointer to total number of changed left/right hand sides of all presolvers
resultpointer to store the result of the callback method

Definition at line 331 of file presol.c.

References SCIP_Presol::delay, SCIP_Presol::lastnaddconss, SCIP_Presol::lastnaddholes, SCIP_Presol::lastnaggrvars, SCIP_Presol::lastnchgbds, SCIP_Presol::lastnchgcoefs, SCIP_Presol::lastnchgsides, SCIP_Presol::lastnchgvartypes, SCIP_Presol::lastndelconss, SCIP_Presol::lastnfixedvars, SCIP_Presol::lastnupgdconss, SCIP_Presol::maxrounds, SCIP_Presol::naddconss, SCIP_Presol::naddholes, SCIP_Presol::naggrvars, SCIP_Presol::name, SCIP_Presol::ncalls, SCIP_Presol::nchgbds, SCIP_Presol::nchgcoefs, SCIP_Presol::nchgsides, SCIP_Presol::nchgvartypes, SCIP_Presol::ndelconss, SCIP_Presol::nfixedvars, NULL, SCIP_Presol::nupgdconss, SCIP_Presol::presolclock, SCIP_CALL, SCIP_CUTOFF, SCIP_DELAYED, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_INVALIDRESULT, SCIP_OKAY, SCIP_SUCCESS, SCIP_UNBOUNDED, SCIPclockStart(), SCIPclockStop(), SCIPdebugMessage, SCIPerrorMessage, and SCIP_Presol::wasdelayed.

Referenced by presolveRound().

void SCIPpresolSetData ( SCIP_PRESOL presol,
SCIP_PRESOLDATA presoldata 
)

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

Parameters
presolpresolver
presoldatanew presolver user data

Definition at line 474 of file presol.c.

References NULL, and SCIP_Presol::presoldata.

Referenced by SCIP_DECL_PRESOLFREE().

void SCIPpresolSetCopy ( SCIP_PRESOL presol,
SCIP_DECL_PRESOLCOPY((*presolcopy))   
)

sets copy method of presolver

Parameters
presolpresolver

Definition at line 485 of file presol.c.

References NULL.

Referenced by SCIPsetPresolCopy().

void SCIPpresolSetFree ( SCIP_PRESOL presol,
SCIP_DECL_PRESOLFREE((*presolfree))   
)

sets destructor method of presolver

Parameters
presolpresolver

Definition at line 496 of file presol.c.

References NULL.

Referenced by SCIPsetPresolFree().

void SCIPpresolSetInit ( SCIP_PRESOL presol,
SCIP_DECL_PRESOLINIT((*presolinit))   
)

sets initialization method of presolver

Parameters
presolpresolver

Definition at line 507 of file presol.c.

References NULL.

Referenced by SCIPsetPresolInit().

void SCIPpresolSetExit ( SCIP_PRESOL presol,
SCIP_DECL_PRESOLEXIT((*presolexit))   
)

sets deinitialization method of presolver

Parameters
presolpresolver

Definition at line 518 of file presol.c.

References NULL.

Referenced by SCIPsetPresolExit().

void SCIPpresolSetInitpre ( SCIP_PRESOL presol,
SCIP_DECL_PRESOLINITPRE((*presolinitpre))   
)

sets solving process initialization method of presolver

Parameters
presolpresolver

Definition at line 529 of file presol.c.

References NULL.

Referenced by SCIPsetPresolInitpre().

void SCIPpresolSetExitpre ( SCIP_PRESOL presol,
SCIP_DECL_PRESOLEXITPRE((*presolexitpre))   
)

sets solving process deinitialization method of presolver

Parameters
presolpresolver

Definition at line 540 of file presol.c.

References NULL.

Referenced by SCIPsetPresolExitpre().

const char* SCIPpresolGetDesc ( SCIP_PRESOL presol)

gets description of presolver

Parameters
presolpresolver

Definition at line 561 of file presol.c.

References SCIP_Presol::desc, and NULL.

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

int SCIPpresolGetPriority ( SCIP_PRESOL presol)

gets priority of presolver

Parameters
presolpresolver

Definition at line 571 of file presol.c.

References NULL, and SCIP_Presol::priority.

Referenced by presolveRound(), and SCIP_DECL_DIALOGEXEC().

void SCIPpresolSetPriority ( SCIP_PRESOL presol,
SCIP_SET set,
int  priority 
)

sets priority of presolver

Parameters
presolpresolver
setglobal SCIP settings
prioritynew priority of the presolver

Definition at line 581 of file presol.c.

References FALSE, NULL, and SCIP_Presol::priority.

Referenced by SCIPsetPresolPriority().

SCIP_Bool SCIPpresolIsDelayed ( SCIP_PRESOL presol)

should presolver be delayed, if other presolvers found reductions?

Parameters
presolpresolver

Definition at line 595 of file presol.c.

References SCIP_Presol::delay, and NULL.

Referenced by SCIP_DECL_DIALOGEXEC().

SCIP_Bool SCIPpresolWasDelayed ( SCIP_PRESOL presol)

was presolver delayed at the last call?

Parameters
presolpresolver

Definition at line 605 of file presol.c.

References NULL, and SCIP_Presol::wasdelayed.

Referenced by presolveRound().

SCIP_Bool SCIPpresolIsInitialized ( SCIP_PRESOL presol)

is presolver initialized?

Parameters
presolpresolver

Definition at line 615 of file presol.c.

References SCIP_Presol::initialized, and NULL.

SCIP_Real SCIPpresolGetSetupTime ( SCIP_PRESOL presol)

gets time in seconds used in this presolver for setting up for next stages

Parameters
presolpresolver

Definition at line 625 of file presol.c.

References NULL, SCIPclockGetTime(), and SCIP_Presol::setuptime.

Referenced by printPresolverStatistics().

SCIP_Real SCIPpresolGetTime ( SCIP_PRESOL presol)

gets time in seconds used in this presolver

Parameters
presolpresolver

Definition at line 635 of file presol.c.

References NULL, SCIP_Presol::presolclock, and SCIPclockGetTime().

Referenced by printPresolverStatistics().

int SCIPpresolGetNFixedVars ( SCIP_PRESOL presol)

gets number of variables fixed in presolver

Parameters
presolpresolver

Definition at line 645 of file presol.c.

References SCIP_Presol::nfixedvars, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNAggrVars ( SCIP_PRESOL presol)

gets number of variables aggregated in presolver

Parameters
presolpresolver

Definition at line 655 of file presol.c.

References SCIP_Presol::naggrvars, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNChgVarTypes ( SCIP_PRESOL presol)

gets number of variable types changed in presolver

Parameters
presolpresolver

Definition at line 665 of file presol.c.

References SCIP_Presol::nchgvartypes, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNChgBds ( SCIP_PRESOL presol)

gets number of bounds changed in presolver

Parameters
presolpresolver

Definition at line 675 of file presol.c.

References SCIP_Presol::nchgbds, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNAddHoles ( SCIP_PRESOL presol)

gets number of holes added to domains of variables in presolver

Parameters
presolpresolver

Definition at line 685 of file presol.c.

References SCIP_Presol::naddholes, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNDelConss ( SCIP_PRESOL presol)

gets number of constraints deleted in presolver

Parameters
presolpresolver

Definition at line 695 of file presol.c.

References SCIP_Presol::ndelconss, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNAddConss ( SCIP_PRESOL presol)

gets number of constraints added in presolver

Parameters
presolpresolver

Definition at line 705 of file presol.c.

References SCIP_Presol::naddconss, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNUpgdConss ( SCIP_PRESOL presol)

gets number of constraints upgraded in presolver

Parameters
presolpresolver

Definition at line 715 of file presol.c.

References NULL, and SCIP_Presol::nupgdconss.

int SCIPpresolGetNChgCoefs ( SCIP_PRESOL presol)

gets number of coefficients changed in presolver

Parameters
presolpresolver

Definition at line 725 of file presol.c.

References SCIP_Presol::nchgcoefs, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNChgSides ( SCIP_PRESOL presol)

gets number of constraint sides changed in presolver

Parameters
presolpresolver

Definition at line 735 of file presol.c.

References SCIP_Presol::nchgsides, and NULL.

Referenced by printPresolverStatistics().

int SCIPpresolGetNCalls ( SCIP_PRESOL presol)

gets number of times the presolver was called and tried to find reductions

Parameters
presolpresolver

Definition at line 745 of file presol.c.

References SCIP_Presol::ncalls, and NULL.

Referenced by printPresolverStatistics().