gtsam  4.1.0
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>
25 #include <gtsam/nonlinear/Values.h>
27 
28 namespace gtsam {
29 
30 // Forward declare the Filter and Smoother classes for the 'synchronize' function
31 class ConcurrentFilter;
32 class ConcurrentSmoother;
33 
34 void GTSAM_UNSTABLE_EXPORT synchronize(ConcurrentFilter& filter, ConcurrentSmoother& smoother);
35 
39 class GTSAM_UNSTABLE_EXPORT ConcurrentFilter {
40 public:
41  typedef boost::shared_ptr<ConcurrentFilter> shared_ptr;
42 
45 
47  virtual ~ConcurrentFilter() {};
48 
50  virtual void print(const std::string& s = "Concurrent Filter:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
51 
53  virtual bool equals(const ConcurrentFilter& rhs, double tol = 1e-9) const = 0;
54 
59  virtual void presync() {};
60 
68  virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& separatorValues) = 0;
69 
78  virtual void getSmootherFactors(NonlinearFactorGraph& smootherFactors, Values& smootherValues) = 0;
79 
86  virtual void synchronize(const NonlinearFactorGraph& summarizedFactors, const Values& separatorValues) = 0;
87 
92  virtual void postsync() {};
93 
94 }; // ConcurrentFilter
95 
99 class GTSAM_UNSTABLE_EXPORT ConcurrentSmoother {
100 public:
101  typedef boost::shared_ptr<ConcurrentSmoother> shared_ptr;
102 
105 
107  virtual ~ConcurrentSmoother() {};
108 
110  virtual void print(const std::string& s = "Concurrent Smoother:\n", const KeyFormatter& keyFormatter = DefaultKeyFormatter) const = 0;
111 
113  virtual bool equals(const ConcurrentSmoother& rhs, double tol = 1e-9) const = 0;
114 
119  virtual void presync() {};
120 
128  virtual void getSummarizedFactors(NonlinearFactorGraph& summarizedFactors, Values& separatorValues) = 0;
129 
139  virtual void synchronize(const NonlinearFactorGraph& smootherFactors, const Values& smootherValues,
140  const NonlinearFactorGraph& summarizedFactors, const Values& rootValues) = 0;
141 
146  virtual void postsync() {};
147 
148 }; // ConcurrentSmoother
149 
150 namespace internal {
151 
154  NonlinearFactorGraph calculateMarginalFactors(const NonlinearFactorGraph& graph, const Values& theta,
155  const KeySet& remainingKeys, const GaussianFactorGraph::Eliminate& eliminateFunction);
156 
157 }
158 
159 }
gtsam::NonlinearFactorGraph
A non-linear factor graph is a graph of non-Gaussian, i.e.
Definition: NonlinearFactorGraph.h:78
gtsam::ConcurrentSmoother::getSummarizedFactors
virtual void getSummarizedFactors(NonlinearFactorGraph &summarizedFactors, Values &separatorValues)=0
Populate the provided containers with factors that constitute the smoother branch summarization neede...
GaussianFactorGraph.h
Linear Factor Graph where all factors are Gaussians.
gtsam::ConcurrentSmoother::presync
virtual void presync()
Perform any required operations before the synchronization process starts.
Definition: ConcurrentFilteringAndSmoothing.h:119
gtsam::ConcurrentFilter::print
virtual void print(const std::string &s="Concurrent Filter:\n", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const =0
Implement a standard 'print' function.
gtsam::ConcurrentFilter::getSmootherFactors
virtual void getSmootherFactors(NonlinearFactorGraph &smootherFactors, Values &smootherValues)=0
Populate the provided containers with factors being sent to the smoother from the filter.
gtsam::ConcurrentFilter::~ConcurrentFilter
virtual ~ConcurrentFilter()
Default destructor.
Definition: ConcurrentFilteringAndSmoothing.h:47
gtsam::ConcurrentSmoother::postsync
virtual void postsync()
Perform any required operations after the synchronization process finishes.
Definition: ConcurrentFilteringAndSmoothing.h:146
gtsam::ConcurrentSmoother
The interface for the 'Smoother' portion of the Concurrent Filtering and Smoother architecture.
Definition: ConcurrentFilteringAndSmoothing.h:99
NonlinearFactorGraph.h
Factor Graph Constsiting of non-linear factors.
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::Eliminate
boost::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:89
gtsam::ConcurrentSmoother::ConcurrentSmoother
ConcurrentSmoother()
Default constructor.
Definition: ConcurrentFilteringAndSmoothing.h:104
gtsam
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
gtsam::ConcurrentFilter::presync
virtual void presync()
Perform any required operations before the synchronization process starts.
Definition: ConcurrentFilteringAndSmoothing.h:59
gtsam::ConcurrentFilter::ConcurrentFilter
ConcurrentFilter()
Default constructor.
Definition: ConcurrentFilteringAndSmoothing.h:44
gtsam::ConcurrentFilter::synchronize
virtual void synchronize(const NonlinearFactorGraph &summarizedFactors, const Values &separatorValues)=0
Apply the updated version of the smoother branch summarized factors.
gtsam::ConcurrentSmoother::equals
virtual bool equals(const ConcurrentSmoother &rhs, double tol=1e-9) const =0
Check if two Concurrent Smoothers are equal.
gtsam::ConcurrentSmoother::synchronize
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...
gtsam::ConcurrentSmoother::print
virtual void print(const std::string &s="Concurrent Smoother:\n", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const =0
Implement a standard 'print' function.
gtsam::KeyFormatter
boost::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
gtsam::ConcurrentSmoother::~ConcurrentSmoother
virtual ~ConcurrentSmoother()
Default destructor.
Definition: ConcurrentFilteringAndSmoothing.h:107
gtsam::Values
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:71
gtsam::ConcurrentFilter::equals
virtual bool equals(const ConcurrentFilter &rhs, double tol=1e-9) const =0
Check if two Concurrent Smoothers are equal.
Values.h
A non-templated config holding any types of Manifold-group elements.
gtsam::ConcurrentFilter::postsync
virtual void postsync()
Perform any required operations after the synchronization process finishes.
Definition: ConcurrentFilteringAndSmoothing.h:92
gtsam::ConcurrentFilter
The interface for the 'Filter' portion of the Concurrent Filtering and Smoother architecture.
Definition: ConcurrentFilteringAndSmoothing.h:39
gtsam::ConcurrentFilter::getSummarizedFactors
virtual void getSummarizedFactors(NonlinearFactorGraph &summarizedFactors, Values &separatorValues)=0
Populate the provided containers with factors that constitute the filter branch summarization needed ...