gtsam 4.1.1
gtsam
ConcurrentFilteringAndSmoothing.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
20// \callgraph
21#pragma once
22
23#include <gtsam_unstable/dllexport.h>
27
28namespace gtsam {
29
30// Forward declare the Filter and Smoother classes for the 'synchronize' function
31class ConcurrentFilter;
32class ConcurrentSmoother;
33
34void GTSAM_UNSTABLE_EXPORT synchronize(ConcurrentFilter& filter, ConcurrentSmoother& smoother);
35
39class GTSAM_UNSTABLE_EXPORT ConcurrentFilter {
40public:
41 typedef boost::shared_ptr<ConcurrentFilter> shared_ptr;
42
45
47 virtual ~ConcurrentFilter() {};
48
50 virtual void print(
51 const std::string& s = "Concurrent Filter:\n",
52 const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
53
55 virtual bool equals(const ConcurrentFilter& rhs, double tol = 1e-9) const = 0;
56
61 virtual void presync() {};
62
70 virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& separatorValues) = 0;
71
80 virtual void getSmootherFactors(NonlinearFactorGraph& smootherFactors, Values& smootherValues) = 0;
81
88 virtual void synchronize(const NonlinearFactorGraph& summarizedFactors, const Values& separatorValues) = 0;
89
94 virtual void postsync() {};
95
96}; // ConcurrentFilter
97
101class GTSAM_UNSTABLE_EXPORT ConcurrentSmoother {
102public:
103 typedef boost::shared_ptr<ConcurrentSmoother> shared_ptr;
104
107
110
112 virtual void print(
113 const std::string& s = "Concurrent Smoother:\n",
114 const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
115
117 virtual bool equals(const ConcurrentSmoother& rhs, double tol = 1e-9) const = 0;
118
123 virtual void presync() {};
124
132 virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& separatorValues) = 0;
133
143 virtual void synchronize(const NonlinearFactorGraph& smootherFactors, const Values& smootherValues,
144 const NonlinearFactorGraph& summarizedFactors, const Values& rootValues) = 0;
145
150 virtual void postsync() {};
151
152}; // ConcurrentSmoother
153
154namespace internal {
155
158 NonlinearFactorGraph calculateMarginalFactors(const NonlinearFactorGraph& graph, const Values& theta,
159 const KeySet& remainingKeys, const GaussianFactorGraph::Eliminate& eliminateFunction);
160
161}
162
163}
Linear Factor Graph where all factors are Gaussians.
A non-templated config holding any types of Manifold-group elements.
Factor Graph consisting of non-linear factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
std::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:89
A non-linear factor graph is a graph of non-Gaussian, i.e.
Definition: NonlinearFactorGraph.h:78
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:63
The interface for the 'Filter' portion of the Concurrent Filtering and Smoother architecture.
Definition: ConcurrentFilteringAndSmoothing.h:39
virtual void getSmootherFactors(NonlinearFactorGraph &smootherFactors, Values &smootherValues)=0
Populate the provided containers with factors being sent to the smoother from the filter.
virtual ~ConcurrentFilter()
Default destructor.
Definition: ConcurrentFilteringAndSmoothing.h:47
virtual void synchronize(const NonlinearFactorGraph &summarizedFactors, const Values &separatorValues)=0
Apply the updated version of the smoother branch summarized factors.
virtual void getSummarizedFactors(NonlinearFactorGraph &summarizedFactors, Values &separatorValues)=0
Populate the provided containers with factors that constitute the filter branch summarization needed ...
virtual bool equals(const ConcurrentFilter &rhs, double tol=1e-9) const =0
Check if two Concurrent Smoothers are equal.
virtual void print(const std::string &s="Concurrent Filter:\n", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const =0
Implement a standard 'print' function.
ConcurrentFilter()
Default constructor.
Definition: ConcurrentFilteringAndSmoothing.h:44
virtual void postsync()
Perform any required operations after the synchronization process finishes.
Definition: ConcurrentFilteringAndSmoothing.h:94
virtual void presync()
Perform any required operations before the synchronization process starts.
Definition: ConcurrentFilteringAndSmoothing.h:61
The interface for the 'Smoother' portion of the Concurrent Filtering and Smoother architecture.
Definition: ConcurrentFilteringAndSmoothing.h:101
virtual void synchronize(const NonlinearFactorGraph &smootherFactors, const Values &smootherValues, const NonlinearFactorGraph &summarizedFactors, const Values &rootValues)=0
Apply the new smoother factors sent by the filter, and the updated version of the filter branch summa...
virtual bool equals(const ConcurrentSmoother &rhs, double tol=1e-9) const =0
Check if two Concurrent Smoothers are equal.
virtual void getSummarizedFactors(NonlinearFactorGraph &summarizedFactors, Values &separatorValues)=0
Populate the provided containers with factors that constitute the smoother branch summarization neede...
ConcurrentSmoother()
Default constructor.
Definition: ConcurrentFilteringAndSmoothing.h:106
virtual void postsync()
Perform any required operations after the synchronization process finishes.
Definition: ConcurrentFilteringAndSmoothing.h:150
virtual void print(const std::string &s="Concurrent Smoother:\n", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const =0
Implement a standard 'print' function.
virtual void presync()
Perform any required operations before the synchronization process starts.
Definition: ConcurrentFilteringAndSmoothing.h:123
virtual ~ConcurrentSmoother()
Default destructor.
Definition: ConcurrentFilteringAndSmoothing.h:109