weakcompr tree compression
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) |
#define COMPR_NAME "weakcompr" |
Definition at line 32 of file compr_weakcompr.c.
Referenced by constructCompression(), SCIP_DECL_COMPRCOPY(), SCIP_DECL_COMPREXEC(), and SCIPincludeComprWeakcompr().
#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().
|
static |
sort the ids of child nodes by their dual bound of the last iteration
scip | SCIP data structure |
childids | array of child ids |
nchildids | first 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 |
check of enough memory is allocated and reallocate of necessary.
scip | SCIP data structure |
comprdata | compression data |
nrepresentatives | number of representatives |
Definition at line 89 of file compr_weakcompr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPreallocBlockMemoryArray.
Referenced by constructCompression().
|
static |
try to find a good representation
scip | SCIP data structure |
compr | compression method |
comprdata | compression data |
result | result pointer |
Definition at line 114 of file compr_weakcompr.c.
References checkMemSize(), COMPR_NAME, NULL, REOPT_CONSTYPE_DUALREDS, SCIP_Bool, SCIP_BOUNDTYPE_LOWER, SCIP_BOUNDTYPE_UPPER, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PRESOLVED, SCIP_SUCCESS, SCIPaddReoptnodeBndchg(), SCIPaddReoptnodeCons(), SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPallocMemoryArray, SCIPcomprGetMinNodes(), SCIPdebug, SCIPdebugMsg, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPfreeMemoryArray, SCIPgetCurrentNode(), SCIPgetNBinVars(), SCIPgetNIntVars(), SCIPgetNReoptLeaves(), SCIPgetReoptLeaveIDs(), SCIPgetReoptnode(), SCIPgetReoptnodePath(), SCIPgetStage(), SCIPinfinity(), SCIPinitRepresentation(), SCIPisFeasEQ(), SCIPnodeGetDepth(), SCIPnodeGetNumber(), SCIPreallocMemoryArray, SCIPreoptnodeGetConss(), SCIPreoptnodeGetLowerbound(), SCIPreoptnodeGetNConss(), SCIPreoptnodeGetNVars(), sortIDs(), and TRUE.
Referenced by SCIP_DECL_COMPREXEC().
|
static |
apply the stored representation to the reopttree
scip | SCIP data structure |
compr | compression method |
comprdata | compression data |
result | result 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().
|
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().
|
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.
|
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.
|
static |
execution method of tree compression
Definition at line 480 of file compr_weakcompr.c.
References applyCompression(), COMPR_NAME, constructCompression(), DEFAULT_MEM_REPR, NULL, SCIP_CALL, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_SUCCESS, SCIPallocClearMemoryArray, SCIPcomprGetData(), SCIPcomprIsInitialized(), SCIPdebugMsg, and TRUE.
SCIP_RETCODE SCIPincludeComprWeakcompr | ( | SCIP * | scip | ) |
creates the weakcompr tree compression and includes it in SCIP
scip | SCIP 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().