Detailed Description
methods and macros to use the SCIP memory management
- See also
- Using the memory functions of SCIP for more information
Functions | |
BMS_BLKMEM * | SCIPblkmem (SCIP *scip) |
BMS_BUFMEM * | SCIPbuffer (SCIP *scip) |
BMS_BUFMEM * | SCIPcleanbuffer (SCIP *scip) |
SCIP_Longint | SCIPgetMemUsed (SCIP *scip) |
SCIP_Longint | SCIPgetMemTotal (SCIP *scip) |
SCIP_Longint | SCIPgetMemExternEstim (SCIP *scip) |
int | SCIPcalcMemGrowSize (SCIP *scip, int num) |
SCIP_RETCODE | SCIPensureBlockMemoryArray_call (SCIP *scip, void **arrayptr, size_t elemsize, int *arraysize, int minsize) |
void | SCIPprintMemoryDiagnostic (SCIP *scip) |
Macro Definition Documentation
◆ SCIPallocMemory
#define SCIPallocMemory | ( | scip, | |
ptr | |||
) |
Definition at line 60 of file scip_mem.h.
◆ SCIPallocClearMemory
#define SCIPallocClearMemory | ( | scip, | |
ptr | |||
) |
Definition at line 62 of file scip_mem.h.
◆ SCIPallocMemoryArray
#define SCIPallocMemoryArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 64 of file scip_mem.h.
◆ SCIPallocClearMemoryArray
#define SCIPallocClearMemoryArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 66 of file scip_mem.h.
◆ SCIPallocMemorySize
#define SCIPallocMemorySize | ( | scip, | |
ptr, | |||
size | |||
) |
Definition at line 68 of file scip_mem.h.
◆ SCIPreallocMemoryArray
#define SCIPreallocMemoryArray | ( | scip, | |
ptr, | |||
newnum | |||
) |
Definition at line 70 of file scip_mem.h.
◆ SCIPreallocMemorySize
#define SCIPreallocMemorySize | ( | scip, | |
ptr, | |||
newsize | |||
) |
Definition at line 72 of file scip_mem.h.
◆ SCIPduplicateMemory
#define SCIPduplicateMemory | ( | scip, | |
ptr, | |||
source | |||
) |
Definition at line 74 of file scip_mem.h.
◆ SCIPduplicateMemoryArray
#define SCIPduplicateMemoryArray | ( | scip, | |
ptr, | |||
source, | |||
num | |||
) |
Definition at line 76 of file scip_mem.h.
◆ SCIPfreeMemory
#define SCIPfreeMemory | ( | scip, | |
ptr | |||
) | BMSfreeMemory(ptr) |
Definition at line 78 of file scip_mem.h.
◆ SCIPfreeMemoryNull
#define SCIPfreeMemoryNull | ( | scip, | |
ptr | |||
) | BMSfreeMemoryNull(ptr) |
Definition at line 79 of file scip_mem.h.
◆ SCIPfreeMemoryArray
#define SCIPfreeMemoryArray | ( | scip, | |
ptr | |||
) | BMSfreeMemoryArray(ptr) |
Definition at line 80 of file scip_mem.h.
◆ SCIPfreeMemoryArrayNull
#define SCIPfreeMemoryArrayNull | ( | scip, | |
ptr | |||
) | BMSfreeMemoryArrayNull(ptr) |
Definition at line 81 of file scip_mem.h.
◆ SCIPfreeMemorySize
#define SCIPfreeMemorySize | ( | scip, | |
ptr | |||
) | BMSfreeMemorySize(ptr) |
Definition at line 82 of file scip_mem.h.
◆ SCIPfreeMemorySizeNull
#define SCIPfreeMemorySizeNull | ( | scip, | |
ptr | |||
) | BMSfreeMemorySizeNull(ptr) |
Definition at line 83 of file scip_mem.h.
◆ SCIPallocBlockMemory
#define SCIPallocBlockMemory | ( | scip, | |
ptr | |||
) |
Definition at line 89 of file scip_mem.h.
◆ SCIPallocClearBlockMemory
#define SCIPallocClearBlockMemory | ( | scip, | |
ptr | |||
) |
Definition at line 91 of file scip_mem.h.
◆ SCIPallocBlockMemoryArray
#define SCIPallocBlockMemoryArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 93 of file scip_mem.h.
◆ SCIPallocBlockMemorySize
#define SCIPallocBlockMemorySize | ( | scip, | |
ptr, | |||
size | |||
) |
Definition at line 95 of file scip_mem.h.
◆ SCIPallocClearBlockMemoryArray
#define SCIPallocClearBlockMemoryArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 97 of file scip_mem.h.
◆ SCIPreallocBlockMemoryArray
#define SCIPreallocBlockMemoryArray | ( | scip, | |
ptr, | |||
oldnum, | |||
newnum | |||
) |
Definition at line 99 of file scip_mem.h.
◆ SCIPreallocBlockMemorySize
#define SCIPreallocBlockMemorySize | ( | scip, | |
ptr, | |||
oldsize, | |||
newsize | |||
) |
Definition at line 101 of file scip_mem.h.
◆ SCIPduplicateBlockMemory
#define SCIPduplicateBlockMemory | ( | scip, | |
ptr, | |||
source | |||
) |
Definition at line 103 of file scip_mem.h.
◆ SCIPduplicateBlockMemoryArray
#define SCIPduplicateBlockMemoryArray | ( | scip, | |
ptr, | |||
source, | |||
num | |||
) |
Definition at line 105 of file scip_mem.h.
◆ SCIPensureBlockMemoryArray
#define SCIPensureBlockMemoryArray | ( | scip, | |
ptr, | |||
arraysizeptr, | |||
minsize | |||
) | ( (SCIPensureBlockMemoryArray_call((scip), (void**)(ptr), sizeof(**(ptr)), (arraysizeptr), (minsize))) ) |
Definition at line 107 of file scip_mem.h.
◆ SCIPfreeBlockMemory
#define SCIPfreeBlockMemory | ( | scip, | |
ptr | |||
) | BMSfreeBlockMemory(SCIPblkmem(scip), (ptr)) |
Definition at line 108 of file scip_mem.h.
◆ SCIPfreeBlockMemoryNull
#define SCIPfreeBlockMemoryNull | ( | scip, | |
ptr | |||
) | BMSfreeBlockMemoryNull(SCIPblkmem(scip), (ptr)) |
Definition at line 109 of file scip_mem.h.
◆ SCIPfreeBlockMemoryArray
#define SCIPfreeBlockMemoryArray | ( | scip, | |
ptr, | |||
num | |||
) | BMSfreeBlockMemoryArray(SCIPblkmem(scip), (ptr), (num)) |
Definition at line 110 of file scip_mem.h.
◆ SCIPfreeBlockMemoryArrayNull
#define SCIPfreeBlockMemoryArrayNull | ( | scip, | |
ptr, | |||
num | |||
) | BMSfreeBlockMemoryArrayNull(SCIPblkmem(scip), (ptr), (num)) |
Definition at line 111 of file scip_mem.h.
◆ SCIPfreeBlockMemorySize
#define SCIPfreeBlockMemorySize | ( | scip, | |
ptr, | |||
size | |||
) | BMSfreeBlockMemorySize(SCIPblkmem(scip), (ptr), (size)) |
Definition at line 112 of file scip_mem.h.
◆ SCIPfreeBlockMemorySizeNull
#define SCIPfreeBlockMemorySizeNull | ( | scip, | |
ptr, | |||
size | |||
) | BMSfreeBlockMemorySizeNull(SCIPblkmem(scip), (ptr), (size)) |
Definition at line 113 of file scip_mem.h.
◆ SCIPallocBuffer
#define SCIPallocBuffer | ( | scip, | |
ptr | |||
) |
Definition at line 122 of file scip_mem.h.
◆ SCIPallocBufferArray
#define SCIPallocBufferArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 124 of file scip_mem.h.
◆ SCIPallocClearBufferArray
#define SCIPallocClearBufferArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 126 of file scip_mem.h.
◆ SCIPreallocBufferArray
#define SCIPreallocBufferArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 128 of file scip_mem.h.
◆ SCIPduplicateBuffer
#define SCIPduplicateBuffer | ( | scip, | |
ptr, | |||
source | |||
) |
Definition at line 130 of file scip_mem.h.
◆ SCIPduplicateBufferArray
#define SCIPduplicateBufferArray | ( | scip, | |
ptr, | |||
source, | |||
num | |||
) |
Definition at line 132 of file scip_mem.h.
◆ SCIPfreeBuffer
#define SCIPfreeBuffer | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemorySize(SCIPbuffer(scip), (ptr)) |
Definition at line 134 of file scip_mem.h.
◆ SCIPfreeBufferNull
#define SCIPfreeBufferNull | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemoryNull(SCIPbuffer(scip), (ptr)) |
Definition at line 135 of file scip_mem.h.
◆ SCIPfreeBufferArray
#define SCIPfreeBufferArray | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemoryArray(SCIPbuffer(scip), (ptr)) |
Definition at line 136 of file scip_mem.h.
◆ SCIPfreeBufferArrayNull
#define SCIPfreeBufferArrayNull | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemoryArrayNull(SCIPbuffer(scip), (ptr)) |
Definition at line 137 of file scip_mem.h.
◆ SCIPallocCleanBuffer
#define SCIPallocCleanBuffer | ( | scip, | |
ptr | |||
) |
Definition at line 140 of file scip_mem.h.
◆ SCIPallocCleanBufferArray
#define SCIPallocCleanBufferArray | ( | scip, | |
ptr, | |||
num | |||
) |
Definition at line 142 of file scip_mem.h.
◆ SCIPfreeCleanBuffer
#define SCIPfreeCleanBuffer | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemorySize(SCIPcleanbuffer(scip), (ptr)) |
Definition at line 144 of file scip_mem.h.
◆ SCIPfreeCleanBufferNull
#define SCIPfreeCleanBufferNull | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemoryNull(SCIPcleanbuffer(scip), (ptr)) |
Definition at line 145 of file scip_mem.h.
◆ SCIPfreeCleanBufferArray
#define SCIPfreeCleanBufferArray | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemoryArray(SCIPcleanbuffer(scip), (ptr)) |
Definition at line 146 of file scip_mem.h.
◆ SCIPfreeCleanBufferArrayNull
#define SCIPfreeCleanBufferArrayNull | ( | scip, | |
ptr | |||
) | BMSfreeBufferMemoryArrayNull(SCIPcleanbuffer(scip), (ptr)) |
Definition at line 147 of file scip_mem.h.
Function Documentation
◆ SCIPblkmem()
BMS_BLKMEM * SCIPblkmem | ( | SCIP * | scip | ) |
returns block memory to use at the current time
- Returns
- the block memory to use at the current time.
- Parameters
-
scip SCIP data structure
Definition at line 57 of file scip_mem.c.
Referenced by SCIPensureBlockMemoryArray_call().
◆ SCIPbuffer()
BMS_BUFMEM * SCIPbuffer | ( | SCIP * | scip | ) |
returns buffer memory for short living temporary objects
- Returns
- the buffer memory for short living temporary objects
- Parameters
-
scip SCIP data structure
Definition at line 72 of file scip_mem.c.
References NULL.
Referenced by computeHyperplaneThreePoints(), detectSocQuadraticComplex(), exitPresolve(), getEigenValues(), initPresolve(), presolve(), presolveRound(), propagationRound(), SCIP_DECL_PARAMCHGD(), SCIPcreateBanditEpsgreedy(), SCIPcreateBanditExp3(), SCIPcreateBanditExp3IX(), SCIPcreateBanditUcb(), SCIPprimalHeuristics(), SCIPprintMemoryDiagnostic(), SCIPresetBandit(), and separationRoundLP().
◆ SCIPcleanbuffer()
BMS_BUFMEM * SCIPcleanbuffer | ( | SCIP * | scip | ) |
returns clean buffer memory for short living temporary objects initialized to all zero
- Returns
- the buffer memory for short living temporary objects initialized to all zero
- Parameters
-
scip SCIP data structure
Definition at line 86 of file scip_mem.c.
References NULL.
Referenced by exitPresolve(), initPresolve(), presolve(), presolveRound(), SCIP_DECL_PARAMCHGD(), and SCIPprintMemoryDiagnostic().
◆ SCIPgetMemUsed()
SCIP_Longint SCIPgetMemUsed | ( | SCIP * | scip | ) |
returns the total number of bytes used in block and buffer memory
- Returns
- the total number of bytes used in block and buffer memory.
- Parameters
-
scip SCIP data structure
Definition at line 100 of file scip_mem.c.
References NULL, and SCIPmemGetUsed().
Referenced by applyOptcumulative(), applyRepair(), checkArraySizesGLS(), checkArraySizesHeur(), computeCoverUndercover(), copyMemoryAndTimeLimits(), determineLimits(), doPricing(), getCopyMemlimit(), SCIP_DECL_DISPOUTPUT(), SCIP_DECL_HEUREXEC(), SCIPapplyUndercover(), SCIPsolveConcurrent(), setSubscipLimits(), solveCumulative(), solveIndependentCons(), and solveSubscip().
◆ SCIPgetMemTotal()
SCIP_Longint SCIPgetMemTotal | ( | SCIP * | scip | ) |
returns the total number of bytes in block and buffer memory
- Returns
- the total number of bytes in block and buffer memory.
- Parameters
-
scip SCIP data structure
Definition at line 113 of file scip_mem.c.
References NULL, and SCIPmemGetTotal().
Referenced by SCIP_DECL_CONCSOLVERSYNCWRITE(), SCIP_DECL_DISPOUTPUT(), SCIPgetConcurrentMemTotal(), and SCIPsyncstoreStartSync().
◆ SCIPgetMemExternEstim()
SCIP_Longint SCIPgetMemExternEstim | ( | SCIP * | scip | ) |
returns the estimated number of bytes used by external software, e.g., the LP solver
- Returns
- the estimated number of bytes used by external software, e.g., the LP solver.
- Parameters
-
scip SCIP data structure
Definition at line 126 of file scip_mem.c.
References NULL, and SCIPstatGetMemExternEstim().
Referenced by applyOptcumulative(), applyRepair(), checkArraySizesGLS(), checkArraySizesHeur(), computeCoverUndercover(), copyMemoryAndTimeLimits(), determineLimits(), getCopyMemlimit(), SCIP_DECL_HEUREXEC(), SCIPapplyUndercover(), SCIPcheckCopyLimits(), SCIPsolveConcurrent(), setSubscipLimits(), solveCumulative(), solveIndependentCons(), and solveSubscip().
◆ SCIPcalcMemGrowSize()
int SCIPcalcMemGrowSize | ( | SCIP * | scip, |
int | num | ||
) |
calculate memory size for dynamically allocated arrays
- Returns
- the memory size for dynamically allocated arrays.
- Parameters
-
scip SCIP data structure num minimum number of entries to store
Definition at line 139 of file scip_mem.c.
References NULL, and SCIPsetCalcMemGrowSize().
Referenced by addAuxVar(), addCliqueDataEntry(), addCoef(), addComponent(), addConsToOccurList(), addEntry(), addOneRow(), addOrbitope(), addScenarioEntry(), addSCVarIndicator(), addSSTConssOrbitAndUpdateSST(), addVariableToArray(), addVbound(), applyOptcumulative(), blisshook(), buildScenariosFromBlocks(), buildSubgroupGraph(), checkForOverlapping(), collectAggregatedVars(), collectCliqueData(), COLORprobAddNewStableSet(), consdataEnsureAddLinConsSize(), consdataEnsureVarsSize(), consdataEnsurevarsSizeCardinality(), consdataEnsurevarsSizeSOS1(), consdataEnsurevarsSizeSOS2(), conshdlrdataEnsureLinconsupgradesSize(), constraintListAppend(), constructValidSolution(), correctPresoldata(), createAndAddAndCons(), createBlockproblem(), createProjRow(), determineVariableFixings(), enlargeMinweights(), ensureConsLinSize(), ensureDynamicConsArrayAllocatedAndSufficientlyLarge(), ensureEdgeArraysSize(), ensureFactorsSize(), ensureLocVarsArraySize(), ensureMonomialsSize(), ensureNodeArraysSize(), ensureOpenArraySizeSymdetect(), ensureVarsSize(), exprstackPush(), extendMemoryTreeProfile(), fillVariableGraph(), generateZerohalfCut(), getActiveVariables(), getInputString(), getMaxAndConsDim(), getNextLine(), getNodeIdx(), getVariableOrTerm(), identifyOrbitalSymmetriesBroken(), insertIndex(), insertRayEntry(), level2dataEnsureSize(), nautyhook(), nlrowaggrAddLinearTerm(), presolvePropagateCons(), readBlocks(), readBounds(), readCoefficients(), readExpression(), readIndep(), readQCMatrix(), readQMatrix(), readQuadraticCoefs(), rowprepRecordModifiedVar(), sassyhook(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSPARSE(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_NLHDLRDETECT(), SCIP_DECL_NLPIADDCONSTRAINTS(), SCIP_DECL_NLPIADDVARS(), SCIP_DECL_NLPISOLVE(), SCIP_DECL_PRESOLEXEC(), SCIPaddExprsViolScoreNonlinear(), SCIPaddSymgraphConsnode(), SCIPaddSymgraphOpnode(), SCIPaddSymgraphValnode(), SCIPaggrRowAddRow(), SCIPcomputeExprCurvature(), SCIPcreateConsPseudobooleanWithConss(), SCIPensureRowprepSize(), SCIPlexicographicReductionAddPermutation(), SCIPparseVarsPolynomial(), SCIPpropSyncAddBndchg(), SCIPwriteLp(), SCIPwritePip(), sepadataAddMinor(), separateRltCuts(), tabooListAdd(), and tcliquegraphEnsureCliqueidsSize().
◆ SCIPensureBlockMemoryArray_call()
SCIP_RETCODE SCIPensureBlockMemoryArray_call | ( | SCIP * | scip, |
void ** | arrayptr, | ||
size_t | elemsize, | ||
int * | arraysize, | ||
int | minsize | ||
) |
extends a dynamically allocated block memory array to be able to store at least the given number of elements; use SCIPensureBlockMemoryArray() define to call this method!
- Returns
- SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See SCIP_RETCODE for a complete list of error codes.
- Parameters
-
scip SCIP data structure arrayptr pointer to dynamically sized array elemsize size in bytes of each element in array arraysize pointer to current array size minsize required minimal array size
Definition at line 155 of file scip_mem.c.
References BMSreallocBlockMemorySize, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPblkmem(), and SCIPsetCalcMemGrowSize().
◆ SCIPprintMemoryDiagnostic()
void SCIPprintMemoryDiagnostic | ( | SCIP * | scip | ) |
prints output about used memory
- Parameters
-
scip SCIP data structure
Definition at line 181 of file scip_mem.c.
References BMSdisplayBlockMemory, BMSdisplayMemory, BMSprintBufferMemory(), NULL, SCIPbuffer(), SCIPcleanbuffer(), and SCIPmessagePrintInfo().
Referenced by SCIP_DECL_DIALOGEXEC().