release/4.3a0
Duy-Nguyen Ta 2016-04-27 03:16:46 -04:00
parent 61e3a2b51d
commit 69c1fac81a
1 changed files with 1 additions and 0 deletions

View File

@ -127,6 +127,7 @@ GaussianFactorGraph::shared_ptr LPSolver::createLeastSquareFactors(
allKeys.merge(lp_.equalities.keys()); allKeys.merge(lp_.equalities.keys());
allKeys.merge(KeySet(lp_.cost.keys())); allKeys.merge(KeySet(lp_.cost.keys()));
// for vars that are not in the cost, the cost gradient is zero (g=0), so b=xk
if (cost.keys().size() != allKeys.size()) { if (cost.keys().size() != allKeys.size()) {
KeySet difference; KeySet difference;
std::set_difference(allKeys.begin(), allKeys.end(), lp_.cost.begin(), std::set_difference(allKeys.begin(), allKeys.end(), lp_.cost.begin(),