remove the artificial zero priors to make testLPSolver passed with costs that don't include all vars. Why did I think I need the zero priors??
parent
9c1952cd1f
commit
61e3a2b51d
|
@ -27,7 +27,7 @@ LPSolver::LPSolver(const LP &lp) :
|
||||||
|
|
||||||
// Create and push zero priors of constrained variables that do not exist in
|
// Create and push zero priors of constrained variables that do not exist in
|
||||||
// the cost function
|
// the cost function
|
||||||
baseGraph_.push_back(*createZeroPriors(lp_.cost.keys(), keysDim_));
|
// baseGraph_.push_back(*createZeroPriors(lp_.cost.keys(), keysDim_));
|
||||||
|
|
||||||
// Variable index
|
// Variable index
|
||||||
equalityVariableIndex_ = VariableIndex(lp_.equalities);
|
equalityVariableIndex_ = VariableIndex(lp_.equalities);
|
||||||
|
@ -208,8 +208,8 @@ std::pair<VectorValues, VectorValues> LPSolver::optimize(
|
||||||
|
|
||||||
/// main loop of the solver
|
/// main loop of the solver
|
||||||
while (!state.converged) {
|
while (!state.converged) {
|
||||||
if(state.iterations > 10000) // Temporary break to avoid infine loops
|
// if(state.iterations > 100) // Temporary break to avoid infine loops
|
||||||
break;
|
// break;
|
||||||
state = iterate(state);
|
state = iterate(state);
|
||||||
}
|
}
|
||||||
return make_pair(state.values, state.duals);
|
return make_pair(state.values, state.duals);
|
||||||
|
|
Loading…
Reference in New Issue