SCIP Doxygen Documentation
Loading...
Searching...
No Matches
misc.h File Reference

Detailed Description

internal miscellaneous methods

Author
Tobias Achterberg

Definition in file misc.h.

#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_misc.h"
#include "scip/pub_misc.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPrealarrayCreate (SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPrealarrayCopy (SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem, SCIP_REALARRAY *sourcerealarray)
SCIP_RETCODE SCIPrealarrayFree (SCIP_REALARRAY **realarray)
SCIP_RETCODE SCIPrealarrayExtend (SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPrealarrayClear (SCIP_REALARRAY *realarray)
SCIP_Real SCIPrealarrayGetVal (SCIP_REALARRAY *realarray, int idx)
SCIP_RETCODE SCIPrealarraySetVal (SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real val)
SCIP_RETCODE SCIPrealarrayIncVal (SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real incval)
int SCIPrealarrayGetMinIdx (SCIP_REALARRAY *realarray)
int SCIPrealarrayGetMaxIdx (SCIP_REALARRAY *realarray)
SCIP_RETCODE SCIPintarrayCreate (SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPintarrayCopy (SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem, SCIP_INTARRAY *sourceintarray)
SCIP_RETCODE SCIPintarrayFree (SCIP_INTARRAY **intarray)
SCIP_RETCODE SCIPintarrayExtend (SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPintarrayClear (SCIP_INTARRAY *intarray)
int SCIPintarrayGetVal (SCIP_INTARRAY *intarray, int idx)
SCIP_RETCODE SCIPintarraySetVal (SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int val)
SCIP_RETCODE SCIPintarrayIncVal (SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int incval)
int SCIPintarrayGetMinIdx (SCIP_INTARRAY *intarray)
int SCIPintarrayGetMaxIdx (SCIP_INTARRAY *intarray)
SCIP_RETCODE SCIPboolarrayCreate (SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPboolarrayCopy (SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem, SCIP_BOOLARRAY *sourceboolarray)
SCIP_RETCODE SCIPboolarrayFree (SCIP_BOOLARRAY **boolarray)
SCIP_RETCODE SCIPboolarrayExtend (SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPboolarrayClear (SCIP_BOOLARRAY *boolarray)
SCIP_Bool SCIPboolarrayGetVal (SCIP_BOOLARRAY *boolarray, int idx)
SCIP_RETCODE SCIPboolarraySetVal (SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Bool val)
int SCIPboolarrayGetMinIdx (SCIP_BOOLARRAY *boolarray)
int SCIPboolarrayGetMaxIdx (SCIP_BOOLARRAY *boolarray)
SCIP_RETCODE SCIPptrarrayCreate (SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPptrarrayCopy (SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem, SCIP_PTRARRAY *sourceptrarray)
SCIP_RETCODE SCIPptrarrayFree (SCIP_PTRARRAY **ptrarray)
SCIP_RETCODE SCIPptrarrayExtend (SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
SCIP_RETCODE SCIPptrarrayClear (SCIP_PTRARRAY *ptrarray)
void * SCIPptrarrayGetVal (SCIP_PTRARRAY *ptrarray, int idx)
SCIP_RETCODE SCIPptrarraySetVal (SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, void *val)
int SCIPptrarrayGetMinIdx (SCIP_PTRARRAY *ptrarray)
int SCIPptrarrayGetMaxIdx (SCIP_PTRARRAY *ptrarray)
SCIP_RETCODE SCIPdisjointsetCreate (SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem, int ncomponents)
void SCIPdisjointsetFree (SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPdigraphCreate (SCIP_DIGRAPH **digraph, BMS_BLKMEM *blkmem, int nnodes)
SCIP_RETCODE SCIPdigraphCopy (SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph, BMS_BLKMEM *targetblkmem)
SCIP_Real SCIPnegateReal (SCIP_Real x)
SCIP_RETCODE SCIPrandomCreate (SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem, unsigned int initialseed)
void SCIPrandomFree (SCIP_RANDNUMGEN **randnumgen, BMS_BLKMEM *blkmem)
void SCIPrandomSetSeed (SCIP_RANDNUMGEN *randnumgen, unsigned int initseed)

Function Documentation

◆ SCIPrealarrayCreate()

SCIP_RETCODE SCIPrealarrayCreate ( SCIP_REALARRAY ** realarray,
BMS_BLKMEM * blkmem )

creates a dynamic array of real values

Parameters
realarraypointer to store the real array
blkmemblock memory

Definition at line 4073 of file misc.c.

References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPrealarrayCreate().

Referenced by SCIPcreateRealarray(), SCIPrealarrayCopy(), SCIPrealarrayCreate(), SCIPsolCreate(), SCIPsolCreateOriginal(), SCIPsolCreatePartial(), and SCIPsolCreateUnknown().

◆ SCIPrealarrayCopy()

SCIP_RETCODE SCIPrealarrayCopy ( SCIP_REALARRAY ** realarray,
BMS_BLKMEM * blkmem,
SCIP_REALARRAY * sourcerealarray )

creates a copy of a dynamic array of real values

Parameters
realarraypointer to store the copied real array
blkmemblock memory
sourcerealarraydynamic real array to copy

Definition at line 4093 of file misc.c.

References assert(), BMSduplicateBlockMemoryArray, SCIP_RealArray::firstidx, SCIP_RealArray::maxusedidx, SCIP_RealArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPrealarrayCopy(), SCIPrealarrayCreate(), SCIP_RealArray::vals, and SCIP_RealArray::valssize.

Referenced by SCIPrealarrayCopy(), and SCIPsolCopy().

◆ SCIPrealarrayFree()

SCIP_RETCODE SCIPrealarrayFree ( SCIP_REALARRAY ** realarray)

frees a dynamic array of real values

Parameters
realarraypointer to the real array

Definition at line 4117 of file misc.c.

References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, SCIP_OKAY, and SCIPrealarrayFree().

Referenced by SCIPfreeRealarray(), SCIPrealarrayFree(), and SCIPsolFree().

◆ SCIPrealarrayExtend()

SCIP_RETCODE SCIPrealarrayExtend ( SCIP_REALARRAY * realarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int minidx,
int maxidx )

extends dynamic array to be able to store indices from minidx to maxidx

Parameters
realarraydynamic real array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
minidxsmallest index to allocate storage for
maxidxlargest index to allocate storage for

Definition at line 4131 of file misc.c.

References assert(), SCIP_RealArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_RealArray::firstidx, i, MAX, SCIP_RealArray::maxusedidx, MIN, SCIP_RealArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPrealarrayExtend(), SCIP_RealArray::vals, and SCIP_RealArray::valssize.

Referenced by SCIPextendRealarray(), SCIPlpSumRows(), SCIPrealarrayExtend(), and SCIPrealarraySetVal().

◆ SCIPrealarrayClear()

SCIP_RETCODE SCIPrealarrayClear ( SCIP_REALARRAY * realarray)

◆ SCIPrealarrayGetVal()

SCIP_Real SCIPrealarrayGetVal ( SCIP_REALARRAY * realarray,
int idx )

gets value of entry in dynamic array

Parameters
realarraydynamic real array
idxarray index to get value for

Definition at line 4317 of file misc.c.

References assert(), SCIP_RealArray::firstidx, SCIP_RealArray::maxusedidx, NULL, SCIP_Real, SCIPrealarrayGetVal(), SCIP_RealArray::vals, and SCIP_RealArray::valssize.

Referenced by SCIPgetRealarrayVal(), SCIPrealarrayGetVal(), SCIPrealarrayIncVal(), solGetArrayVal(), and solIncArrayVal().

◆ SCIPrealarraySetVal()

SCIP_RETCODE SCIPrealarraySetVal ( SCIP_REALARRAY * realarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int idx,
SCIP_Real val )

sets value of entry in dynamic array

Parameters
realarraydynamic real array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
idxarray index to set value for
valvalue to set array index to

Definition at line 4338 of file misc.c.

References assert(), SCIP_RealArray::firstidx, MAX, SCIP_RealArray::maxusedidx, MIN, SCIP_RealArray::minusedidx, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPrealarrayExtend(), SCIPrealarraySetVal(), SCIP_RealArray::vals, and SCIP_RealArray::valssize.

Referenced by SCIPrealarrayIncVal(), SCIPrealarraySetVal(), SCIPsetRealarrayVal(), SCIPsolMarkPartial(), solIncArrayVal(), and solSetArrayVal().

◆ SCIPrealarrayIncVal()

SCIP_RETCODE SCIPrealarrayIncVal ( SCIP_REALARRAY * realarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int idx,
SCIP_Real incval )

increases value of entry in dynamic array

Parameters
realarraydynamic real array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
idxarray index to increase value for
incvalvalue to increase array index

Definition at line 4407 of file misc.c.

References SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIPrealarrayGetVal(), SCIPrealarrayIncVal(), and SCIPrealarraySetVal().

Referenced by SCIPincRealarrayVal(), SCIPlpSumRows(), SCIPrealarrayIncVal(), and solIncArrayVal().

◆ SCIPrealarrayGetMinIdx()

int SCIPrealarrayGetMinIdx ( SCIP_REALARRAY * realarray)

returns the minimal index of all stored non-zero elements

Parameters
realarraydynamic real array

Definition at line 4425 of file misc.c.

References assert(), SCIP_RealArray::minusedidx, NULL, and SCIPrealarrayGetMinIdx().

Referenced by SCIPgetRealarrayMinIdx(), and SCIPrealarrayGetMinIdx().

◆ SCIPrealarrayGetMaxIdx()

int SCIPrealarrayGetMaxIdx ( SCIP_REALARRAY * realarray)

returns the maximal index of all stored non-zero elements

Parameters
realarraydynamic real array

Definition at line 4435 of file misc.c.

References assert(), SCIP_RealArray::maxusedidx, NULL, and SCIPrealarrayGetMaxIdx().

Referenced by SCIPgetRealarrayMaxIdx(), and SCIPrealarrayGetMaxIdx().

◆ SCIPintarrayCreate()

SCIP_RETCODE SCIPintarrayCreate ( SCIP_INTARRAY ** intarray,
BMS_BLKMEM * blkmem )

creates a dynamic array of int values

Parameters
intarraypointer to store the int array
blkmemblock memory

Definition at line 4445 of file misc.c.

References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPintarrayCreate().

Referenced by SCIPcreateIntarray(), SCIPintarrayCopy(), and SCIPintarrayCreate().

◆ SCIPintarrayCopy()

SCIP_RETCODE SCIPintarrayCopy ( SCIP_INTARRAY ** intarray,
BMS_BLKMEM * blkmem,
SCIP_INTARRAY * sourceintarray )

creates a copy of a dynamic array of int values

Parameters
intarraypointer to store the copied int array
blkmemblock memory
sourceintarraydynamic int array to copy

Definition at line 4465 of file misc.c.

References assert(), BMSduplicateBlockMemoryArray, SCIP_IntArray::firstidx, SCIP_IntArray::maxusedidx, SCIP_IntArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPintarrayCopy(), SCIPintarrayCreate(), SCIP_IntArray::vals, and SCIP_IntArray::valssize.

Referenced by SCIPintarrayCopy().

◆ SCIPintarrayFree()

SCIP_RETCODE SCIPintarrayFree ( SCIP_INTARRAY ** intarray)

frees a dynamic array of int values

Parameters
intarraypointer to the int array

Definition at line 4488 of file misc.c.

References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, SCIP_OKAY, and SCIPintarrayFree().

Referenced by SCIPfreeIntarray(), and SCIPintarrayFree().

◆ SCIPintarrayExtend()

SCIP_RETCODE SCIPintarrayExtend ( SCIP_INTARRAY * intarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int minidx,
int maxidx )

extends dynamic array to be able to store indices from minidx to maxidx

Parameters
intarraydynamic int array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
minidxsmallest index to allocate storage for
maxidxlargest index to allocate storage for

Definition at line 4502 of file misc.c.

References assert(), SCIP_IntArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_IntArray::firstidx, i, MAX, SCIP_IntArray::maxusedidx, MIN, SCIP_IntArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPintarrayExtend(), SCIP_IntArray::vals, and SCIP_IntArray::valssize.

Referenced by SCIPextendIntarray(), SCIPintarrayExtend(), and SCIPintarraySetVal().

◆ SCIPintarrayClear()

SCIP_RETCODE SCIPintarrayClear ( SCIP_INTARRAY * intarray)

◆ SCIPintarrayGetVal()

int SCIPintarrayGetVal ( SCIP_INTARRAY * intarray,
int idx )

gets value of entry in dynamic array

Parameters
intarraydynamic int array
idxarray index to get value for

Definition at line 4688 of file misc.c.

References assert(), SCIP_IntArray::firstidx, SCIP_IntArray::maxusedidx, NULL, SCIPintarrayGetVal(), SCIP_IntArray::vals, and SCIP_IntArray::valssize.

Referenced by SCIPgetIntarrayVal(), SCIPintarrayGetVal(), and SCIPintarrayIncVal().

◆ SCIPintarraySetVal()

SCIP_RETCODE SCIPintarraySetVal ( SCIP_INTARRAY * intarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int idx,
int val )

sets value of entry in dynamic array

Parameters
intarraydynamic int array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
idxarray index to set value for
valvalue to set array index to

Definition at line 4709 of file misc.c.

References assert(), SCIP_IntArray::firstidx, MAX, SCIP_IntArray::maxusedidx, MIN, SCIP_IntArray::minusedidx, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPintarrayExtend(), SCIPintarraySetVal(), SCIP_IntArray::vals, and SCIP_IntArray::valssize.

Referenced by SCIPintarrayIncVal(), SCIPintarraySetVal(), and SCIPsetIntarrayVal().

◆ SCIPintarrayIncVal()

SCIP_RETCODE SCIPintarrayIncVal ( SCIP_INTARRAY * intarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int idx,
int incval )

increases value of entry in dynamic array

Parameters
intarraydynamic int array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
idxarray index to increase value for
incvalvalue to increase array index

Definition at line 4777 of file misc.c.

References SCIP_Real, SCIPintarrayGetVal(), SCIPintarrayIncVal(), and SCIPintarraySetVal().

Referenced by SCIPincIntarrayVal(), and SCIPintarrayIncVal().

◆ SCIPintarrayGetMinIdx()

int SCIPintarrayGetMinIdx ( SCIP_INTARRAY * intarray)

returns the minimal index of all stored non-zero elements

Parameters
intarraydynamic int array

Definition at line 4789 of file misc.c.

References assert(), SCIP_IntArray::minusedidx, NULL, and SCIPintarrayGetMinIdx().

Referenced by SCIPgetIntarrayMinIdx(), and SCIPintarrayGetMinIdx().

◆ SCIPintarrayGetMaxIdx()

int SCIPintarrayGetMaxIdx ( SCIP_INTARRAY * intarray)

returns the maximal index of all stored non-zero elements

Parameters
intarraydynamic int array

Definition at line 4799 of file misc.c.

References assert(), SCIP_IntArray::maxusedidx, NULL, and SCIPintarrayGetMaxIdx().

Referenced by SCIPgetIntarrayMaxIdx(), and SCIPintarrayGetMaxIdx().

◆ SCIPboolarrayCreate()

SCIP_RETCODE SCIPboolarrayCreate ( SCIP_BOOLARRAY ** boolarray,
BMS_BLKMEM * blkmem )

creates a dynamic array of bool values

Parameters
boolarraypointer to store the bool array
blkmemblock memory

Definition at line 4810 of file misc.c.

References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPboolarrayCreate().

Referenced by SCIPboolarrayCopy(), SCIPboolarrayCreate(), SCIPcreateBoolarray(), SCIPsolCreate(), SCIPsolCreateExact(), SCIPsolCreateOriginal(), SCIPsolCreateOriginalExact(), SCIPsolCreatePartial(), SCIPsolCreateUnknown(), and SCIPsolMakeExact().

◆ SCIPboolarrayCopy()

SCIP_RETCODE SCIPboolarrayCopy ( SCIP_BOOLARRAY ** boolarray,
BMS_BLKMEM * blkmem,
SCIP_BOOLARRAY * sourceboolarray )

creates a copy of a dynamic array of bool values

Parameters
boolarraypointer to store the copied bool array
blkmemblock memory
sourceboolarraydynamic bool array to copy

Definition at line 4830 of file misc.c.

References assert(), BMSduplicateBlockMemoryArray, SCIP_BoolArray::firstidx, SCIP_BoolArray::maxusedidx, SCIP_BoolArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPboolarrayCopy(), SCIPboolarrayCreate(), SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.

Referenced by SCIPboolarrayCopy(), SCIPsolCopy(), and SCIPvalsExactCopy().

◆ SCIPboolarrayFree()

SCIP_RETCODE SCIPboolarrayFree ( SCIP_BOOLARRAY ** boolarray)

frees a dynamic array of bool values

Parameters
boolarraypointer to the bool array

Definition at line 4854 of file misc.c.

References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, SCIP_OKAY, and SCIPboolarrayFree().

Referenced by SCIPboolarrayFree(), SCIPfreeBoolarray(), SCIPsolFree(), SCIPsolMakeReal(), and valsExactFree().

◆ SCIPboolarrayExtend()

SCIP_RETCODE SCIPboolarrayExtend ( SCIP_BOOLARRAY * boolarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int minidx,
int maxidx )

extends dynamic array to be able to store indices from minidx to maxidx

Parameters
boolarraydynamic bool array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
minidxsmallest index to allocate storage for
maxidxlargest index to allocate storage for

Definition at line 4868 of file misc.c.

References assert(), SCIP_BoolArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, BMSmoveMemoryArray, calcGrowSize(), FALSE, SCIP_BoolArray::firstidx, i, MAX, SCIP_BoolArray::maxusedidx, MIN, SCIP_BoolArray::minusedidx, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPboolarrayExtend(), SCIPdebugMessage, SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.

Referenced by SCIPboolarrayExtend(), SCIPboolarraySetVal(), and SCIPextendBoolarray().

◆ SCIPboolarrayClear()

SCIP_RETCODE SCIPboolarrayClear ( SCIP_BOOLARRAY * boolarray)

◆ SCIPboolarrayGetVal()

SCIP_Bool SCIPboolarrayGetVal ( SCIP_BOOLARRAY * boolarray,
int idx )

◆ SCIPboolarraySetVal()

SCIP_RETCODE SCIPboolarraySetVal ( SCIP_BOOLARRAY * boolarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int idx,
SCIP_Bool val )

sets value of entry in dynamic array

Parameters
boolarraydynamic bool array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
idxarray index to set value for
valvalue to set array index to

Definition at line 5077 of file misc.c.

References assert(), FALSE, SCIP_BoolArray::firstidx, MAX, SCIP_BoolArray::maxusedidx, MIN, SCIP_BoolArray::minusedidx, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPboolarrayExtend(), SCIPboolarraySetVal(), SCIPdebugMessage, SCIP_BoolArray::vals, and SCIP_BoolArray::valssize.

Referenced by SCIPboolarraySetVal(), SCIPsetBoolarrayVal(), SCIPsolMarkPartial(), solIncArrayVal(), solSetArrayVal(), and solSetArrayValExact().

◆ SCIPboolarrayGetMinIdx()

int SCIPboolarrayGetMinIdx ( SCIP_BOOLARRAY * boolarray)

returns the minimal index of all stored non-zero elements

Parameters
boolarraydynamic bool array

Definition at line 5145 of file misc.c.

References assert(), SCIP_BoolArray::minusedidx, NULL, and SCIPboolarrayGetMinIdx().

Referenced by SCIPboolarrayGetMinIdx(), and SCIPgetBoolarrayMinIdx().

◆ SCIPboolarrayGetMaxIdx()

int SCIPboolarrayGetMaxIdx ( SCIP_BOOLARRAY * boolarray)

returns the maximal index of all stored non-zero elements

Parameters
boolarraydynamic bool array

Definition at line 5155 of file misc.c.

References assert(), SCIP_BoolArray::maxusedidx, NULL, and SCIPboolarrayGetMaxIdx().

Referenced by SCIPboolarrayGetMaxIdx(), and SCIPgetBoolarrayMaxIdx().

◆ SCIPptrarrayCreate()

SCIP_RETCODE SCIPptrarrayCreate ( SCIP_PTRARRAY ** ptrarray,
BMS_BLKMEM * blkmem )

creates a dynamic array of pointer values

Parameters
ptrarraypointer to store the ptr array
blkmemblock memory

Definition at line 5166 of file misc.c.

References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPptrarrayCreate().

Referenced by SCIPcreatePtrarray(), SCIPptrarrayCopy(), and SCIPptrarrayCreate().

◆ SCIPptrarrayCopy()

SCIP_RETCODE SCIPptrarrayCopy ( SCIP_PTRARRAY ** ptrarray,
BMS_BLKMEM * blkmem,
SCIP_PTRARRAY * sourceptrarray )

creates a copy of a dynamic array of pointer values

Parameters
ptrarraypointer to store the copied ptr array
blkmemblock memory
sourceptrarraydynamic ptr array to copy

Definition at line 5186 of file misc.c.

References assert(), BMSduplicateBlockMemoryArray, SCIP_PtrArray::firstidx, SCIP_PtrArray::maxusedidx, SCIP_PtrArray::minusedidx, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPptrarrayCopy(), SCIPptrarrayCreate(), SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.

Referenced by SCIPptrarrayCopy().

◆ SCIPptrarrayFree()

SCIP_RETCODE SCIPptrarrayFree ( SCIP_PTRARRAY ** ptrarray)

frees a dynamic array of pointer values

Parameters
ptrarraypointer to the ptr array

Definition at line 5209 of file misc.c.

References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArrayNull, NULL, SCIP_OKAY, and SCIPptrarrayFree().

Referenced by SCIPfreePtrarray(), and SCIPptrarrayFree().

◆ SCIPptrarrayExtend()

SCIP_RETCODE SCIPptrarrayExtend ( SCIP_PTRARRAY * ptrarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int minidx,
int maxidx )

extends dynamic array to be able to store indices from minidx to maxidx

Parameters
ptrarraydynamic ptr array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
minidxsmallest index to allocate storage for
maxidxlargest index to allocate storage for

Definition at line 5223 of file misc.c.

References assert(), SCIP_PtrArray::blkmem, BMSallocBlockMemoryArray, BMScopyMemoryArray, BMSfreeBlockMemoryArrayNull, calcGrowSize(), SCIP_PtrArray::firstidx, i, MAX, SCIP_PtrArray::maxusedidx, MIN, SCIP_PtrArray::minusedidx, NULL, SCIP_ALLOC, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPptrarrayExtend(), SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.

Referenced by SCIPextendPtrarray(), SCIPptrarrayExtend(), and SCIPptrarraySetVal().

◆ SCIPptrarrayClear()

SCIP_RETCODE SCIPptrarrayClear ( SCIP_PTRARRAY * ptrarray)

◆ SCIPptrarrayGetVal()

void * SCIPptrarrayGetVal ( SCIP_PTRARRAY * ptrarray,
int idx )

gets value of entry in dynamic array

Parameters
ptrarraydynamic ptr array
idxarray index to get value for

Definition at line 5409 of file misc.c.

References assert(), SCIP_PtrArray::firstidx, SCIP_PtrArray::maxusedidx, NULL, SCIPptrarrayGetVal(), SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.

Referenced by SCIPgetPtrarrayVal(), and SCIPptrarrayGetVal().

◆ SCIPptrarraySetVal()

SCIP_RETCODE SCIPptrarraySetVal ( SCIP_PTRARRAY * ptrarray,
int arraygrowinit,
SCIP_Real arraygrowfac,
int idx,
void * val )

sets value of entry in dynamic array

Parameters
ptrarraydynamic ptr array
arraygrowinitinitial size of array
arraygrowfacgrowing factor of array
idxarray index to set value for
valvalue to set array index to

Definition at line 5430 of file misc.c.

References assert(), SCIP_PtrArray::firstidx, MAX, SCIP_PtrArray::maxusedidx, MIN, SCIP_PtrArray::minusedidx, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPdebugMessage, SCIPptrarrayExtend(), SCIPptrarraySetVal(), SCIP_PtrArray::vals, and SCIP_PtrArray::valssize.

Referenced by SCIPptrarraySetVal(), and SCIPsetPtrarrayVal().

◆ SCIPptrarrayGetMinIdx()

int SCIPptrarrayGetMinIdx ( SCIP_PTRARRAY * ptrarray)

returns the minimal index of all stored non-zero elements

Parameters
ptrarraydynamic ptr array

Definition at line 5498 of file misc.c.

References assert(), SCIP_PtrArray::minusedidx, NULL, and SCIPptrarrayGetMinIdx().

Referenced by SCIPgetPtrarrayMinIdx(), and SCIPptrarrayGetMinIdx().

◆ SCIPptrarrayGetMaxIdx()

int SCIPptrarrayGetMaxIdx ( SCIP_PTRARRAY * ptrarray)

returns the maximal index of all stored non-zero elements

Parameters
ptrarraydynamic ptr array

Definition at line 5508 of file misc.c.

References assert(), SCIP_PtrArray::maxusedidx, NULL, and SCIPptrarrayGetMaxIdx().

Referenced by SCIPgetPtrarrayMaxIdx(), and SCIPptrarrayGetMaxIdx().

◆ SCIPdisjointsetCreate()

SCIP_RETCODE SCIPdisjointsetCreate ( SCIP_DISJOINTSET ** djset,
BMS_BLKMEM * blkmem,
int ncomponents )

creates a disjoint set (union find) structure djset for ncomponents many components (of size one)

Parameters
djsetdisjoint set (union find) data structure
blkmemblock memory
ncomponentsnumber of components

Definition at line 11207 of file misc.c.

References assert(), BMSallocBlockMemory, BMSallocBlockMemoryArray, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPdisjointsetClear(), and SCIPdisjointsetCreate().

Referenced by SCIPcliquetableComputeCliqueComponents(), SCIPcomputeComponentsSym(), SCIPcreateDisjointset(), and SCIPdisjointsetCreate().

◆ SCIPdisjointsetFree()

void SCIPdisjointsetFree ( SCIP_DISJOINTSET ** djset,
BMS_BLKMEM * blkmem )

frees the disjoint set (union find) data structure

Parameters
djsetpointer to disjoint set (union find) data structure
blkmemblock memory

Definition at line 11325 of file misc.c.

References assert(), BMSfreeBlockMemory, BMSfreeBlockMemoryArray, NULL, SCIP_DisjointSet::parents, SCIPdisjointsetFree(), SCIP_DisjointSet::size, and SCIP_DisjointSet::sizes.

Referenced by SCIPcliquetableComputeCliqueComponents(), SCIPcliquetableFree(), SCIPcomputeComponentsSym(), SCIPdisjointsetFree(), and SCIPfreeDisjointset().

◆ SCIPdigraphCreate()

SCIP_RETCODE SCIPdigraphCreate ( SCIP_DIGRAPH ** digraph,
BMS_BLKMEM * blkmem,
int nnodes )

SCIP digraph functions

internal digraph functions (see Directed Graph for public digraph methods) creates directed graph structure

creates directed graph structure

Parameters
digraphpointer to store the created directed graph
blkmemblock memory to store the data
nnodesnumber of nodes

Definition at line 7454 of file misc.c.

References assert(), BMSallocBlockMemory, BMSallocClearBlockMemoryArray, FALSE, nnodes, NULL, SCIP_ALLOC, SCIP_OKAY, and SCIPdigraphCreate().

Referenced by netMatDecDataCreateDiGraph(), SCIPcreateDigraph(), and SCIPdigraphCreate().

◆ SCIPdigraphCopy()

SCIP_RETCODE SCIPdigraphCopy ( SCIP_DIGRAPH ** targetdigraph,
SCIP_DIGRAPH * sourcedigraph,
BMS_BLKMEM * targetblkmem )

copies directed graph structure

Note
The data in nodedata is copied verbatim. This possibly has to be adapted by the user.
Parameters
targetdigraphpointer to store the copied directed graph
sourcedigraphsource directed graph
targetblkmemblock memory to store the target block memory, or NULL to use the same the same block memory as used for the sourcedigraph

Definition at line 7531 of file misc.c.

References SCIP_Digraph::arcdata, SCIP_Digraph::articulations, SCIP_Digraph::articulationscheck, assert(), SCIP_Digraph::blkmem, BMSallocBlockMemory, BMSallocClearBlockMemoryArray, BMSduplicateBlockMemoryArray, SCIP_Digraph::components, SCIP_Digraph::componentstarts, FALSE, i, SCIP_Digraph::narticulations, SCIP_Digraph::ncomponents, nnodes, SCIP_Digraph::nnodes, SCIP_Digraph::nodedata, SCIP_Digraph::nsuccessors, NULL, SCIP_ALLOC, SCIP_Bool, SCIP_OKAY, SCIPdigraphCopy(), SCIP_Digraph::successors, and TRUE.

Referenced by SCIPcopyDigraph(), and SCIPdigraphCopy().

◆ SCIPnegateReal()

SCIP_Real SCIPnegateReal ( SCIP_Real x)

negates a number

negation of a number that can be used to avoid that a negation is optimized away by a compiler

negates a number

Parameters
xvalue to negate

Definition at line 10473 of file misc.c.

References SCIP_Real, SCIPnegateReal(), and x.

Referenced by negate(), SCIPintervalEntropy(), and SCIPnegateReal().

◆ SCIPrandomCreate()

SCIP_RETCODE SCIPrandomCreate ( SCIP_RANDNUMGEN ** randnumgen,
BMS_BLKMEM * blkmem,
unsigned int initialseed )

internal random number generator methods

see Random Numbers for public random number generator methods creates and initializes a random number generator

creates and initializes a random number generator

Parameters
randnumgenrandom number generator
blkmemblock memory
initialseedinitial random seed

Definition at line 10193 of file misc.c.

References assert(), BMSallocBlockMemory, NULL, SCIP_ALLOC, SCIP_OKAY, SCIPrandomCreate(), and SCIPrandomSetSeed().

Referenced by SCIPbanditCreate(), SCIPcreateRandom(), SCIPdivesetCreate(), SCIPiisCreate(), SCIPrandomCreate(), SCIPreoptCreate(), and SCIPsepastoreCreate().

◆ SCIPrandomFree()

void SCIPrandomFree ( SCIP_RANDNUMGEN ** randnumgen,
BMS_BLKMEM * blkmem )

frees a random number generator

Parameters
randnumgenrandom number generator
blkmemblock memory

Definition at line 10209 of file misc.c.

References assert(), BMSfreeBlockMemory, NULL, and SCIPrandomFree().

Referenced by divesetFree(), SCIPbanditFree(), SCIPfreeRandom(), SCIPiisFree(), SCIPrandomFree(), SCIPreoptFree(), and SCIPsepastoreFree().

◆ SCIPrandomSetSeed()

void SCIPrandomSetSeed ( SCIP_RANDNUMGEN * randnumgen,
unsigned int initseed )

initializes a random number generator with a given start seed

Parameters
randnumgenrandom number generator
initseedinitial random seed

Definition at line 10139 of file misc.c.

References assert(), SCIP_RandNumGen::cst_seed, DEFAULT_CST, DEFAULT_MWC, DEFAULT_SEED, DEFAULT_XOR, MAX, SCIP_RandNumGen::mwc_seed, NULL, SCIPhashTwo, SCIPrandomSetSeed(), SCIP_RandNumGen::seed, and SCIP_RandNumGen::xor_seed.

Referenced by SCIPbanditReset(), SCIPdivesetReset(), SCIPrandomCreate(), SCIPrandomSetSeed(), and SCIPsetRandomSeed().