Scippy

SCIP

Solving Constraint Integer Programs

compr_weakcompr.c File Reference

Detailed Description

weakcompr tree compression

Author
Jakob Witzig

Definition in file compr_weakcompr.c.

#include <assert.h>
#include <string.h>
#include "scip/mem.h"
#include "scip/misc.h"
#include "scip/compr_weakcompr.h"
#include "scip/compr.h"
#include "scip/pub_reopt.h"

Go to the source code of this file.

Macros

#define COMPR_NAME   "weakcompr"
 
#define COMPR_DESC   "reduce the search frontier to k+1 or max{2, |C|+1} nodes."
 
#define COMPR_PRIORITY   1000
 
#define COMPR_MINNNODES   50
 
#define DEFAULT_MEM_REPR   2 /* since we cannot convert the added constraints into node currently, we choose 2 as default value */
 

Functions

static SCIP_RETCODE sortIDs (SCIP *scip, unsigned int *childids, int nchildids)
 
static SCIP_RETCODE checkMemSize (SCIP *scip, SCIP_COMPRDATA *comprdata, int nrepresentatives)
 
static SCIP_RETCODE constructCompression (SCIP *scip, SCIP_COMPR *compr, SCIP_COMPRDATA *comprdata, SCIP_RESULT *result)
 
static SCIP_RETCODE applyCompression (SCIP *scip, SCIP_COMPR *compr, SCIP_COMPRDATA *comprdata, SCIP_RESULT *result)
 
static SCIP_DECL_COMPRCOPY (comprCopyWeakcompr)
 
static SCIP_DECL_COMPRFREE (comprFreeWeakcompr)
 
static SCIP_DECL_COMPREXIT (comprExitWeakcompr)
 
static SCIP_DECL_COMPREXEC (comprExecWeakcompr)
 
SCIP_RETCODE SCIPincludeComprWeakcompr (SCIP *scip)
 

Macro Definition Documentation

◆ COMPR_NAME

#define COMPR_NAME   "weakcompr"

◆ COMPR_DESC

#define COMPR_DESC   "reduce the search frontier to k+1 or max{2, |C|+1} nodes."

Definition at line 33 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

◆ COMPR_PRIORITY

#define COMPR_PRIORITY   1000

Definition at line 34 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

◆ COMPR_MINNNODES

#define COMPR_MINNNODES   50

Definition at line 35 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

◆ DEFAULT_MEM_REPR

#define DEFAULT_MEM_REPR   2 /* since we cannot convert the added constraints into node currently, we choose 2 as default value */

Definition at line 37 of file compr_weakcompr.c.

Referenced by SCIP_DECL_COMPREXEC().

Function Documentation

◆ sortIDs()

static SCIP_RETCODE sortIDs ( SCIP scip,
unsigned int *  childids,
int  nchildids 
)
static

sort the ids of child nodes by their dual bound of the last iteration

Parameters
scipSCIP data structure
childidsarray of child ids
nchildidsfirst position

Definition at line 62 of file compr_weakcompr.c.

References SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetReoptnode(), SCIPreoptnodeGetLowerbound(), and SCIPsortDownRealInt().

Referenced by constructCompression().

◆ checkMemSize()

static SCIP_RETCODE checkMemSize ( SCIP scip,
SCIP_COMPRDATA comprdata,
int  nrepresentatives 
)
static

check of enough memory is allocated and reallocate of necessary.

Parameters
scipSCIP data structure
comprdatacompression data
nrepresentativesnumber of representatives

Definition at line 89 of file compr_weakcompr.c.

References NULL, SCIP_CALL, SCIP_OKAY, and SCIPreallocBlockMemoryArray.

Referenced by constructCompression().

◆ constructCompression()

◆ applyCompression()

static SCIP_RETCODE applyCompression ( SCIP scip,
SCIP_COMPR compr,
SCIP_COMPRDATA comprdata,
SCIP_RESULT result 
)
static

apply the stored representation to the reopttree

Parameters
scipSCIP data structure
comprcompression method
comprdatacompression data
resultresult pointer

Definition at line 375 of file compr_weakcompr.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_SUCCESS, SCIPreoptnodeSetParentID(), and SCIPsetReoptCompression().

Referenced by SCIP_DECL_COMPREXEC().

◆ SCIP_DECL_COMPRCOPY()

static SCIP_DECL_COMPRCOPY ( comprCopyWeakcompr  )
static

copy method for tree compression plugins (called when SCIP copies plugins)

Definition at line 413 of file compr_weakcompr.c.

References COMPR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPcomprGetName(), and SCIPincludeComprWeakcompr().

◆ SCIP_DECL_COMPRFREE()

static SCIP_DECL_COMPRFREE ( comprFreeWeakcompr  )
static

destructor of tree compression to free user data (called when SCIP is exiting)

Definition at line 427 of file compr_weakcompr.c.

References NULL, SCIP_OKAY, SCIPcomprGetData(), SCIPcomprSetData(), and SCIPfreeBlockMemory.

◆ SCIP_DECL_COMPREXIT()

static SCIP_DECL_COMPREXIT ( comprExitWeakcompr  )
static

deinitialization method of tree compression (called before transformed problem is freed)

Definition at line 445 of file compr_weakcompr.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcomprGetData(), SCIPdeleteReoptnode(), and SCIPfreeBlockMemoryArray.

◆ SCIP_DECL_COMPREXEC()

static SCIP_DECL_COMPREXEC ( comprExecWeakcompr  )
static

◆ SCIPincludeComprWeakcompr()

SCIP_RETCODE SCIPincludeComprWeakcompr ( SCIP scip)

creates the weakcompr tree compression and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 522 of file compr_weakcompr.c.

References COMPR_DESC, COMPR_MINNNODES, COMPR_NAME, COMPR_PRIORITY, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddBoolParam(), SCIPallocBlockMemory, SCIPincludeComprBasic(), SCIPsetComprCopy(), SCIPsetComprExit(), and SCIPsetComprFree().

Referenced by SCIP_DECL_COMPRCOPY(), and SCIPincludeDefaultPlugins().