Updated synchronization interface to require the smoother and filter to track their own separator keys and values

release/4.3a0
Stephen Williams 2013-04-11 12:42:09 +00:00
parent 08e6d8860b
commit 0a459549f8
2 changed files with 11 additions and 9 deletions

View File

@ -26,20 +26,20 @@ namespace gtsam {
void synchronize(ConcurrentFilter& filter, ConcurrentSmoother& smoother) { void synchronize(ConcurrentFilter& filter, ConcurrentSmoother& smoother) {
NonlinearFactorGraph smootherFactors, filterSumarization, smootherSummarization; NonlinearFactorGraph smootherFactors, filterSumarization, smootherSummarization;
Values smootherValues, rootValues; Values smootherValues, filterSeparatorValues, smootherSeparatorValues;
// Call the pre-sync functions of the filter and smoother // Call the pre-sync functions of the filter and smoother
filter.presync(); filter.presync();
smoother.presync(); smoother.presync();
// Get the updates from the smoother and apply them to the filter // Get the updates from the smoother and apply them to the filter
smoother.getSummarizedFactors(smootherSummarization); smoother.getSummarizedFactors(smootherSummarization, smootherSeparatorValues);
filter.synchronize(smootherSummarization); filter.synchronize(smootherSummarization, smootherSeparatorValues);
// Get the updates from the filter and apply them to the smoother // Get the updates from the filter and apply them to the smoother
filter.getSmootherFactors(smootherFactors, smootherValues); filter.getSmootherFactors(smootherFactors, smootherValues);
filter.getSummarizedFactors(filterSumarization, rootValues); filter.getSummarizedFactors(filterSumarization, filterSeparatorValues);
smoother.synchronize(smootherFactors, smootherValues, filterSumarization, rootValues); smoother.synchronize(smootherFactors, smootherValues, filterSumarization, filterSeparatorValues);
// Call the post-sync functions of the filter and smoother // Call the post-sync functions of the filter and smoother
filter.postsync(); filter.postsync();

View File

@ -66,9 +66,9 @@ protected:
* needed by the smoother. Also, linearization points for the new root clique must be provided. * needed by the smoother. Also, linearization points for the new root clique must be provided.
* *
* @param summarizedFactors The summarized factors for the filter branch * @param summarizedFactors The summarized factors for the filter branch
* @param rootValues The linearization points of the root clique variables * @param separatorValues The linearization points of the separator variables
*/ */
virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& rootValues) = 0; virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& separatorValues) = 0;
/** /**
* Populate the provided containers with factors being sent to the smoother from the filter. These * Populate the provided containers with factors being sent to the smoother from the filter. These
@ -84,8 +84,9 @@ protected:
* Apply the updated version of the smoother branch summarized factors. * Apply the updated version of the smoother branch summarized factors.
* *
* @param summarizedFactors An updated version of the smoother branch summarized factors * @param summarizedFactors An updated version of the smoother branch summarized factors
* @param separatorValues The linearization points of the separator variables
*/ */
virtual void synchronize(const NonlinearFactorGraph& summarizedFactors) = 0; virtual void synchronize(const NonlinearFactorGraph& summarizedFactors, const Values& separatorValues) = 0;
/** /**
* Perform any required operations after the synchronization process finishes. * Perform any required operations after the synchronization process finishes.
@ -129,8 +130,9 @@ protected:
* needed by the filter. * needed by the filter.
* *
* @param summarizedFactors The summarized factors for the filter branch * @param summarizedFactors The summarized factors for the filter branch
* @param separatorValues The linearization points of the separator variables
*/ */
virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors) = 0; virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& separatorValues) = 0;
/** /**
* Apply the new smoother factors sent by the filter, and the updated version of the filter * Apply the new smoother factors sent by the filter, and the updated version of the filter