From 7243a9870be26188c19a3d7b507f6ccb308ea47c Mon Sep 17 00:00:00 2001 From: Richard Roberts Date: Mon, 9 Apr 2012 13:21:16 +0000 Subject: [PATCH] Using vector::assign instead of erase in JacobianFactor::eliminate, caused invalid iterator on some STL implementations --- gtsam/linear/JacobianFactor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/linear/JacobianFactor.cpp b/gtsam/linear/JacobianFactor.cpp index 1f9dca77b..c48a62431 100644 --- a/gtsam/linear/JacobianFactor.cpp +++ b/gtsam/linear/JacobianFactor.cpp @@ -474,7 +474,7 @@ namespace gtsam { tic(4, "remaining factor"); // Take lower-right block of Ab to get the new factor Ab_.rowEnd() = noiseModel->dim(); - keys_.assign(begin() + nrFrontals, end()); + keys_.erase(begin(), begin() + nrFrontals); // Set sigmas with the right model if (noiseModel->isConstrained()) model_ = noiseModel::Constrained::MixedSigmas(sub(noiseModel->sigmas(), frontalDim, noiseModel->dim()));