assert(violrows !=
NULL);
99assert(violrowpos !=
NULL);
100assert(nviolrows !=
NULL);
106 if( oldviol != newviol )
117violpos = violrowpos[rowpos];
118assert(0 <= violpos && violpos < *nviolrows);
119assert(violrows[violpos] == row);
120violrowpos[rowpos] = -1;
121 if( violpos != *nviolrows-1 )
123violrows[violpos] = violrows[*nviolrows-1];
131assert(violrowpos[rowpos] == -1);
132violrows[*nviolrows] = row;
133violrowpos[rowpos] = *nviolrows;
160assert(activities !=
NULL);
161assert(nviolrows !=
NULL);
162assert(0 <= *nviolrows && *nviolrows <= nlprows);
164delta = newsolval - oldsolval;
169assert(ncolrows == 0 || (colrows !=
NULL&& colvals !=
NULL));
171 for(
r= 0;
r< ncolrows; ++
r)
178assert(-1 <= rowpos && rowpos < nlprows);
188oldactivity = activities[rowpos];
191newactivity = oldactivity + delta * colvals[
r];
196activities[rowpos] = newactivity;
239assert(direction == +1 || direction == -1);
240assert(roundvar !=
NULL);
241assert(oldsolval !=
NULL);
242assert(newsolval !=
NULL);
253 for( c = 0; c < nrowcols; ++c )
268 if( direction * val < 0.0 )
272 if( nlocks <= minnlocks )
275deltaobj = obj * (roundval - solval);
279bestdeltaobj = deltaobj;
282*newsolval = roundval;
289assert(direction * val > 0.0);
291 if( nlocks <= minnlocks )
294deltaobj = obj * (roundval - solval);
298bestdeltaobj = deltaobj;
301*newsolval = roundval;
369assert(roundvar !=
NULL);
370assert(oldsolval !=
NULL);
371assert(newsolval !=
NULL);
377 for( v = 0; v < nlpcands; ++v )
389 if( nlocks >= maxnlocks )
392deltaobj = obj * (roundval - solval);
396bestdeltaobj = deltaobj;
399*newsolval = roundval;
405 if( nlocks >= maxnlocks )
408deltaobj = obj * (roundval - solval);
412bestdeltaobj = deltaobj;
415*newsolval = roundval;
434assert(heur !=
NULL);
449assert(heur !=
NULL);
455assert(heurdata !=
NULL);
471assert(heurdata !=
NULL);
475heurdata->lastlp = -1;
490assert(heurdata !=
NULL);
505assert(heurdata !=
NULL);
506heurdata->lastlp = -1;
509 if( heurdata->oncepernode )
554assert(result !=
NULL);
569assert(heurdata !=
NULL);
573 if( nlps == heurdata->lastlp )
575heurdata->lastlp = nlps;
581 if(
nnodes% ((ncalls/heurdata->successfactor)/(nsolsfound+1)+1) != 0 )
597 SCIPdebugMsg(
scip,
"executing rounding heuristic: %d LP rows, %d fractionals\n", nlprows, nfrac);
608 for(
r= 0;
r< nlprows; ++
r)
621violrows[nviolrows] = row;
622violrowpos[
r] = nviolrows;
626violrowpos[
r] = -1;
632assert(sol !=
NULL);
640 for( c = 0; c < nlpcands; ++c )
644minobj += obj * (bestroundval - lpcandssol[c]);
654 SCIPdebugMsg(
scip,
"rounding heuristic: nfrac=%d, nviolrows=%d, obj=%g (best possible obj: %g)\n",
670row = violrows[nviolrows-1];
672assert(0 <= rowpos && rowpos < nlprows);
673assert(violrowpos[rowpos] == nviolrows-1);
675 SCIPdebugMsg(
scip,
"rounding heuristic: try to fix violated row <%s>: %g <= %g <= %g\n",
691 SCIPdebugMsg(
scip,
"rounding heuristic: search rounding variable and try to stay feasible\n");
696 if( roundvar ==
NULL)
698 SCIPdebugMsg(
scip,
"rounding heuristic: -> didn't find a rounding variable\n");
702 SCIPdebugMsg(
scip,
"rounding heuristic: -> round var <%s>, oldval=%g, newval=%g, obj=%g\n",
707roundvar, oldsolval, newsolval) );
715 if( obj > 0.0 && newsolval > oldsolval )
717 else if( obj < 0.0 && newsolval < oldsolval )
720 SCIPdebugMsg(
scip,
"rounding heuristic: -> nfrac=%d, nviolrows=%d, obj=%g (best possible obj: %g)\n",
725 if( nfrac == 0 && nviolrows == 0 )
775assert(heur !=
NULL);
787 "number of calls per found solution that are considered as standard success, a higher factor causes the heuristic to be called more often",
791 "should the heuristic only be called once per node?",
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPincludeHeurRounding(SCIP *scip)
SCIP_RETCODE SCIPgetLPBranchCands(SCIP *scip, SCIP_VAR ***lpcands, SCIP_Real **lpcandssol, SCIP_Real **lpcandsfrac, int *nlpcands, int *npriolpcands, int *nfracimplvars)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Real * SCIPcolGetVals(SCIP_COL *col)
SCIP_ROW ** SCIPcolGetRows(SCIP_COL *col)
int SCIPcolGetNLPNonz(SCIP_COL *col)
SCIP_RETCODE SCIPsetHeurExitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXITSOL((*heurexitsol)))
SCIP_RETCODE SCIPsetHeurCopy(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURCOPY((*heurcopy)))
SCIP_HEURDATA * SCIPheurGetData(SCIP_HEUR *heur)
SCIP_RETCODE SCIPincludeHeurBasic(SCIP *scip, SCIP_HEUR **heur, const char *name, const char *desc, char dispchar, int priority, int freq, int freqofs, int maxdepth, SCIP_HEURTIMING timingmask, SCIP_Bool usessubscip, SCIP_DECL_HEUREXEC((*heurexec)), SCIP_HEURDATA *heurdata)
SCIP_RETCODE SCIPsetHeurFree(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURFREE((*heurfree)))
SCIP_Longint SCIPheurGetNSolsFound(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurExit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEUREXIT((*heurexit)))
SCIP_Longint SCIPheurGetNBestSolsFound(SCIP_HEUR *heur)
void SCIPheurSetTimingmask(SCIP_HEUR *heur, SCIP_HEURTIMING timingmask)
SCIP_Longint SCIPheurGetNCalls(SCIP_HEUR *heur)
SCIP_RETCODE SCIPsetHeurInitsol(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINITSOL((*heurinitsol)))
SCIP_RETCODE SCIPsetHeurInit(SCIP *scip, SCIP_HEUR *heur, SCIP_DECL_HEURINIT((*heurinit)))
const char * SCIPheurGetName(SCIP_HEUR *heur)
void SCIPheurSetData(SCIP_HEUR *heur, SCIP_HEURDATA *heurdata)
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Real SCIPgetLPObjval(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
int SCIProwGetNLPNonz(SCIP_ROW *row)
int SCIProwGetLPPos(SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
const char * SCIProwGetName(SCIP_ROW *row)
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_RETCODE SCIPcreateSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
SCIP_RETCODE SCIPtrySol(SCIP *scip, SCIP_SOL *sol, SCIP_Bool printreason, SCIP_Bool completely, SCIP_Bool checkbounds, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool *stored)
SCIP_RETCODE SCIPlinkLPSol(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPgetSolOrigObj(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
SCIP_Real SCIPretransformObj(SCIP *scip, SCIP_Real obj)
SCIP_Longint SCIPgetNNodes(SCIP *scip)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_Real SCIPgetCutoffbound(SCIP *scip)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
static SCIP_RETCODE selectEssentialRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_VAR **lpcands, int nlpcands, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
#define DEFAULT_SUCCESSFACTOR
static SCIP_DECL_HEURCOPY(heurCopyRounding)
static SCIP_RETCODE updateActivities(SCIP *scip, SCIP_Real *activities, SCIP_ROW **violrows, int *violrowpos, int *nviolrows, int nlprows, SCIP_VAR *var, SCIP_Real oldsolval, SCIP_Real newsolval)
static void updateViolations(SCIP *scip, SCIP_ROW *row, SCIP_ROW **violrows, int *violrowpos, int *nviolrows, SCIP_Real oldactivity, SCIP_Real newactivity)
#define DEFAULT_ONCEPERNODE
static SCIP_RETCODE selectIncreaseRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_ROW *row, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
static SCIP_DECL_HEUREXEC(heurExecRounding)
static SCIP_DECL_HEUREXIT(heurExitRounding)
static SCIP_RETCODE selectDecreaseRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_ROW *row, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
static SCIP_DECL_HEUREXITSOL(heurExitsolRounding)
static SCIP_DECL_HEURINITSOL(heurInitsolRounding)
static SCIP_DECL_HEURFREE(heurFreeRounding)
static SCIP_RETCODE selectRounding(SCIP *scip, SCIP_SOL *sol, SCIP_Real minobj, SCIP_ROW *row, int direction, SCIP_VAR **roundvar, SCIP_Real *oldsolval, SCIP_Real *newsolval)
static SCIP_DECL_HEURINIT(heurInitRounding)
LP rounding heuristic that tries to recover from intermediate infeasibilities.
memory allocation routines
public methods for primal heuristics
public methods for LP management
public methods for message output
public methods for problem variables
public methods for branching rule plugins and branching
public methods for primal heuristic plugins and divesets
public methods for the LP relaxation, rows and columns
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for solutions
public methods for querying solving statistics
struct SCIP_HeurData SCIP_HEURDATA
enum SCIP_Retcode SCIP_RETCODE
#define SCIP_HEURTIMING_AFTERLPNODE
enum SCIP_Vartype SCIP_VARTYPE
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4