diff --git a/gtsam/hybrid/HybridValues.h b/gtsam/hybrid/HybridValues.h index 944fe17e6..7bba840ca 100644 --- a/gtsam/hybrid/HybridValues.h +++ b/gtsam/hybrid/HybridValues.h @@ -118,6 +118,12 @@ class GTSAM_EXPORT HybridValues { */ Vector& at(Key j) { return continuous_.at(j); }; + /** For all key/value pairs in \c values, replace values with corresponding keys in this class + * with those in \c values. Throws std::out_of_range if any keys in \c values are not present + * in this class. */ + void update(const VectorValues& values) { continuous_.update(values); } + + /// @} /// @name Wrapper support /// @{ diff --git a/gtsam/hybrid/hybrid.i b/gtsam/hybrid/hybrid.i index 3dbf5d542..84c047fcf 100644 --- a/gtsam/hybrid/hybrid.i +++ b/gtsam/hybrid/hybrid.i @@ -16,6 +16,7 @@ class HybridValues { bool equals(const gtsam::HybridValues& other, double tol) const; void insert(gtsam::Key j, int value); void insert(gtsam::Key j, const gtsam::Vector& value); + void update(const gtsam::VectorValues& values); size_t& atDiscrete(gtsam::Key j); gtsam::Vector& at(gtsam::Key j); };