47ScipParaInitialStat::clone(
91 scipParaComm->createScipParaInitialStat(newMaxDepth, newMaxTotalDepth, newNVarBranchStatsDown, newNVarBranchStatsUp,
92 newIdxLBranchStatsVarsDown, newNVarBranchingDown, newIdxLBranchStatsVarsUp, newNVarBranchingUp,
93 newDownpscost, newDownvsids, newDownconflen, newDowninfer, newDowncutoff,
94 newUppscost, newUpvsids, newUpconflen, newUpinfer, newUpcutoff)
103 nVarBranchStatsDown(0),
104 nVarBranchStatsUp(0),
105 idxLBranchStatsVarsDown(0),
106 nVarBranchingDown(0),
107 idxLBranchStatsVarsUp(0),
129 SCIP_CALL_ABORT( SCIPgetVarsData(scip, &vars, &nvars, &nbinvars, &nintvars, NULL, NULL) );
130 int ngenvars = nbinvars+nintvars;
133 for(
int i = 0; i < ngenvars; ++i )
135 assert( SCIPvarGetType(vars[i]) == SCIP_VARTYPE_BINARY || SCIPvarGetType(vars[i]) == SCIP_VARTYPE_INTEGER );
136 SCIP_VAR *transformVar = vars[i];
137 SCIP_Real scalar = 1.0;
138 SCIP_Real constant = 0.0;
139 SCIP_CALL_ABORT( SCIPvarGetOrigvarSum(&transformVar, &scalar, &constant ) );
140 assert(transformVar != NULL);
143 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_DOWNWARDS) > 0 )
147 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_UPWARDS) > 0 )
154 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_DOWNWARDS) > 0 )
158 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_UPWARDS) > 0 )
183 for(
int i = 0; i < ngenvars; ++i )
185 assert( SCIPvarGetType(vars[i]) == SCIP_VARTYPE_BINARY || SCIPvarGetType(vars[i]) == SCIP_VARTYPE_INTEGER );
186 SCIP_VAR *transformVar = vars[i];
187 SCIP_Real scalar = 1.0;
188 SCIP_Real constant = 0.0;
189 SCIP_CALL_ABORT( SCIPvarGetOrigvarSum(&transformVar, &scalar, &constant ) );
190 assert(transformVar != NULL);
193 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_DOWNWARDS) > 0 )
196 nVarBranchingDown[nDown] = SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_DOWNWARDS);
197 downpscost[nDown] = SCIPgetVarPseudocost(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
198 downvsids[nDown] = SCIPgetVarVSIDS(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
199 downconflen[nDown] = SCIPgetVarAvgConflictlength(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
200 downinfer[nDown] = SCIPgetVarAvgInferences(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
201 downcutoff[nDown] = SCIPgetVarAvgCutoffs(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
204 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_UPWARDS) > 0 )
207 nVarBranchingUp[nUp] = SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_UPWARDS);
208 uppscost[nUp] = SCIPgetVarPseudocost(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
209 upvsids[nUp] = SCIPgetVarVSIDS(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
210 upconflen[nUp] = SCIPgetVarAvgConflictlength(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
211 upinfer[nUp] = SCIPgetVarAvgInferences(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
212 upcutoff[nUp] = SCIPgetVarAvgCutoffs(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
218 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_DOWNWARDS) > 0 )
221 nVarBranchingUp[nUp] = SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_UPWARDS);
222 uppscost[nUp] = SCIPgetVarPseudocost(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
223 upvsids[nUp] = SCIPgetVarVSIDS(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
224 upconflen[nUp] = SCIPgetVarAvgConflictlength(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
225 upinfer[nUp] = SCIPgetVarAvgInferences(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
226 upcutoff[nUp] = SCIPgetVarAvgCutoffs(scip, vars[i], SCIP_BRANCHDIR_UPWARDS);
229 if( SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_UPWARDS) > 0 )
232 nVarBranchingDown[nDown] = SCIPvarGetNBranchings(transformVar, SCIP_BRANCHDIR_DOWNWARDS);
233 downpscost[nDown] = SCIPgetVarPseudocost(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
234 downvsids[nDown] = SCIPgetVarVSIDS(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
235 downconflen[nDown] = SCIPgetVarAvgConflictlength(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
236 downinfer[nDown] = SCIPgetVarAvgInferences(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
237 downcutoff[nDown] = SCIPgetVarAvgCutoffs(scip, vars[i], SCIP_BRANCHDIR_DOWNWARDS);
250 SCIP_VAR **vars = SCIPgetVars(scip);
256 SCIP_CALL_ABORT( SCIPinitVarBranchStats(scip,vars[
idxLBranchStatsVarsDown[n]],
downpscost[n],0.0,
downvsids[n],0.0,
downconflen[n],0.0,
downinfer[n],0.0,
downcutoff[n],0.0) );
264 SCIP_CALL_ABORT( SCIPinitVarBranchStats(scip,vars[
idxLBranchStatsVarsUp[n]],0.0,
uppscost[n],0.0,
upvsids[n],0.0,
upconflen[n],0.0,
upinfer[n],0.0,
upcutoff[n]) );
int * idxLBranchStatsVarsUp
int * idxLBranchStatsVarsDown
void accumulateOn(SCIP *scip)
Base class of communicator object.
class for initial statistics collecting after racing
static ScipParaCommTh * comm
#define DEF_SCIP_PARA_COMM(scip_para_comm, comm)
ParaComm extension for SCIP solver.
ParaInitialStat extension for SCIP solver.