Scippy

SCIP

Solving Constraint Integer Programs

sol.h File Reference

Detailed Description

internal methods for storing primal CIP solutions

Author
Tobias Achterberg

Definition in file sol.h.

#include <stdio.h>
#include "scip/def.h"
#include "blockmemshell/memory.h"
#include "scip/type_retcode.h"
#include "scip/type_set.h"
#include "scip/type_stat.h"
#include "scip/type_lp.h"
#include "scip/type_nlp.h"
#include "scip/type_var.h"
#include "scip/type_prob.h"
#include "scip/type_sol.h"
#include "scip/type_primal.h"
#include "scip/type_tree.h"
#include "scip/type_heur.h"
#include "scip/pub_sol.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPsolCreate (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCreateOriginal (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCopy (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_SOL *sourcesol)
 
SCIP_RETCODE SCIPsolTransform (SCIP_SOL *sol, SCIP_SOL **transsol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PRIMAL *primal)
 
SCIP_RETCODE SCIPsolAdjustImplicitSolVals (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool uselprows)
 
SCIP_RETCODE SCIPsolCreateLPSol (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCreateNLPSol (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_NLP *nlp, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCreateRelaxSol (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_RELAXATION *relaxation, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCreatePseudoSol (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCreateCurrentSol (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_LP *lp, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolCreateUnknown (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_HEUR *heur)
 
SCIP_RETCODE SCIPsolFree (SCIP_SOL **sol, BMS_BLKMEM *blkmem, SCIP_PRIMAL *primal)
 
SCIP_RETCODE SCIPsolLinkLPSol (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
 
SCIP_RETCODE SCIPsolLinkNLPSol (SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_NLP *nlp)
 
SCIP_RETCODE SCIPsolLinkRelaxSol (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_RELAXATION *relaxation)
 
SCIP_RETCODE SCIPsolLinkPseudoSol (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
 
SCIP_RETCODE SCIPsolLinkCurrentSol (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_LP *lp)
 
SCIP_RETCODE SCIPsolClear (SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree)
 
SCIP_RETCODE SCIPsolSetUnknown (SCIP_SOL *sol, SCIP_STAT *stat, SCIP_TREE *tree)
 
SCIP_RETCODE SCIPsolUnlink (SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *prob)
 
SCIP_RETCODE SCIPsolSetVal (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real val)
 
SCIP_RETCODE SCIPsolIncVal (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_TREE *tree, SCIP_VAR *var, SCIP_Real incval)
 
SCIP_Real SCIPsolGetVal (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
 
SCIP_Real SCIPsolGetRayVal (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_VAR *var)
 
SCIP_Real SCIPsolGetObj (SCIP_SOL *sol, SCIP_SET *set, SCIP_PROB *transprob, SCIP_PROB *origprob)
 
void SCIPsolUpdateVarObj (SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real oldobj, SCIP_Real newobj)
 
SCIP_RETCODE SCIPsolCheck (SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Bool printreason, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *feasible)
 
SCIP_RETCODE SCIPsolRound (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_TREE *tree, SCIP_Bool *success)
 
void SCIPsolUpdateVarsum (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_Real weight)
 
SCIP_RETCODE SCIPsolRetransform (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob, SCIP_Bool *hasinfval)
 
void SCIPsolRecomputeObj (SCIP_SOL *sol, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob)
 
SCIP_Bool SCIPsolsAreEqual (SCIP_SOL *sol1, SCIP_SOL *sol2, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *origprob, SCIP_PROB *transprob)
 
SCIP_RETCODE SCIPsolPrint (SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PROB *transprob, FILE *file, SCIP_Bool printzeros)
 
SCIP_RETCODE SCIPsolPrintRay (SCIP_SOL *sol, SCIP_SET *set, SCIP_MESSAGEHDLR *messagehdlr, SCIP_STAT *stat, SCIP_PROB *prob, SCIP_PROB *transprob, FILE *file, SCIP_Bool printzeros)
 
void SCIPsolOrigAddObjval (SCIP_SOL *sol, SCIP_Real addval)
 
int SCIPsolGetPrimalIndex (SCIP_SOL *sol)
 
void SCIPsolSetPrimalIndex (SCIP_SOL *sol, int primalindex)
 

Function Documentation

SCIP_RETCODE SCIPsolCreate ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to zero

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
primalprimal data
treebranch and bound tree
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 269 of file sol.c.

References BMSallocBlockMemory, FALSE, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_ZERO, SCIPboolarrayCreate(), SCIPprimalSolCreated(), SCIPrealarrayCreate(), SCIP_Stat::solindex, solStamp(), and TRUE.

Referenced by SCIPcreateSol(), SCIPprimalTransformSol(), SCIPsolCreateLPSol(), SCIPsolCreateNLPSol(), SCIPsolCreatePseudoSol(), SCIPsolCreateRelaxSol(), and updatePrimalRay().

SCIP_RETCODE SCIPsolCreateOriginal ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB origprob,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_HEUR heur 
)

creates primal CIP solution in original problem space, initialized to the offset in the original problem

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
origproboriginal problem data
primalprimal data
treebranch and bound tree
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 301 of file sol.c.

References BMSallocBlockMemory, FALSE, NULL, SCIP_Prob::objoffset, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_ORIGINAL, SCIPboolarrayCreate(), SCIPprimalSolCreated(), SCIPrealarrayCreate(), SCIP_Stat::solindex, solStamp(), and TRUE.

Referenced by SCIPcreateOrigSol(), and SCIPcreateSol().

SCIP_RETCODE SCIPsolCopy ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL primal,
SCIP_SOL sourcesol 
)

creates a copy of a primal CIP solution

Parameters
solpointer to store the copy of the primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
primalprimal data
sourcesolprimal CIP solution to copy

Definition at line 334 of file sol.c.

References BMSallocBlockMemory, SCIP_Sol::depth, SCIP_Sol::hasinfval, SCIP_Sol::heur, SCIP_Sol::nodenum, NULL, SCIP_Sol::obj, SCIP_Sol::runnum, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIPboolarrayCopy(), SCIPprimalSolCreated(), SCIPrealarrayCopy(), SCIP_Stat::solindex, SCIP_Sol::solorigin, SCIP_Sol::time, SCIP_Sol::valid, and SCIP_Sol::vals.

Referenced by SCIPcreateSolCopy(), SCIPprimalAddOrigSol(), SCIPprimalAddSol(), and SCIPprimalTrySol().

SCIP_RETCODE SCIPsolTransform ( SCIP_SOL sol,
SCIP_SOL **  transsol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_PRIMAL primal 
)

transformes given original solution to the transformed space; a corresponding transformed solution has to be given which is copied into the existing solution and freed afterwards

Parameters
solprimal CIP solution to change, living in original space
transsolpointer to corresponding transformed primal CIP solution
blkmemblock memory
setglobal SCIP settings
primalprimal data

Definition at line 369 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_Sol::primalindex, SCIP_CALL, SCIP_OKAY, SCIPsolFree(), SCIPsolIsOriginal(), SCIP_Sol::solorigin, SCIP_Sol::valid, and SCIP_Sol::vals.

Referenced by primalAddSol().

SCIP_RETCODE SCIPsolAdjustImplicitSolVals ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_TREE tree,
SCIP_Bool  uselprows 
)

adjusts solution values of implicit integer variables in handed solution. Solution objective value is not deteriorated by this method.

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
probeither original or transformed problem, depending on sol origin
treebranch and bound tree
uselprowsshould LP row information be considered for none-objective variables

Definition at line 415 of file sol.c.

References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_COLUMN, SCIP_VARTYPE_IMPLINT, SCIPcolGetNNonz(), SCIPcolGetRows(), SCIPcolGetVals(), SCIPprobGetNBinVars(), SCIPprobGetNImplVars(), SCIPprobGetNIntVars(), SCIPprobGetVars(), SCIProwGetLhs(), SCIProwGetRhs(), SCIProwGetSolActivity(), SCIProwIsInLP(), SCIProwIsLocal(), SCIPsetCeil(), SCIPsetFloor(), SCIPsetIsFeasGE(), SCIPsetIsFeasGT(), SCIPsetIsFeasIntegral(), SCIPsetIsFeasLE(), SCIPsetIsFeasLT(), SCIPsetIsFeasNegative(), SCIPsetIsFeasPositive(), SCIPsetIsFeasZero(), SCIPsetIsInfinity(), SCIPsetIsNegative(), SCIPsetIsPositive(), SCIPsolGetVal(), SCIPsolSetVal(), SCIPvarGetCol(), SCIPvarGetLbGlobal(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarGetUbGlobal(), and TRUE.

Referenced by SCIPadjustImplicitSolVals().

SCIP_RETCODE SCIPsolCreateLPSol ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to the current LP solution

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
primalprimal data
treebranch and bound tree
lpcurrent LP data
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 550 of file sol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPlpIsSolved(), SCIPsolCreate(), and SCIPsolLinkLPSol().

Referenced by addCurrentSolution(), SCIPcreateLPSol(), SCIPsolCreateCurrentSol(), SCIPsolveCIP(), and solveNodeLP().

SCIP_RETCODE SCIPsolCreateNLPSol ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_NLP nlp,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to the current NLP solution

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
primalprimal data
treebranch and bound tree
nlpcurrent NLP data
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 573 of file sol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPsolCreate(), and SCIPsolLinkNLPSol().

Referenced by SCIPcreateNLPSol().

SCIP_RETCODE SCIPsolCreateRelaxSol ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_RELAXATION relaxation,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to the current relaxation solution

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
primalprimal data
treebranch and bound tree
relaxationglobal relaxation data
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 594 of file sol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPrelaxationIsSolValid(), SCIPsolCreate(), and SCIPsolLinkRelaxSol().

Referenced by SCIPcreateRelaxSol().

SCIP_RETCODE SCIPsolCreatePseudoSol ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to the current pseudo solution

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
primalprimal data
treebranch and bound tree, or NULL
lpcurrent LP data
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 616 of file sol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPsolCreate(), and SCIPsolLinkPseudoSol().

Referenced by addCurrentSolution(), SCIPcreatePseudoSol(), SCIPsolCreateCurrentSol(), and SCIPsolveCIP().

SCIP_RETCODE SCIPsolCreateCurrentSol ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_LP lp,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to the current solution

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
primalprimal data
treebranch and bound tree
lpcurrent LP data
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 637 of file sol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPsolCreateLPSol(), SCIPsolCreatePseudoSol(), and SCIPtreeHasCurrentNodeLP().

Referenced by primalLinkCurrentSol(), SCIPcreateCurrentSol(), SCIPprintSol(), SCIPprintTransSol(), and solveNode().

SCIP_RETCODE SCIPsolCreateUnknown ( SCIP_SOL **  sol,
BMS_BLKMEM blkmem,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PRIMAL primal,
SCIP_TREE tree,
SCIP_HEUR heur 
)

creates primal CIP solution, initialized to unknown values

Parameters
solpointer to primal CIP solution
blkmemblock memory
setglobal SCIP settings
statproblem statistics data
primalprimal data
treebranch and bound tree
heurheuristic that found the solution (or NULL if it's from the tree)

Definition at line 664 of file sol.c.

References BMSallocBlockMemory, FALSE, NULL, SCIP_ALLOC, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_UNKNOWN, SCIPboolarrayCreate(), SCIPprimalSolCreated(), SCIPrealarrayCreate(), SCIP_Stat::solindex, solStamp(), and TRUE.

Referenced by SCIPcreateUnknownSol().

SCIP_RETCODE SCIPsolLinkLPSol ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_TREE tree,
SCIP_LP lp 
)

copies current LP solution into CIP solution by linking

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
treebranch and bound tree
lpcurrent LP data

Definition at line 715 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_Col::primsol, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_LPSOL, SCIPcolGetVar(), SCIPdebugMessage, SCIPlpDiving(), SCIPlpDivingObjChanged(), SCIPlpGetCols(), SCIPlpGetLooseObjval(), SCIPlpGetNCols(), SCIPlpGetObjval(), SCIPsetIsInfinity(), SCIPvarGetObj(), solClearArrays(), SCIP_Sol::solorigin, solStamp(), SCIP_Lp::solved, and TRUE.

Referenced by SCIPlinkLPSol(), SCIPsolCreateLPSol(), and SCIPsolLinkCurrentSol().

SCIP_RETCODE SCIPsolLinkNLPSol ( SCIP_SOL sol,
SCIP_STAT stat,
SCIP_TREE tree,
SCIP_NLP nlp 
)

copies current NLP solution into CIP solution by linking

Parameters
solprimal CIP solution
statproblem statistics data
treebranch and bound tree
nlpcurrent NLP data

Definition at line 773 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_CALL, SCIP_NLPSOLSTAT_FEASIBLE, SCIP_OKAY, SCIP_SOLORIGIN_NLPSOL, SCIPdebugMessage, SCIPnlpGetNVars(), SCIPnlpGetObjval(), SCIPnlpGetSolstat(), SCIPnlpGetVars(), SCIPnlpIsDivingObjChanged(), SCIPvarGetNLPSol(), SCIPvarGetObj(), SCIPvarIsActive(), solClearArrays(), SCIP_Sol::solorigin, solStamp(), and TRUE.

Referenced by SCIPlinkNLPSol(), and SCIPsolCreateNLPSol().

SCIP_RETCODE SCIPsolLinkRelaxSol ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_TREE tree,
SCIP_RELAXATION relaxation 
)

copies current relaxation solution into CIP solution by linking

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
treebranch and bound tree
relaxationglobal relaxation data

Definition at line 824 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_RELAXSOL, SCIPdebugMessage, SCIPrelaxationGetSolObj(), SCIPrelaxationIsSolValid(), solClearArrays(), SCIP_Sol::solorigin, solStamp(), and TRUE.

Referenced by SCIPlinkRelaxSol(), and SCIPsolCreateRelaxSol().

SCIP_RETCODE SCIPsolLinkPseudoSol ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_TREE tree,
SCIP_LP lp 
)

copies current pseudo solution into CIP solution by linking

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
treebranch and bound tree, or NULL
lpcurrent LP data

Definition at line 854 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_PSEUDOSOL, SCIPdebugMessage, SCIPlpGetPseudoObjval(), solClearArrays(), SCIP_Sol::solorigin, solStamp(), and TRUE.

Referenced by SCIPlinkPseudoSol(), SCIPsolCreatePseudoSol(), and SCIPsolLinkCurrentSol().

SCIP_RETCODE SCIPsolLinkCurrentSol ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_TREE tree,
SCIP_LP lp 
)

copies current solution (LP or pseudo solution) into CIP solution by linking

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
treebranch and bound tree
lpcurrent LP data

Definition at line 883 of file sol.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPdebugMessage, SCIPlpIsSolved(), SCIPsolLinkLPSol(), SCIPsolLinkPseudoSol(), and SCIPtreeHasCurrentNodeLP().

Referenced by primalLinkCurrentSol(), and SCIPlinkCurrentSol().

SCIP_RETCODE SCIPsolClear ( SCIP_SOL sol,
SCIP_STAT stat,
SCIP_TREE tree 
)

clears primal CIP solution

Parameters
solprimal CIP solution
statproblem statistics data
treebranch and bound tree

Definition at line 909 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_ZERO, solClearArrays(), SCIP_Sol::solorigin, solStamp(), and TRUE.

Referenced by SCIPclearSol().

SCIP_RETCODE SCIPsolSetUnknown ( SCIP_SOL sol,
SCIP_STAT stat,
SCIP_TREE tree 
)

declares all entries in the primal CIP solution to be unknown

Parameters
solprimal CIP solution
statproblem statistics data
treebranch and bound tree

Definition at line 926 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_UNKNOWN, solClearArrays(), SCIP_Sol::solorigin, solStamp(), and TRUE.

SCIP_RETCODE SCIPsolUnlink ( SCIP_SOL sol,
SCIP_SET set,
SCIP_PROB prob 
)

stores solution values of variables in solution's own array

Parameters
solprimal CIP solution
setglobal SCIP settings
probtransformed problem data

Definition at line 943 of file sol.c.

References NULL, SCIP_Prob::nvars, SCIP_CALL, SCIP_OKAY, SCIP_SOLORIGIN_UNKNOWN, SCIP_SOLORIGIN_ZERO, SCIPdebugMessage, SCIPsolIsOriginal(), SCIP_Sol::solorigin, solUnlinkVar(), and SCIP_Prob::vars.

Referenced by primalAddSol(), SCIPaddSol(), SCIPaddSolFree(), SCIPtrySol(), SCIPtrySolFree(), and SCIPunlinkSol().

SCIP_RETCODE SCIPsolSetVal ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_TREE tree,
SCIP_VAR var,
SCIP_Real  val 
)
SCIP_Real SCIPsolGetVal ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_VAR var 
)

returns value of variable in primal CIP solution

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
varvariable to get value for

Definition at line 1188 of file sol.c.

References SCIP_Stat::nnodes, SCIP_Sol::nodenum, SCIP_Stat::nruns, NULL, SCIP_Sol::runnum, scalars, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_SOLORIGIN_ORIGINAL, SCIP_SOLORIGIN_UNKNOWN, SCIP_SOLORIGIN_ZERO, SCIP_UNKNOWN, SCIP_VARSTATUS_AGGREGATED, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_LOOSE, SCIP_VARSTATUS_MULTAGGR, SCIP_VARSTATUS_NEGATED, SCIP_VARSTATUS_ORIGINAL, SCIPABORT, SCIPerrorMessage, SCIPsetInfinity(), SCIPsetIsInfinity(), SCIPsolGetVal(), SCIPsolIsOriginal(), SCIPvarGetAggrConstant(), SCIPvarGetAggrScalar(), SCIPvarGetAggrVar(), SCIPvarGetLbGlobal(), SCIPvarGetLbLocal(), SCIPvarGetMultaggrConstant(), SCIPvarGetMultaggrNVars(), SCIPvarGetMultaggrScalars(), SCIPvarGetMultaggrVars(), SCIPvarGetNegationConstant(), SCIPvarGetNegationVar(), SCIPvarGetOrigvarSum(), SCIPvarGetStatus(), SCIPvarGetTransVar(), SCIPvarGetUbGlobal(), SCIPvarGetUbLocal(), SCIPvarIsTransformed(), solGetArrayVal(), and SCIP_Sol::solorigin.

Referenced by checkSolOrig(), getMIRRowActivity(), SCIPgetSolVal(), SCIPgetSolVals(), SCIPnlrowGetSolActivity(), SCIPprimalTransformSol(), SCIProwGetSolActivity(), SCIPsolAdjustImplicitSolVals(), SCIPsolCheck(), SCIPsolGetVal(), SCIPsolPrint(), SCIPsolRecomputeObj(), SCIPsolRetransform(), SCIPsolsAreEqual(), SCIPsolUpdateVarsum(), SCIPvarGetClosestVlb(), SCIPvarGetClosestVub(), and transformMIRRow().

SCIP_Real SCIPsolGetObj ( SCIP_SOL sol,
SCIP_SET set,
SCIP_PROB transprob,
SCIP_PROB origprob 
)

gets objective value of primal CIP solution in transformed problem

Parameters
solprimal CIP solution
setglobal SCIP settings
transprobtranformed problem data
origproboriginal problem data

Definition at line 1379 of file sol.c.

References NULL, SCIP_Sol::obj, SCIPprobInternObjval(), and SCIPsolIsOriginal().

Referenced by presolve(), primalAddSol(), primalExistsSol(), primalSearchSolPos(), printSolutionStatistics(), SCIPgetSolOrigObj(), SCIPgetSolTransObj(), SCIPprimalAddSol(), SCIPprimalUpdateObjoffset(), SCIPprimalUpperboundIsSol(), SCIPprintSol(), SCIPprintTransSol(), SCIPsetRelaxSolValsSol(), SCIPsolsAreEqual(), SCIPsolveCIP(), SCIPtransformProb(), and solOfInterest().

void SCIPsolUpdateVarObj ( SCIP_SOL sol,
SCIP_VAR var,
SCIP_Real  oldobj,
SCIP_Real  newobj 
)

updates primal solutions after a change in a variable's objective value

Parameters
solprimal CIP solution
varproblem variable
oldobjold objective value
newobjnew objective value

Definition at line 1396 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_Real, SCIP_UNKNOWN, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_LOOSE, SCIPsolIsOriginal(), SCIPvarGetStatus(), and solGetArrayVal().

Referenced by SCIPprimalUpdateVarObj().

SCIP_RETCODE SCIPsolCheck ( SCIP_SOL sol,
SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
BMS_BLKMEM blkmem,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_Bool  printreason,
SCIP_Bool  checkbounds,
SCIP_Bool  checkintegrality,
SCIP_Bool  checklprows,
SCIP_Bool feasible 
)

checks primal CIP solution for feasibility

Parameters
solprimal CIP solution
setglobal SCIP settings
messagehdlrmessage handler
blkmemblock memory
statproblem statistics
probtransformed problem data
printreasonshould all reasons of violations be printed?
checkboundsshould the bounds of the variables be checked?
checkintegralityhas integrality to be checked?
checklprowshave current LP rows to be checked?
feasiblestores whether solution is feasible

Definition at line 1415 of file sol.c.

References SCIP_Sol::hasinfval, MAX, SCIP_Sol::nodenum, NULL, SCIP_Prob::nvars, SCIP_Sol::obj, SCIP_CALL, SCIP_FEASIBLE, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_UNKNOWN, SCIPconshdlrCheck(), SCIPconshdlrGetName(), SCIPdebugMessage, SCIPdebugPrintf, SCIPmessagePrintInfo(), SCIPsetIsFeasGE(), SCIPsetIsFeasGT(), SCIPsetIsFeasLE(), SCIPsetIsFeasLT(), SCIPsetIsGE(), SCIPsetIsGT(), SCIPsetIsInfinity(), SCIPsetIsLE(), SCIPsetIsLT(), SCIPsolGetVal(), SCIPsolIsOriginal(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarGetUbGlobal(), SCIP_Sol::solorigin, TRUE, and SCIP_Prob::vars.

Referenced by primalAddSol(), SCIPcheckSol(), SCIPprimalTrySol(), SCIPprimalTrySolFree(), and solveNodeLP().

SCIP_RETCODE SCIPsolRound ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_TREE tree,
SCIP_Bool success 
)

try to round given solution

Parameters
solprimal solution
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
treebranch and bound tree
successpointer to store whether rounding was successful

Definition at line 1539 of file sol.c.

References SCIP_Prob::nbinvars, SCIP_Prob::nintvars, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_UNKNOWN, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_LOOSE, SCIPsetFeasCeil(), SCIPsetFeasFloor(), SCIPsetIsFeasIntegral(), SCIPsetIsIntegral(), SCIPsetRound(), SCIPsolIsOriginal(), SCIPsolSetVal(), SCIPvarGetObj(), SCIPvarGetStatus(), SCIPvarMayRoundDown(), SCIPvarMayRoundUp(), solGetArrayVal(), SCIP_Prob::transformed, and SCIP_Prob::vars.

Referenced by SCIProundSol().

void SCIPsolUpdateVarsum ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_Real  weight 
)

updates the solution value sums in variables by adding the value in the given solution

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
probtransformed problem data
weightweight of solution in weighted average

Definition at line 1616 of file sol.c.

References NULL, SCIP_Prob::nvars, SCIP_Var::primsolavg, SCIP_Real, SCIP_UNKNOWN, SCIPsolGetVal(), SCIPsolIsOriginal(), and SCIP_Prob::vars.

Referenced by primalAddSol().

SCIP_RETCODE SCIPsolRetransform ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB origprob,
SCIP_PROB transprob,
SCIP_Bool hasinfval 
)

retransforms solution to original problem space

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
origproboriginal problem
transprobtransformed problem
hasinfvalpointer to store whether the solution has infinite values

Definition at line 1644 of file sol.c.

References FALSE, NULL, SCIP_Prob::nvars, SCIP_Sol::obj, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_SOLORIGIN_ORIGINAL, SCIP_SOLORIGIN_ZERO, SCIP_UNKNOWN, SCIPsetAllocBufferArray, SCIPsetFreeBufferArray, SCIPsetInfinity(), SCIPsetIsInfinity(), SCIPsetIsZero(), SCIPsolGetVal(), SCIPvarGetActiveRepresentatives(), SCIPvarGetObj(), SCIPvarGetProbindex(), solClearArrays(), SCIP_Sol::solorigin, solSetArrayVal(), SCIP_Prob::transformed, TRUE, and SCIP_Prob::vars.

Referenced by freeTransform(), SCIPaddSol(), SCIPaddSolFree(), SCIPprimalRetransformSolutions(), SCIPretransformSol(), SCIPtrySol(), and SCIPtrySolFree().

void SCIPsolRecomputeObj ( SCIP_SOL sol,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB origprob 
)

recomputes the objective value of an original solution, e.g., when transferring solutions from the solution pool (objective coefficients might have changed in the meantime)

Parameters
solprimal CIP solution
setglobal SCIP settings
statproblem statistics data
origproboriginal problem

Definition at line 1769 of file sol.c.

References NULL, SCIP_Prob::nvars, SCIP_Sol::obj, SCIP_Real, SCIP_UNKNOWN, SCIPprobGetObjoffset(), SCIPsetInfinity(), SCIPsetIsInfinity(), SCIPsetIsZero(), SCIPsolGetVal(), SCIPsolIsOriginal(), SCIPvarGetObj(), and SCIP_Prob::vars.

Referenced by SCIPtransformProb().

SCIP_Bool SCIPsolsAreEqual ( SCIP_SOL sol1,
SCIP_SOL sol2,
SCIP_SET set,
SCIP_STAT stat,
SCIP_PROB origprob,
SCIP_PROB transprob 
)

returns whether the given solutions in transformed space are equal

returns whether the given solutions are equal

Parameters
sol1first primal CIP solution
sol2second primal CIP solution
setglobal SCIP settings
statproblem statistics data
origproboriginal problem
transprobtransformed problem after presolve, or NULL if both solution are defined in the original problem space

Definition at line 1804 of file sol.c.

References FALSE, NULL, SCIP_Prob::nvars, SCIP_Sol::obj, SCIP_Real, SCIPsetIsEQ(), SCIPsolGetObj(), SCIPsolGetVal(), SCIPsolIsOriginal(), TRUE, and SCIP_Prob::vars.

Referenced by primalExistsOrigSol(), primalExistsSol(), and SCIPareSolsEqual().

SCIP_RETCODE SCIPsolPrint ( SCIP_SOL sol,
SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_PROB transprob,
FILE *  file,
SCIP_Bool  printzeros 
)

outputs non-zero elements of solution to file stream

Parameters
solprimal CIP solution
setglobal SCIP settings
messagehdlrmessage handler
statproblem statistics data
probproblem data (original or transformed)
transprobtransformed problem data or NULL (to display priced variables)
fileoutput file (or NULL for standard output)
printzerosshould variables set to zero be printed?

Definition at line 1864 of file sol.c.

References SCIP_Prob::fixedvars, SCIP_Prob::nfixedvars, NULL, SCIP_Prob::nvars, SCIP_OKAY, SCIP_Real, SCIP_UNKNOWN, SCIPmessageFPrintInfo(), SCIPsetIsInfinity(), SCIPsetIsZero(), SCIPsolGetVal(), SCIPsolIsOriginal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarIsTransformedOrigvar(), SCIP_Prob::transformed, and SCIP_Prob::vars.

Referenced by primalAddSol(), SCIPprintSol(), and SCIPprintTransSol().

SCIP_RETCODE SCIPsolPrintRay ( SCIP_SOL sol,
SCIP_SET set,
SCIP_MESSAGEHDLR messagehdlr,
SCIP_STAT stat,
SCIP_PROB prob,
SCIP_PROB transprob,
FILE *  file,
SCIP_Bool  printzeros 
)

outputs non-zero elements of solution representing a ray to file stream

Parameters
solprimal CIP solution
setglobal SCIP settings
messagehdlrmessage handler
statproblem statistics data
probproblem data (original or transformed)
transprobtransformed problem data or NULL (to display priced variables)
fileoutput file (or NULL for standard output)
printzerosshould variables set to zero be printed?

Definition at line 1973 of file sol.c.

References SCIP_Prob::fixedvars, SCIP_Prob::nfixedvars, NULL, SCIP_Prob::nvars, SCIP_OKAY, SCIP_Real, SCIP_UNKNOWN, SCIPmessageFPrintInfo(), SCIPsetIsInfinity(), SCIPsetIsZero(), SCIPsolGetRayVal(), SCIPsolIsOriginal(), SCIPvarGetName(), SCIPvarGetObj(), SCIPvarIsTransformedOrigvar(), SCIP_Prob::transformed, and SCIP_Prob::vars.

Referenced by SCIPprintRay().

void SCIPsolOrigAddObjval ( SCIP_SOL sol,
SCIP_Real  addval 
)

adds value to the objective value of a given original primal CIP solution

Parameters
solprimal CIP solution
addvaloffset value to add

Definition at line 2139 of file sol.c.

References NULL, SCIP_Sol::obj, SCIP_SOLORIGIN_ORIGINAL, and SCIP_Sol::solorigin.

Referenced by SCIPprimalAddOrigObjoffset().

int SCIPsolGetPrimalIndex ( SCIP_SOL sol)

gets current position of solution in array of existing solutions of primal data

Parameters
solprimal CIP solution

Definition at line 2201 of file sol.c.

References NULL, and SCIP_Sol::primalindex.

Referenced by SCIPprimalSolCreated(), and SCIPprimalSolFreed().

void SCIPsolSetPrimalIndex ( SCIP_SOL sol,
int  primalindex 
)

sets current position of solution in array of existing solutions of primal data

Parameters
solprimal CIP solution
primalindexnew primal index of solution

Definition at line 2211 of file sol.c.

References NULL, and SCIP_Sol::primalindex.

Referenced by SCIPprimalSolCreated(), and SCIPprimalSolFreed().