SCIP Doxygen Documentation
Loading...
Searching...
No Matches

Detailed Description

methods for tree compressions

Author
Jakob Witzig

Definition in file compr.c.

#include <assert.h>
#include <string.h>
#include "scip/def.h"
#include "scip/set.h"
#include "scip/clock.h"
#include "scip/paramset.h"
#include "scip/scip.h"
#include "scip/compr.h"
#include "scip/reopt.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/struct_compr.h"

Go to the source code of this file.

Functions

 SCIP_DECL_SORTPTRCOMP (SCIPcomprComp)
 SCIP_DECL_SORTPTRCOMP (SCIPcomprCompName)
static SCIP_DECL_PARAMCHGD (paramChgdComprPriority)
SCIP_RETCODE SCIPcomprCopyInclude (SCIP_COMPR *compr, SCIP_SET *set)
static SCIP_RETCODE doComprCreate (SCIP_COMPR **compr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPRCOPY((*comprcopy)), SCIP_DECL_COMPRFREE((*comprfree)), SCIP_DECL_COMPRINIT((*comprinit)), SCIP_DECL_COMPREXIT((*comprexit)), SCIP_DECL_COMPRINITSOL((*comprinitsol)), SCIP_DECL_COMPREXITSOL((*comprexitsol)), SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
SCIP_RETCODE SCIPcomprCreate (SCIP_COMPR **compr, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int minnnodes, SCIP_DECL_COMPRCOPY((*comprcopy)), SCIP_DECL_COMPRFREE((*comprfree)), SCIP_DECL_COMPRINIT((*comprinit)), SCIP_DECL_COMPREXIT((*comprexit)), SCIP_DECL_COMPRINITSOL((*comprinitsol)), SCIP_DECL_COMPREXITSOL((*comprexitsol)), SCIP_DECL_COMPREXEC((*comprexec)), SCIP_COMPRDATA *comprdata)
SCIP_RETCODE SCIPcomprFree (SCIP_COMPR **compr, SCIP_SET *set)
SCIP_RETCODE SCIPcomprInit (SCIP_COMPR *compr, SCIP_SET *set)
SCIP_RETCODE SCIPcomprExit (SCIP_COMPR *compr, SCIP_SET *set)
SCIP_RETCODE SCIPcomprExec (SCIP_COMPR *compr, SCIP_SET *set, SCIP_REOPT *reopt, SCIP_RESULT *result)
SCIP_COMPRDATASCIPcomprGetData (SCIP_COMPR *compr)
void SCIPcomprSetData (SCIP_COMPR *compr, SCIP_COMPRDATA *comprdata)
void SCIPcomprSetCopy (SCIP_COMPR *compr,)
void SCIPcomprSetFree (SCIP_COMPR *compr,)
void SCIPcomprSetInit (SCIP_COMPR *compr,)
void SCIPcomprSetExit (SCIP_COMPR *compr,)
void SCIPcomprSetInitsol (SCIP_COMPR *compr,)
void SCIPcomprSetExitsol (SCIP_COMPR *compr,)
SCIP_Bool SCIPcomprShouldBeExecuted (SCIP_COMPR *compr, int depth, int nnodes)
const char * SCIPcomprGetName (SCIP_COMPR *compr)
const char * SCIPcomprGetDesc (SCIP_COMPR *compr)
int SCIPcomprGetPriority (SCIP_COMPR *compr)
void SCIPcomprSetPriority (SCIP_COMPR *compr, SCIP_SET *set, int priority)
int SCIPcomprGetMinNodes (SCIP_COMPR *compr)
SCIP_Longint SCIPcomprGetNCalls (SCIP_COMPR *compr)
SCIP_Longint SCIPcomprGetNFound (SCIP_COMPR *compr)
SCIP_Bool SCIPcomprIsInitialized (SCIP_COMPR *compr)
SCIP_Real SCIPcomprGetSetupTime (SCIP_COMPR *compr)
SCIP_Real SCIPcomprGetTime (SCIP_COMPR *compr)

Function Documentation

◆ SCIP_DECL_PARAMCHGD()

SCIP_DECL_PARAMCHGD ( paramChgdComprPriority )
static

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

Definition at line 70 of file compr.c.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPparamGetData(), SCIPparamGetInt(), and SCIPsetComprPriority().

◆ SCIPcomprCopyInclude()

SCIP_RETCODE SCIPcomprCopyInclude ( SCIP_COMPR * compr,
SCIP_SET * set )

copies the given tree compression to a new scip

Parameters
comprtree compression
setSCIP_SET of SCIP to copy to

Definition at line 84 of file compr.c.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPcomprGetName(), and SCIPsetDebugMsg.

◆ doComprCreate()

SCIP_RETCODE doComprCreate ( SCIP_COMPR ** compr,
SCIP_SET * set,
SCIP_MESSAGEHDLR * messagehdlr,
BMS_BLKMEM * blkmem,
const char * name,
const char * desc,
int priority,
int minnnodes,
SCIP_DECL_COMPRCOPY((*comprcopy)) ,
SCIP_DECL_COMPRFREE((*comprfree)) ,
SCIP_DECL_COMPRINIT((*comprinit)) ,
SCIP_DECL_COMPREXIT((*comprexit)) ,
SCIP_DECL_COMPRINITSOL((*comprinitsol)) ,
SCIP_DECL_COMPREXITSOL((*comprexitsol)) ,
SCIP_DECL_COMPREXEC((*comprexec)) ,
SCIP_COMPRDATA * comprdata )
static

internal method for creating a tree compression

Parameters
comprpointer to tree compression data structure
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of tree compression
descdescription of tree compression
prioritypriority of the tree compression
minnnodesminimal number of nodes for calling compression
comprdatatree compression data

Definition at line 104 of file compr.c.

References assert(), BMSallocMemory, BMSclearMemory, BMSduplicateMemoryArray, FALSE, NULL, paramname, SCIP_ALLOC, SCIP_CALL, SCIP_CLOCKTYPE_DEFAULT, SCIP_DECL_COMPRCOPY, SCIP_DECL_COMPREXEC, SCIP_DECL_COMPREXIT, SCIP_DECL_COMPREXITSOL, SCIP_DECL_COMPRFREE, SCIP_DECL_COMPRINIT, SCIP_DECL_COMPRINITSOL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIPclockCreate(), SCIPsetAddIntParam(), SCIPsnprintf(), and TRUE.

Referenced by SCIPcomprCreate().

◆ SCIPcomprCreate()

SCIP_RETCODE SCIPcomprCreate ( SCIP_COMPR ** compr,
SCIP_SET * set,
SCIP_MESSAGEHDLR * messagehdlr,
BMS_BLKMEM * blkmem,
const char * name,
const char * desc,
int priority,
int minnnodes,
SCIP_DECL_COMPRCOPY((*comprcopy)) ,
SCIP_DECL_COMPRFREE((*comprfree)) ,
SCIP_DECL_COMPRINIT((*comprinit)) ,
SCIP_DECL_COMPREXIT((*comprexit)) ,
SCIP_DECL_COMPRINITSOL((*comprinitsol)) ,
SCIP_DECL_COMPREXITSOL((*comprexitsol)) ,
SCIP_DECL_COMPREXEC((*comprexec)) ,
SCIP_COMPRDATA * comprdata )

creates a tree compression

Parameters
comprpointer to tree compression data structure
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of tree compression
descdescription of tree compression
prioritypriority of the tree compression
minnnodesminimal number of nodes for calling compression
comprdatatree compression data

Definition at line 170 of file compr.c.

References assert(), doComprCreate(), NULL, SCIP_CALL_FINALLY, SCIP_DECL_COMPRCOPY, SCIP_DECL_COMPREXEC, SCIP_DECL_COMPREXIT, SCIP_DECL_COMPREXITSOL, SCIP_DECL_COMPRFREE, SCIP_DECL_COMPRINIT, SCIP_DECL_COMPRINITSOL, SCIP_OKAY, and SCIPcomprFree().

Referenced by SCIPincludeCompr(), and SCIPincludeComprBasic().

◆ SCIPcomprFree()

SCIP_RETCODE SCIPcomprFree ( SCIP_COMPR ** compr,
SCIP_SET * set )

calls destructor and frees memory of tree compression

Parameters
comprpointer to tree compression data structure
setglobal SCIP settings

Definition at line 203 of file compr.c.

References assert(), BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPclockFree().

Referenced by SCIPcomprCreate().

◆ SCIPcomprInit()

SCIP_RETCODE SCIPcomprInit ( SCIP_COMPR * compr,
SCIP_SET * set )

◆ SCIPcomprExit()

SCIP_RETCODE SCIPcomprExit ( SCIP_COMPR * compr,
SCIP_SET * set )

calls exit method of tree compression

Parameters
comprtree compression
setglobal SCIP settings

Definition at line 269 of file compr.c.

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

◆ SCIPcomprExec()

SCIP_RETCODE SCIPcomprExec ( SCIP_COMPR * compr,
SCIP_SET * set,
SCIP_REOPT * reopt,
SCIP_RESULT * result )

calls execution method of tree compression

Parameters
comprtree compression
setglobal SCIP settings
reoptreoptimization data structure
resultpointer to store the result of the callback method

Definition at line 299 of file compr.c.

References assert(), SCIP_Compr::comprclock, SCIP_Compr::minnnodes, SCIP_Compr::name, SCIP_Compr::ncalls, SCIP_Compr::nfound, NULL, result, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_INVALIDRESULT, SCIP_OKAY, SCIP_SUCCESS, SCIPclockStart(), SCIPclockStop(), SCIPerrorMessage, SCIPreoptGetNLeaves(), and SCIPsetDebugMsg.

Referenced by compressReoptTree().

◆ SCIPcomprSetCopy()

void SCIPcomprSetCopy ( SCIP_COMPR * compr)

sets copy callback of tree compression

Parameters
comprtree compression copy callback of tree compression or NULL if you don't want to copy your plugin into sub-SCIPs

Definition at line 376 of file compr.c.

References assert(), NULL, and SCIP_DECL_COMPRCOPY.

Referenced by SCIPsetComprCopy().

◆ SCIPcomprSetFree()

void SCIPcomprSetFree ( SCIP_COMPR * compr)

sets destructor callback of tree compression

Parameters
comprtree compression destructor of tree compression

Definition at line 387 of file compr.c.

References assert(), NULL, and SCIP_DECL_COMPRFREE.

Referenced by SCIPsetComprFree().

◆ SCIPcomprSetInit()

void SCIPcomprSetInit ( SCIP_COMPR * compr)

sets initialization callback of tree compression

Parameters
comprtree compression initialize tree compression

Definition at line 398 of file compr.c.

References assert(), NULL, and SCIP_DECL_COMPRINIT.

Referenced by SCIPsetComprInit().

◆ SCIPcomprSetExit()

void SCIPcomprSetExit ( SCIP_COMPR * compr)

sets deinitialization callback of tree compression

Parameters
comprtree compression deinitialize tree compression

Definition at line 409 of file compr.c.

References assert(), NULL, and SCIP_DECL_COMPREXIT.

Referenced by SCIPsetComprExit().

◆ SCIPcomprSetInitsol()

void SCIPcomprSetInitsol ( SCIP_COMPR * compr)

sets solving process initialization callback of tree compression

Parameters
comprtree compression solving process initialization callback of tree compression

Definition at line 420 of file compr.c.

References assert(), NULL, and SCIP_DECL_COMPRINITSOL.

Referenced by SCIPsetComprInitsol().

◆ SCIPcomprSetExitsol()

void SCIPcomprSetExitsol ( SCIP_COMPR * compr)

sets solving process deinitialization callback of tree compression

Parameters
comprtree compression solving process deinitialization callback of tree compression

Definition at line 431 of file compr.c.

References assert(), NULL, and SCIP_DECL_COMPREXITSOL.

Referenced by SCIPsetComprExitsol().

◆ SCIPcomprShouldBeExecuted()

SCIP_Bool SCIPcomprShouldBeExecuted ( SCIP_COMPR * compr,
int depth,
int nnodes )

should the compression be executed at the given depth, number of nodes

Parameters
comprtree compression
depthdepth of current node
nnodesnumber of open nodes

Definition at line 442 of file compr.c.

References assert(), depth, SCIP_Compr::minnnodes, nnodes, NULL, and SCIP_Bool.

◆ SCIPcomprSetPriority()

void SCIPcomprSetPriority ( SCIP_COMPR * compr,
SCIP_SET * set,
int priority )

sets priority of tree compression

Parameters
comprtree compression
setglobal SCIP settings
prioritynew priority of the tree compression

Definition at line 486 of file compr.c.

References assert(), FALSE, NULL, and SCIP_Compr::priority.

Referenced by SCIPsetComprPriority().