Detailed Description
weakcompr tree compression
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" |
Definition at line 51 of file compr_weakcompr.c.
Referenced by constructCompression(), SCIP_DECL_COMPRCOPY(), SCIP_DECL_COMPREXEC(), and SCIPincludeComprWeakcompr().
◆ 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 |
sort the ids of child nodes by their dual bound of the last iteration
- Parameters
-
scip SCIP data structure childids array of child ids nchildids first 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 |
check of enough memory is allocated and reallocate of necessary.
- Parameters
-
scip SCIP data structure comprdata compression data nrepresentatives number of representatives
Definition at line 108 of file compr_weakcompr.c.
References NULL, SCIP_CALL, SCIP_OKAY, and SCIPreallocBlockMemoryArray.
Referenced by constructCompression().
◆ constructCompression()
|
static |
try to find a good representation
- Parameters
-
scip SCIP data structure compr compression method comprdata compression data result result pointer
Definition at line 133 of file compr_weakcompr.c.
References checkMemSize(), COMPR_NAME, NULL, r, 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, SCIPcomprGetMinNodes(), SCIPdebug, SCIPdebugMsg, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPgetCurrentNode(), SCIPgetNBinVars(), SCIPgetNIntVars(), SCIPgetNReoptLeaves(), SCIPgetNVars(), SCIPgetReoptLeaveIDs(), SCIPgetReoptnode(), SCIPgetReoptnodePath(), SCIPgetStage(), SCIPinfinity(), SCIPinitRepresentation(), SCIPisFeasEQ(), SCIPnodeGetDepth(), SCIPnodeGetNumber(), SCIPreoptnodeGetConss(), SCIPreoptnodeGetLowerbound(), SCIPreoptnodeGetNConss(), SCIPreoptnodeGetNVars(), sortIDs(), and TRUE.
Referenced by SCIP_DECL_COMPREXEC().
◆ applyCompression()
|
static |
apply the stored representation to the reopttree
- Parameters
-
scip SCIP data structure compr compression method comprdata compression data result result 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 |
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 |
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 |
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 |
execution method of tree compression
Definition at line 487 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.
◆ SCIPincludeComprWeakcompr()
SCIP_RETCODE SCIPincludeComprWeakcompr | ( | SCIP * | scip | ) |
creates the weakcompr tree compression and includes it in SCIP
- Parameters
-
scip SCIP 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().