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

#define COMPR_NAME   "weakcompr"
#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().

#define COMPR_PRIORITY   1000

Definition at line 34 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

#define COMPR_MINNNODES   50

Definition at line 35 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

#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

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().

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().

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 362 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().

static SCIP_DECL_COMPRCOPY ( comprCopyWeakcompr  )
static

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

Definition at line 400 of file compr_weakcompr.c.

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

static SCIP_DECL_COMPRFREE ( comprFreeWeakcompr  )
static

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

Definition at line 414 of file compr_weakcompr.c.

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

static SCIP_DECL_COMPREXIT ( comprExitWeakcompr  )
static

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

Definition at line 432 of file compr_weakcompr.c.

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

static SCIP_DECL_COMPREXEC ( comprExecWeakcompr  )
static
SCIP_RETCODE SCIPincludeComprWeakcompr ( SCIP scip)

creates the weakcompr tree compression and includes it in SCIP

Parameters
scipSCIP data structure

Definition at line 509 of file compr_weakcompr.c.

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

Referenced by SCIP_DECL_COMPRCOPY(), and SCIPincludeDefaultPlugins().