undo C++ changes and add additional reInitialize method

release/4.3a0
Varun Agrawal 2025-02-09 11:41:47 -05:00
parent 8533ae80b6
commit 582d67eea4
2 changed files with 10 additions and 2 deletions

View File

@ -127,7 +127,7 @@ class Experiment {
auto bayesNet = linearized->eliminateSequential();
HybridValues delta = bayesNet->optimize();
initial_ = initial_.retract(delta.continuous());
smoother_.reInitialize(*bayesNet);
smoother_.reInitialize(std::move(*bayesNet));
clock_t afterUpdate = clock();
std::cout << "Took " << (afterUpdate - beforeUpdate) / CLOCKS_PER_SEC
<< " seconds." << std::endl;

View File

@ -49,8 +49,16 @@ class GTSAM_EXPORT HybridSmoother {
/**
* Re-initialize the smoother from a new hybrid Bayes Net.
*/
void reInitialize(HybridBayesNet&& hybridBayesNet) {
hybridBayesNet_ = std::move(hybridBayesNet);
}
/**
* Re-initialize the smoother from
* a new hybrid Bayes Net (non rvalue version).
*/
void reInitialize(HybridBayesNet& hybridBayesNet) {
hybridBayesNet_ = hybridBayesNet;
this->reInitialize(std::move(hybridBayesNet));
}
/**