auto and reserve fewer

release/4.3a0
Gerry Chen 2021-01-27 16:58:05 -05:00
parent 2590b3b980
commit 53261a5e16
1 changed files with 2 additions and 3 deletions

View File

@ -126,7 +126,7 @@ namespace gtsam {
// Iterate over all factors, adding sparse scalar entries
SparseTriplets entries;
entries.reserve(60 * size());
entries.reserve(30 * size());
nrows = 0;
for (const auto& factor : *this) {
if (!static_cast<bool>(factor)) continue;
@ -148,8 +148,7 @@ namespace gtsam {
// Whiten the factor and add entries for it
// iterate over all variables in the factor
const JacobianFactor whitened(jacobianFactor->whiten());
for (JacobianFactor::const_iterator key = whitened.begin();
key < whitened.end(); ++key) {
for (auto key = whitened.begin(); key < whitened.end(); ++key) {
JacobianFactor::constABlock whitenedA = whitened.getA(key);
// find first column index for this key
size_t column_start = columnIndices[*key];