public methods for solutions
Definition in file scip_sol.c.
#include <string.h>#include "blockmemshell/memory.h"#include "scip/cons.h"#include "scip/cons_linear.h"#include "scip/debug.h"#include "scip/lp.h"#include "scip/lpexact.h"#include "scip/nlp.h"#include "scip/primal.h"#include "scip/prob.h"#include "scip/pub_cons.h"#include "scip/pub_fileio.h"#include "scip/pub_message.h"#include "scip/pub_misc.h"#include "scip/pub_sol.h"#include "scip/pub_var.h"#include "scip/relax.h"#include "scip/scip_cons.h"#include "scip/scip_copy.h"#include "scip/scip_exact.h"#include "scip/scip_general.h"#include "scip/scip_lpexact.h"#include "scip/scip_mem.h"#include "scip/scip_message.h"#include "scip/scip_nlp.h"#include "scip/scip_numerics.h"#include "scip/scip_param.h"#include "scip/scip_prob.h"#include "scip/scip_sol.h"#include "scip/scip_solve.h"#include "scip/scip_solvingstats.h"#include "scip/scip_var.h"#include "scip/set.h"#include "scip/sol.h"#include "scip/struct_lp.h"#include "scip/struct_mem.h"#include "scip/struct_primal.h"#include "scip/struct_prob.h"#include "scip/struct_scip.h"#include "scip/struct_set.h"#include "scip/struct_sol.h"#include "scip/struct_stat.h"#include "scip/struct_var.h"#include "scip/tree.h"#include "xml/xml.h"Go to the source code of this file.
|
static |
checks solution for feasibility in original problem without adding it to the solution store; to improve the performance we use the following order when checking for violations:
| scip | SCIP data structure |
| sol | primal CIP solution |
| feasible | stores whether given solution is feasible |
| printreason | Should the reason for the violation be printed? |
| completely | Should all violations be checked if printreason is true? |
| checkbounds | Should the bounds of the variables be checked? |
| checkintegrality | Has integrality to be checked? |
| checklprows | Do constraints represented by rows in the current LP have to be checked? |
| checkmodifiable | have modifiable constraint to be checked? |
Definition at line 101 of file scip_sol.c.
References assert(), c, FALSE, h, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_OKAY, SCIP_Real, SCIP_SOLORIGIN_ORIGINAL, SCIPblkmem(), SCIPcheckStage, SCIPconsCheck(), SCIPconshdlrCheck(), SCIPconshdlrGetCheckPriority(), SCIPconshdlrNeedsCons(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPisExact(), SCIPmessagePrintInfo(), SCIPrelDiff(), SCIPsetIsFeasGT(), SCIPsetIsFeasLT(), SCIPsolGetOrigin(), SCIPsolGetVal(), SCIPsolMakeExact(), SCIPsolResetViolations(), SCIPupdateSolBoundViolation(), SCIPvarGetLbOriginal(), SCIPvarGetName(), SCIPvarGetUbOriginal(), sol, TRUE, and var.
Referenced by SCIPtrySolFreeExact().
|
static |
checks solution (fp or exact) for exact feasibility in original problem without adding it to the solution store; to improve the performance we use the following order when checking for violations:
| scip | SCIP data structure |
| sol | primal CIP solution |
| feasible | stores whether given solution is feasible |
| printreason | Should the reason for the violation be printed? |
| completely | Should all violations be checked if printreason is true? |
| checkbounds | Should the bounds of the variables be checked? |
| checkintegrality | Has integrality to be checked? |
| checklprows | Do constraints represented by rows in the current LP have to be checked? |
| checkmodifiable | have modifiable constraint to be checked? |
Definition at line 255 of file scip_sol.c.
References assert(), c, FALSE, h, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_OKAY, SCIP_SOLORIGIN_ORIGINAL, SCIPblkmem(), SCIPbuffer(), SCIPcheckStage, SCIPconsCheck(), SCIPconshdlrCheck(), SCIPconshdlrGetCheckPriority(), SCIPconshdlrNeedsCons(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPisExact(), SCIPmessagePrintInfo(), SCIPrationalCreateBuffer(), SCIPrationalFreeBuffer(), SCIPrationalGetReal(), SCIPrationalIsGT(), SCIPrationalIsLT(), SCIPrationalSetReal(), SCIPsolGetOrigin(), SCIPsolGetVal(), SCIPsolGetValExact(), SCIPsolIsExact(), SCIPsolMakeExact(), SCIPsolResetViolations(), SCIPvarGetLbOriginalExact(), SCIPvarGetName(), SCIPvarGetUbOriginalExact(), sol, TRUE, and var.
Referenced by SCIPcheckSol(), and SCIPcheckSolOrig().
|
static |
helper method that sets up and solves the sub-SCIP for removing infinite values from solutions
| scip | SCIP data structure |
| subscip | SCIP data structure of sub-SCIP |
| origvars | original problem variables of main SCIP |
| norigvars | number of original problem variables of main SCIP |
| solvals | array with solution values of variables; infinite ones are replaced |
| success | pointer to store if removing infinite values was successful |
Definition at line 965 of file scip_sol.c.
References assert(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIP_VERBLEVEL_NONE, SCIPaddCoefLinear(), SCIPaddCons(), SCIPaddVar(), SCIPblkmem(), SCIPchgVarObj(), SCIPchgVarType(), SCIPcopyOrig(), SCIPcreateConsBasicLinear(), SCIPcreateVar(), SCIPfixVar(), SCIPgetBestSol(), SCIPgetSolVal(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPhashmapGetImage(), SCIPinfinity(), SCIPisFeasGT(), SCIPisFeasLT(), SCIPisInfinity(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsetIntParam(), SCIPsnprintf(), SCIPsolve(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetUbLocal(), TRUE, and valid.
Referenced by SCIPcreateFiniteSolCopy().
|
static |
outputs dual solution from LP solver to file stream
| scip | SCIP data structure |
| file | output file (or NULL for standard output) |
| printzeros | should variables set to zero be printed? |
Definition at line 2700 of file scip_sol.c.
References assert(), c, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconsGetName(), SCIPgetDualSolVal(), SCIPisInfinity(), SCIPisZero(), and SCIPmessageFPrintInfo().
Referenced by SCIPprintDualSol().
|
static |
reads a given solution file and store the solution values in the given solution pointer
| scip | SCIP data structure |
| filename | name of the input file |
| sol | solution pointer |
| partial | pointer to store if the solution is partial (or NULL, if not needed) |
| error | pointer store if an error occured |
Definition at line 3328 of file scip_sol.c.
References assert(), FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_CALL_FINALLY, SCIP_INVALIDDATA, SCIP_MAXSTRLEN, SCIP_NOFILE, SCIP_OKAY, SCIP_Real, SCIP_SOLORIGIN_ORIGINAL, SCIP_STAGE_PROBLEM, SCIP_UNKNOWN, SCIP_VARSTATUS_MULTAGGR, SCIP_VERBLEVEL_NORMAL, SCIPblkmem(), SCIPdebugMsg, SCIPerrorMessage, SCIPfclose(), SCIPfeof(), SCIPfgets(), SCIPfindVar(), SCIPfopen(), SCIPgetNVars(), SCIPgetStage(), SCIPhashsetCreate(), SCIPhashsetFree(), SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), SCIPhashsetInsert(), SCIPinfinity(), SCIPisExact(), SCIPisTransformed(), SCIPprintSysError(), SCIPrationalCreateString(), SCIPrationalFreeBlock(), SCIPrationalGetReal(), SCIPrationalIsString(), SCIPsetSolVal(), SCIPsetSolValExact(), SCIPsolGetOrigin(), SCIPsolIsExact(), SCIPsolIsPartial(), SCIPsolMakeReal(), SCIPsolMarkPartial(), SCIPstrncasecmp(), SCIPstrtok(), SCIPstrToRealValue(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPverbMessage(), SCIPwarningMessage(), sol, TRUE, and var.
Referenced by SCIPreadSolFile().
|
static |
reads a given xml solution file and store the solution values in the given solution pointer
| scip | SCIP data structure |
| filename | name of the input file |
| sol | solution pointer |
| partial | pointer to store if the solution is partial (or NULL if not needed) |
| error | pointer store if an error occured |
Definition at line 3562 of file scip_sol.c.
References assert(), FALSE, i, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIP_SOLORIGIN_ORIGINAL, SCIP_STAGE_PROBLEM, SCIP_UNKNOWN, SCIP_VARSTATUS_MULTAGGR, SCIP_VERBLEVEL_NORMAL, SCIPblkmem(), SCIPdebugMsg, SCIPerrorMessage, SCIPfindVar(), SCIPgetNVars(), SCIPgetStage(), SCIPhashsetCreate(), SCIPhashsetFree(), SCIPhashsetGetNSlots(), SCIPhashsetGetSlots(), SCIPhashsetInsert(), SCIPinfinity(), SCIPisExact(), SCIPisTransformed(), SCIPrationalCreateString(), SCIPrationalFreeBlock(), SCIPrationalGetReal(), SCIPrationalIsString(), SCIPsetSolVal(), SCIPsetSolValExact(), SCIPsolGetOrigin(), SCIPsolIsExact(), SCIPsolIsPartial(), SCIPsolMakeReal(), SCIPsolMarkPartial(), SCIPstrncasecmp(), SCIPstrToRealValue(), SCIPvarGetProbvar(), SCIPvarGetStatus(), SCIPverbMessage(), SCIPwarningMessage(), SCIPxmlFindNodeMaxdepth(), SCIPxmlFirstChild(), SCIPxmlFreeNode(), SCIPxmlGetAttrval(), SCIPxmlNextSibl(), SCIPxmlProcess(), sol, TRUE, and var.
Referenced by SCIPreadSolFile().