Scippy

SCIP

Solving Constraint Integer Programs

Detailed Description

weakcompr tree compression

Author
Jakob Witzig

Definition in file compr_weakcompr.c.

#include "blockmemshell/memory.h"
#include "scip/compr_weakcompr.h"
#include "scip/pub_compr.h"
#include "scip/pub_message.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_reopt.h"
#include "scip/pub_tree.h"
#include "scip/scip_compr.h"
#include "scip/scip_general.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_reopt.h"
#include "scip/scip_tree.h"
#include <string.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 52 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

◆ COMPR_PRIORITY

#define COMPR_PRIORITY   1000

Definition at line 53 of file compr_weakcompr.c.

Referenced by SCIPincludeComprWeakcompr().

◆ COMPR_MINNNODES

#define COMPR_MINNNODES   50

Definition at line 54 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 56 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 81 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 108 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 382 of file compr_weakcompr.c.

References FALSE, NULL, r, 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 420 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 434 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 452 of file compr_weakcompr.c.

References FALSE, NULL, r, 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 529 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().