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

Detailed Description

internal methods for relaxators

Author
Tobias Achterberg

Definition in file relax.h.

#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_primal.h"
#include "scip/type_relax.h"
#include "scip/type_result.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_sol.h"
#include "scip/type_stat.h"
#include "scip/type_tree.h"
#include "scip/type_var.h"
#include "scip/pub_relax.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPrelaxCopyInclude (SCIP_RELAX *relax, SCIP_SET *set)
SCIP_RETCODE SCIPrelaxCreate (SCIP_RELAX **relax, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, const char *name, const char *desc, int priority, int freq, SCIP_DECL_RELAXCOPY((*relaxcopy)), SCIP_DECL_RELAXFREE((*relaxfree)), SCIP_DECL_RELAXINIT((*relaxinit)), SCIP_DECL_RELAXEXIT((*relaxexit)), SCIP_DECL_RELAXINITSOL((*relaxinitsol)), SCIP_DECL_RELAXEXITSOL((*relaxexitsol)), SCIP_DECL_RELAXEXEC((*relaxexec)), SCIP_RELAXDATA *relaxdata)
SCIP_RETCODE SCIPrelaxFree (SCIP_RELAX **relax, SCIP_SET *set)
SCIP_RETCODE SCIPrelaxInit (SCIP_RELAX *relax, SCIP_SET *set)
SCIP_RETCODE SCIPrelaxExit (SCIP_RELAX *relax, SCIP_SET *set)
SCIP_RETCODE SCIPrelaxInitsol (SCIP_RELAX *relax, SCIP_SET *set)
SCIP_RETCODE SCIPrelaxExitsol (SCIP_RELAX *relax, SCIP_SET *set)
SCIP_RETCODE SCIPrelaxExec (SCIP_RELAX *relax, SCIP_SET *set, SCIP_TREE *tree, SCIP_STAT *stat, int depth, SCIP_Real *lowerbound, SCIP_RESULT *result)
void SCIPrelaxSetPriority (SCIP_RELAX *relax, SCIP_SET *set, int priority)
void SCIPrelaxSetCopy (SCIP_RELAX *relax,)
void SCIPrelaxSetFree (SCIP_RELAX *relax,)
void SCIPrelaxSetInit (SCIP_RELAX *relax,)
void SCIPrelaxSetExit (SCIP_RELAX *relax,)
void SCIPrelaxSetInitsol (SCIP_RELAX *relax,)
void SCIPrelaxSetExitsol (SCIP_RELAX *relax,)
SCIP_Bool SCIPrelaxIsSolved (SCIP_RELAX *relax, SCIP_STAT *stat)
void SCIPrelaxEnableOrDisableClocks (SCIP_RELAX *relax, SCIP_Bool enable)
SCIP_RETCODE SCIPrelaxationCreate (SCIP_RELAXATION **relaxation, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree)
SCIP_RETCODE SCIPrelaxationFree (SCIP_RELAXATION **relaxation)
void SCIPrelaxationSetSolZero (SCIP_RELAXATION *relaxation, SCIP_Bool iszero)
SCIP_Bool SCIPrelaxationIsSolZero (SCIP_RELAXATION *relaxation)
void SCIPrelaxationSetSolValid (SCIP_RELAXATION *relaxation, SCIP_Bool isvalid, SCIP_Bool includeslp)
SCIP_Bool SCIPrelaxationIsSolValid (SCIP_RELAXATION *relaxation)
SCIP_Bool SCIPrelaxationIsLpIncludedForSol (SCIP_RELAXATION *relaxation)
void SCIPrelaxationSetSolObj (SCIP_RELAXATION *relaxation, SCIP_Real obj)
SCIP_Real SCIPrelaxationGetSolObj (SCIP_RELAXATION *relaxation)
void SCIPrelaxationSolObjAdd (SCIP_RELAXATION *relaxation, SCIP_Real val)
void SCIPrelaxationUpdateVarObj (SCIP_RELAXATION *relaxation, SCIP_SET *set, SCIP_VAR *var, SCIP_Real oldobj, SCIP_Real newobj)
void SCIPrelaxationSetSolRelax (SCIP_RELAXATION *relaxation, SCIP_RELAX *relax)
SCIP_RELAXSCIPrelaxationGetSolRelax (SCIP_RELAXATION *relaxation)

Function Documentation

◆ SCIPrelaxCopyInclude()

SCIP_RETCODE SCIPrelaxCopyInclude ( SCIP_RELAX * relax,
SCIP_SET * set )

copies the given relaxator to a new scip

copies the given relaxation handler to a new scip

Parameters
relaxrelaxation handler
setSCIP_SET of SCIP to copy to

Definition at line 83 of file relax.c.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPrelaxGetName(), and SCIPsetDebugMsg.

Referenced by SCIPsetCopyPlugins().

◆ SCIPrelaxCreate()

SCIP_RETCODE SCIPrelaxCreate ( SCIP_RELAX ** relax,
SCIP_SET * set,
SCIP_MESSAGEHDLR * messagehdlr,
BMS_BLKMEM * blkmem,
const char * name,
const char * desc,
int priority,
int freq,
SCIP_DECL_RELAXCOPY((*relaxcopy)) ,
SCIP_DECL_RELAXFREE((*relaxfree)) ,
SCIP_DECL_RELAXINIT((*relaxinit)) ,
SCIP_DECL_RELAXEXIT((*relaxexit)) ,
SCIP_DECL_RELAXINITSOL((*relaxinitsol)) ,
SCIP_DECL_RELAXEXITSOL((*relaxexitsol)) ,
SCIP_DECL_RELAXEXEC((*relaxexec)) ,
SCIP_RELAXDATA * relaxdata )

creates a relaxator

creates a relaxation handler

Parameters
relaxpointer to relaxation handler data structure
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory for parameter settings
namename of relaxation handler
descdescription of relaxation handler
prioritypriority of the relaxation handler (negative: after LP, non-negative: before LP)
freqfrequency for calling relaxation handler
relaxdatarelaxation handler data

Definition at line 172 of file relax.c.

References assert(), doRelaxCreate(), NULL, SCIP_CALL_FINALLY, SCIP_DECL_RELAXCOPY, SCIP_DECL_RELAXEXEC, SCIP_DECL_RELAXEXIT, SCIP_DECL_RELAXFREE, SCIP_DECL_RELAXINIT, SCIP_OKAY, and SCIPrelaxFree().

Referenced by SCIPincludeRelax(), and SCIPincludeRelaxBasic().

◆ SCIPrelaxFree()

SCIP_RETCODE SCIPrelaxFree ( SCIP_RELAX ** relax,
SCIP_SET * set )

calls destructor and frees memory of relaxator

calls destructor and frees memory of relaxation handler

Parameters
relaxpointer to relaxation handler data structure
setglobal SCIP settings

Definition at line 204 of file relax.c.

References assert(), BMSfreeMemory, BMSfreeMemoryArrayNull, NULL, SCIP_CALL, SCIP_OKAY, and SCIPclockFree().

Referenced by SCIPrelaxCreate().

◆ SCIPrelaxInit()

◆ SCIPrelaxExit()

SCIP_RETCODE SCIPrelaxExit ( SCIP_RELAX * relax,
SCIP_SET * set )

calls exit method of relaxator

calls exit method of relaxation handler

Parameters
relaxrelaxation handler
setglobal SCIP settings

Definition at line 275 of file relax.c.

References assert(), FALSE, SCIP_Relax::initialized, SCIP_Relax::name, NULL, SCIP_CALL, SCIP_INVALIDCALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), SCIPerrorMessage, and SCIP_Relax::setuptime.

◆ SCIPrelaxInitsol()

SCIP_RETCODE SCIPrelaxInitsol ( SCIP_RELAX * relax,
SCIP_SET * set )

informs relaxator that the branch and bound process is being started

informs relaxation handler that the branch and bound process is being started

Parameters
relaxrelaxation handler
setglobal SCIP settings

Definition at line 305 of file relax.c.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIP_Relax::setuptime.

◆ SCIPrelaxExitsol()

SCIP_RETCODE SCIPrelaxExitsol ( SCIP_RELAX * relax,
SCIP_SET * set )

informs relaxator that the branch and bound process data is being freed

informs relaxation handler that the branch and bound process data is being freed

Parameters
relaxrelaxation handler
setglobal SCIP settings

Definition at line 329 of file relax.c.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPclockStart(), SCIPclockStop(), and SCIP_Relax::setuptime.

◆ SCIPrelaxExec()

SCIP_RETCODE SCIPrelaxExec ( SCIP_RELAX * relax,
SCIP_SET * set,
SCIP_TREE * tree,
SCIP_STAT * stat,
int depth,
SCIP_Real * lowerbound,
SCIP_RESULT * result )

calls execution method of relaxator

calls execution method of relaxation handler

Parameters
relaxrelaxation handler
setglobal SCIP settings
treebranch and bound tree
statdynamic problem statistics
depthdepth of current node
lowerboundpointer to lower bound computed by the relaxation handler
resultpointer to store the result of the callback method

Definition at line 353 of file relax.c.

References assert(), depth, SCIP_Relax::freq, SCIP_Relax::imprtime, SCIP_Relax::lastsolvednode, SCIP_Stat::nactiveconss, SCIP_Relax::naddedconss, SCIP_Relax::name, SCIP_Relax::ncalls, SCIP_Relax::ncutoffs, SCIP_Relax::nimprbounds, SCIP_Relax::nreduceddom, SCIP_Relax::nseparated, SCIP_Stat::ntotalnodes, NULL, SCIP_Relax::relaxclock, SCIP_Stat::relaxcount, result, SCIP_CALL, SCIP_CONSADDED, SCIP_CUTOFF, SCIP_DIDNOTRUN, SCIP_INVALIDRESULT, SCIP_OKAY, SCIP_Real, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIP_SUCCESS, SCIP_SUSPENDED, SCIPclockGetTime(), SCIPclockStart(), SCIPclockStop(), SCIPerrorMessage, SCIPgetNCuts(), SCIPinProbing(), SCIPnodeGetLowerbound(), SCIPrelaxMarkUnsolved(), SCIPsetDebugMsg, SCIPsetInfinity(), SCIPsetIsInfinity(), SCIPsetIsRelGT(), and SCIPtreeGetCurrentNode().

Referenced by SCIPsolveProbingRelax(), and solveNodeRelax().

◆ SCIPrelaxSetPriority()

void SCIPrelaxSetPriority ( SCIP_RELAX * relax,
SCIP_SET * set,
int priority )

sets priority of relaxator

sets priority of relaxation handler

Parameters
relaxrelaxation handler
setglobal SCIP settings
prioritynew priority of the relaxation handler

Definition at line 572 of file relax.c.

References assert(), FALSE, NULL, and SCIP_Relax::priority.

Referenced by SCIPsetRelaxPriority().

◆ SCIPrelaxSetCopy()

void SCIPrelaxSetCopy ( SCIP_RELAX * relax)

set copy callback of relaxation handler

set copy method of relaxation handler

Parameters
relaxrelaxation handler copy method of relaxation handler

Definition at line 476 of file relax.c.

References assert(), NULL, and SCIP_DECL_RELAXCOPY.

Referenced by SCIPsetRelaxCopy().

◆ SCIPrelaxSetFree()

void SCIPrelaxSetFree ( SCIP_RELAX * relax)

set destructor callback of relaxation handler

set destructor of relaxation handler

Parameters
relaxrelaxation handler destructor of relaxation handler

Definition at line 487 of file relax.c.

References assert(), NULL, and SCIP_DECL_RELAXFREE.

Referenced by SCIPsetRelaxFree().

◆ SCIPrelaxSetInit()

void SCIPrelaxSetInit ( SCIP_RELAX * relax)

set initialization callback of relaxation handler

set initialization method of relaxation handler

Parameters
relaxrelaxation handler initialize relaxation handler

Definition at line 498 of file relax.c.

References assert(), NULL, and SCIP_DECL_RELAXINIT.

Referenced by SCIPsetRelaxInit().

◆ SCIPrelaxSetExit()

void SCIPrelaxSetExit ( SCIP_RELAX * relax)

set deinitialization callback of relaxation handler

set deinitialization method of relaxation handler

Parameters
relaxrelaxation handler deinitialize relaxation handler

Definition at line 509 of file relax.c.

References assert(), NULL, and SCIP_DECL_RELAXEXIT.

Referenced by SCIPsetRelaxExit().

◆ SCIPrelaxSetInitsol()

void SCIPrelaxSetInitsol ( SCIP_RELAX * relax)

set solving process initialization callback of relaxation handler

set solving process initialization method of relaxation handler

Parameters
relaxrelaxation handler solving process initialization method of relaxation handler

Definition at line 520 of file relax.c.

References assert(), and NULL.

Referenced by SCIPsetRelaxInitsol().

◆ SCIPrelaxSetExitsol()

void SCIPrelaxSetExitsol ( SCIP_RELAX * relax)

set solving process deinitialization callback of relaxation handler

set solving process deinitialization method of relaxation handler

Parameters
relaxrelaxation handler solving process deinitialization relaxation handler

Definition at line 531 of file relax.c.

References assert(), and NULL.

Referenced by SCIPsetRelaxExitsol().

◆ SCIPrelaxIsSolved()

SCIP_Bool SCIPrelaxIsSolved ( SCIP_RELAX * relax,
SCIP_STAT * stat )

returns whether the relaxation was completely solved at the current node

Parameters
relaxrelaxation handler
statdynamic problem statistics

Definition at line 708 of file relax.c.

References assert(), SCIP_Relax::lastsolvednode, SCIP_Stat::ntotalnodes, NULL, and SCIP_Bool.

Referenced by updateLoopStatus().

◆ SCIPrelaxEnableOrDisableClocks()

void SCIPrelaxEnableOrDisableClocks ( SCIP_RELAX * relax,
SCIP_Bool enable )

enables or disables all clocks of relax, depending on the value of the flag

Parameters
relaxthe relaxation handler for which all clocks should be enabled or disabled
enableshould the clocks of the relaxation handler be enabled?

Definition at line 606 of file relax.c.

References assert(), NULL, SCIP_Relax::relaxclock, SCIP_Bool, SCIPclockEnableOrDisable(), and SCIP_Relax::setuptime.

◆ SCIPrelaxationCreate()

SCIP_RETCODE SCIPrelaxationCreate ( SCIP_RELAXATION ** relaxation,
BMS_BLKMEM * blkmem,
SCIP_SET * set,
SCIP_STAT * stat,
SCIP_PRIMAL * primal,
SCIP_TREE * tree )

creates global relaxation data

Parameters
relaxationglobal relaxation data
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
primalprimal data
treebranch and bound tree

Definition at line 734 of file relax.c.

References assert(), BMSallocMemory, FALSE, NULL, SCIP_ALLOC, SCIP_OKAY, and TRUE.

Referenced by prepareReoptimization(), and SCIPtransformProb().

◆ SCIPrelaxationFree()

SCIP_RETCODE SCIPrelaxationFree ( SCIP_RELAXATION ** relaxation)

frees global relaxation data

Parameters
relaxationglobal relaxation data

Definition at line 762 of file relax.c.

References assert(), BMSfreeMemory, NULL, and SCIP_OKAY.

Referenced by freeReoptSolve(), freeTransform(), and freeTransforming().

◆ SCIPrelaxationSetSolZero()

void SCIPrelaxationSetSolZero ( SCIP_RELAXATION * relaxation,
SCIP_Bool iszero )

sets the relaxsolzero flag in the relaxation data to the given value

Parameters
relaxationglobal relaxation data
iszeroare all values of the relaxation solution set to zero?

Definition at line 774 of file relax.c.

References assert(), NULL, SCIP_Relaxation::relaxsolzero, and SCIP_Bool.

Referenced by SCIPclearRelaxSolVals(), SCIPsetRelaxSolVal(), SCIPsetRelaxSolVals(), and SCIPsetRelaxSolValsSol().

◆ SCIPrelaxationIsSolZero()

SCIP_Bool SCIPrelaxationIsSolZero ( SCIP_RELAXATION * relaxation)

returns whether the global relaxation solution is cleared and all values are set to zero

Parameters
relaxationglobal relaxation data

Definition at line 785 of file relax.c.

References assert(), NULL, SCIP_Relaxation::relaxsolzero, and SCIP_Bool.

Referenced by SCIPclearRelaxSolVals().

◆ SCIPrelaxationSetSolValid()

void SCIPrelaxationSetSolValid ( SCIP_RELAXATION * relaxation,
SCIP_Bool isvalid,
SCIP_Bool includeslp )

sets the relaxsolvalid and includeslp flags in the relaxation data to the given values

Parameters
relaxationglobal relaxation data
isvalidis the stored solution valid?
includeslpdoes the relaxator contain all cuts in the LP?

Definition at line 795 of file relax.c.

References assert(), NULL, SCIP_Relaxation::relaxsolincludeslp, SCIP_Relaxation::relaxsolvalid, and SCIP_Bool.

Referenced by markRelaxsUnsolved(), SCIPmarkRelaxSolInvalid(), SCIPmarkRelaxSolValid(), SCIPsetRelaxSolVal(), SCIPsetRelaxSolVals(), SCIPsetRelaxSolValsSol(), SCIPtreeRestoreRelaxSol(), and solveNode().

◆ SCIPrelaxationIsSolValid()

SCIP_Bool SCIPrelaxationIsSolValid ( SCIP_RELAXATION * relaxation)

◆ SCIPrelaxationIsLpIncludedForSol()

SCIP_Bool SCIPrelaxationIsLpIncludedForSol ( SCIP_RELAXATION * relaxation)

returns whether the global relaxation solution was computed by a relaxator which included all LP cuts

Parameters
relaxationglobal relaxation data

Definition at line 818 of file relax.c.

References assert(), NULL, SCIP_Relaxation::relaxsolincludeslp, and SCIP_Bool.

Referenced by addCurrentSolution(), enforceConstraints(), SCIPsolveCIP(), SCIPtreeStoreRelaxSol(), and solveNode().

◆ SCIPrelaxationSetSolObj()

void SCIPrelaxationSetSolObj ( SCIP_RELAXATION * relaxation,
SCIP_Real obj )

sets the objective value of the global relaxation solution

Parameters
relaxationglobal relaxation data
objobjective value

Definition at line 828 of file relax.c.

References assert(), NULL, obj, SCIP_Relaxation::relaxsolobjval, and SCIP_Real.

Referenced by SCIPclearRelaxSolVals(), and SCIPsetRelaxSolValsSol().

◆ SCIPrelaxationGetSolObj()

SCIP_Real SCIPrelaxationGetSolObj ( SCIP_RELAXATION * relaxation)

returns the objective value of the global relaxation solution w.r.t. the transformed problem

Parameters
relaxationglobal relaxation data

Definition at line 839 of file relax.c.

References assert(), NULL, SCIP_Relaxation::relaxsolobjval, and SCIP_Real.

Referenced by addCurrentSolution(), enforceConstraints(), SCIPgetRelaxSolObj(), SCIPsolLinkRelaxSol(), SCIPsolveCIP(), and solveNode().

◆ SCIPrelaxationSolObjAdd()

void SCIPrelaxationSolObjAdd ( SCIP_RELAXATION * relaxation,
SCIP_Real val )

adds the given value to the global relaxation solution's objective value

Parameters
relaxationglobal relaxation data
valvalue to add to the objective value

Definition at line 849 of file relax.c.

References assert(), NULL, SCIP_Relaxation::relaxsolobjval, and SCIP_Real.

Referenced by SCIPvarSetRelaxSol().

◆ SCIPrelaxationUpdateVarObj()

void SCIPrelaxationUpdateVarObj ( SCIP_RELAXATION * relaxation,
SCIP_SET * set,
SCIP_VAR * var,
SCIP_Real oldobj,
SCIP_Real newobj )

updates objective value of current relaxation solution after change of objective coefficient

Parameters
relaxationglobal relaxation data
setglobal SCIP settings
varvariable with changed objective coefficient
oldobjold objective coefficient
newobjnew objective coefficient

Definition at line 860 of file relax.c.

References assert(), newobj, NULL, oldobj, SCIP_Relaxation::relaxsolobjval, SCIP_Real, SCIP_VARSTATUS_COLUMN, SCIPvarGetRelaxSol(), SCIPvarGetStatus(), and var.

◆ SCIPrelaxationSetSolRelax()

void SCIPrelaxationSetSolRelax ( SCIP_RELAXATION * relaxation,
SCIP_RELAX * relax )

store the most recent relaxation handler relax responsible for the solution

Parameters
relaxationglobal relaxation data
relaxresponsible relaxation handler, or NULL

Definition at line 880 of file relax.c.

References assert(), SCIP_Relaxation::lastsolrelax, and NULL.

Referenced by SCIPclearRelaxSolVals(), SCIPmarkRelaxSolValid(), SCIPsetRelaxSolVal(), SCIPsetRelaxSolVals(), and SCIPsetRelaxSolValsSol().

◆ SCIPrelaxationGetSolRelax()

SCIP_RELAX * SCIPrelaxationGetSolRelax ( SCIP_RELAXATION * relaxation)

returns the most recent relaxation handler responsible for the solution, or NULL if unspecified

Parameters
relaxationglobal relaxation data

Definition at line 891 of file relax.c.

References assert(), SCIP_Relaxation::lastsolrelax, and NULL.

Referenced by SCIPsolCreateRelaxSol().