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