Merged in easymile_cyril/gtsam/fix/zero-dim-factor (pull request #319)
Allow zero dimension factorsrelease/4.3a0
commit
84442f99f2
|
@ -70,9 +70,6 @@ Scatter::Scatter(const GaussianFactorGraph& gfg,
|
|||
iterator first = begin();
|
||||
if (ordering) first += ordering->size();
|
||||
if (first != end()) std::sort(first, end());
|
||||
|
||||
// Filter out keys with zero dimensions (if ordering had more keys)
|
||||
erase(std::remove_if(begin(), end(), SlotEntry::Zero), end());
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
|
|
|
@ -113,9 +113,9 @@ struct LevenbergMarquardtState : public NonlinearOptimizerState {
|
|||
// Small cache of A|b|model indexed by dimension. Can save many mallocs.
|
||||
mutable std::vector<CachedModel> noiseModelCache;
|
||||
CachedModel* getCachedModel(size_t dim) const {
|
||||
if (dim > noiseModelCache.size())
|
||||
noiseModelCache.resize(dim);
|
||||
CachedModel* item = &noiseModelCache[dim - 1];
|
||||
if (dim >= noiseModelCache.size())
|
||||
noiseModelCache.resize(dim+1);
|
||||
CachedModel* item = &noiseModelCache[dim];
|
||||
if (!item->model)
|
||||
*item = CachedModel(dim, 1.0 / std::sqrt(lambda));
|
||||
return item;
|
||||
|
|
Loading…
Reference in New Issue