add push_back for containers

release/4.3a0
Varun Agrawal 2022-09-12 19:55:51 -04:00
parent 8c10a8089e
commit 5a78015832
1 changed files with 17 additions and 0 deletions

View File

@ -109,6 +109,23 @@ class GTSAM_EXPORT HybridNonlinearFactorGraph : public HybridFactorGraph {
}
}
/**
* Push back many factors as shared_ptr's in a container (factors are not
* copied)
*/
template <typename CONTAINER>
Base::Base::HasDerivedElementType<CONTAINER> push_back(
const CONTAINER& container) {
Base::push_back(container.begin(), container.end());
}
/// Push back non-pointer objects in a container (factors are copied).
template <typename CONTAINER>
Base::Base::HasDerivedValueType<CONTAINER> push_back(
const CONTAINER& container) {
Base::push_back(container.begin(), container.end());
}
/// Add a nonlinear factor as a shared ptr.
void add(boost::shared_ptr<NonlinearFactor> factor);