GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
gcgvarhistory.h File Reference

Detailed Description

methods for managing variable history

Author
Til Mohr

Definition in file gcgvarhistory.h.

#include "scip/scip.h"
#include "gcg/type_gcgvarhistory.h"

Go to the source code of this file.

Functions

SCIP_RETCODE GCGvarhistoryGetVar (GCG_VARHISTORY *pointer, SCIP_VAR **var)
SCIP_Bool GCGvarhistoryHasNext (GCG_VARHISTORY *pointer)
SCIP_RETCODE GCGvarhistoryNext (SCIP *scip, GCG_VARHISTORY **pointer)
SCIP_RETCODE GCGvarhistoryJumpToLatest (SCIP *scip, GCG_VARHISTORY *pointer)
SCIP_RETCODE GCGvarhistoryJumpAndRetrieveVars (SCIP *scip, GCG_VARHISTORY *pointer, SCIP_VAR ***vars, int *nvars)
SCIP_RETCODE GCGvarhistoryCreate (SCIP *scip, GCG_VARHISTORY **pointer)
SCIP_RETCODE GCGvarhistoryCopyReference (SCIP *scip, GCG_VARHISTORY **pointer, GCG_VARHISTORY *source)
SCIP_RETCODE GCGvarhistoryFreeReference (SCIP *scip, GCG_VARHISTORY **pointer)
SCIP_RETCODE GCGvarhistoryAddVar (SCIP *scip, GCG_VARHISTORY *pointer, SCIP_VAR *var)
SCIP_RETCODE GCGvarhistoryCaptureBuffer (GCG_VARHISTORYBUFFER *buffer)
SCIP_RETCODE GCGvarhistoryReleaseBuffer (SCIP *scip, GCG_VARHISTORYBUFFER **buffer)

Function Documentation

◆ GCGvarhistoryGetVar()

SCIP_RETCODE GCGvarhistoryGetVar ( GCG_VARHISTORY * pointer,
SCIP_VAR ** var )

get the variable behinde the pointer

Parameters
pointerpointer to the history
varpointer to store the variable

Definition at line 72 of file gcgvarhistory.c.

References assert(), GCG_VarHistory::buffer, GCG_VARHISTORYBUFFER_SIZE, GCGvarhistoryGetVar(), GCG_VarHistoryBuffer::next, GCG_VarHistoryBuffer::nvars, GCG_VarHistory::pos, var, and GCG_VarHistoryBuffer::vars.

Referenced by addMissedVariables(), forwardUpdateSeenHistory(), and GCGvarhistoryGetVar().

◆ GCGvarhistoryHasNext()

SCIP_Bool GCGvarhistoryHasNext ( GCG_VARHISTORY * pointer)

check if there is a next history event

Parameters
pointerpointer to the history

Definition at line 96 of file gcgvarhistory.c.

References assert(), GCG_VarHistory::buffer, GCG_VARHISTORYBUFFER_SIZE, GCGvarhistoryHasNext(), GCG_VarHistoryBuffer::next, GCG_VarHistoryBuffer::nvars, and GCG_VarHistory::pos.

Referenced by addMissedVariables(), forwardUpdateSeenHistory(), and GCGvarhistoryHasNext().

◆ GCGvarhistoryNext()

SCIP_RETCODE GCGvarhistoryNext ( SCIP * scip,
GCG_VARHISTORY ** pointer )

get the next history event

Parameters
scipSCIP data structure
pointerpointer to the history

Definition at line 125 of file gcgvarhistory.c.

References assert(), GCG_VARHISTORYBUFFER_SIZE, GCGvarhistoryCaptureBuffer(), GCGvarhistoryNext(), GCGvarhistoryReleaseBuffer(), GCG_VarHistoryBuffer::next, SCIP_CALL(), and SCIPdebugMessage().

Referenced by addMissedVariables(), forwardUpdateSeenHistory(), and GCGvarhistoryNext().

◆ GCGvarhistoryJumpToLatest()

◆ GCGvarhistoryJumpAndRetrieveVars()

SCIP_RETCODE GCGvarhistoryJumpAndRetrieveVars ( SCIP * scip,
GCG_VARHISTORY * pointer,
SCIP_VAR *** vars,
int * nvars )

jump to the latest history event and retrieve all new variables

Parameters
scipSCIP data structure
pointerpointer to the history
varspointer to store the variables
nvarspointer to store the number of variables

Definition at line 213 of file gcgvarhistory.c.

References assert(), GCG_VarHistory::buffer, GCG_VARHISTORYBUFFER_SIZE, GCGvarhistoryCaptureBuffer(), GCGvarhistoryJumpAndRetrieveVars(), GCGvarhistoryReleaseBuffer(), i, GCG_VarHistoryBuffer::next, GCG_VarHistoryBuffer::nvars, nvars, GCG_VarHistory::pos, SCIP_CALL(), GCG_VarHistoryBuffer::vars, and vars.

Referenced by GCGvarhistoryJumpAndRetrieveVars().

◆ GCGvarhistoryCreate()

SCIP_RETCODE GCGvarhistoryCreate ( SCIP * scip,
GCG_VARHISTORY ** pointer )

create a new history pointer to an empty existing buffer and captures it

Parameters
scipSCIP data structure
pointerpointer to the history

Definition at line 314 of file gcgvarhistory.c.

References assert(), GCGvarhistoryCreate(), GCG_VarHistoryBuffer::next, GCG_VarHistoryBuffer::nuses, GCG_VarHistoryBuffer::nvars, and SCIP_CALL().

Referenced by GCGvarhistoryCreate(), and SCIP_DECL_PRICERINITSOL().

◆ GCGvarhistoryCopyReference()

SCIP_RETCODE GCGvarhistoryCopyReference ( SCIP * scip,
GCG_VARHISTORY ** pointer,
GCG_VARHISTORY * source )

copy a pointer by creating a new one that points to the same buffer at the same position and capture it

Parameters
scipSCIP data structure
pointerpointer to the history
sourcesource pointer

Definition at line 337 of file gcgvarhistory.c.

References assert(), GCG_VarHistory::buffer, GCG_VARHISTORYBUFFER_SIZE, GCGvarhistoryCaptureBuffer(), GCGvarhistoryCopyReference(), GCG_VarHistoryBuffer::next, GCG_VarHistoryBuffer::nvars, GCG_VarHistory::pos, and SCIP_CALL().

Referenced by GCGcreateConsMasterbranch(), GCGmastersepacutSetVarHistory(), and GCGvarhistoryCopyReference().

◆ GCGvarhistoryFreeReference()

SCIP_RETCODE GCGvarhistoryFreeReference ( SCIP * scip,
GCG_VARHISTORY ** pointer )

release the reference to the buffer and free the history pointer

Parameters
scipSCIP data structure
pointerpointer to the history

Definition at line 358 of file gcgvarhistory.c.

References assert(), GCG_VARHISTORYBUFFER_SIZE, GCGvarhistoryFreeReference(), GCGvarhistoryReleaseBuffer(), and SCIP_CALL().

Referenced by freeMastersepacut(), GCGvarhistoryFreeReference(), SCIP_DECL_CONSDELETE(), and SCIP_DECL_PRICEREXITSOL().

◆ GCGvarhistoryAddVar()

SCIP_RETCODE GCGvarhistoryAddVar ( SCIP * scip,
GCG_VARHISTORY * pointer,
SCIP_VAR * var )

◆ GCGvarhistoryCaptureBuffer()

◆ GCGvarhistoryReleaseBuffer()

SCIP_RETCODE GCGvarhistoryReleaseBuffer ( SCIP * scip,
GCG_VARHISTORYBUFFER ** buffer )