gtsam  4.0.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 
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 }
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
The interface for the 'Filter' portion of the Concurrent Filtering and Smoother architecture.
Definition: ConcurrentFilteringAndSmoothing.h:39
ConcurrentFilter()
Default constructor.
Definition: ConcurrentFilteringAndSmoothing.h:44
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
ConcurrentSmoother()
Default constructor.
Definition: ConcurrentFilteringAndSmoothing.h:104
virtual void postsync()
Perform any required operations after the synchronization process finishes.
Definition: ConcurrentFilteringAndSmoothing.h:146
Template to create a binary predicate.
Definition: Testable.h:110
virtual void presync()
Perform any required operations before the synchronization process starts.
Definition: ConcurrentFilteringAndSmoothing.h:119
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:33
Factor Graph Constsiting of non-linear factors.
The interface for the 'Smoother' portion of the Concurrent Filtering and Smoother architecture.
Definition: ConcurrentFilteringAndSmoothing.h:99
virtual ~ConcurrentFilter()
Default destructor.
Definition: ConcurrentFilteringAndSmoothing.h:47
A non-templated config holding any types of Manifold-group elements.
virtual ~ConcurrentSmoother()
Default destructor.
Definition: ConcurrentFilteringAndSmoothing.h:107
virtual void postsync()
Perform any required operations after the synchronization process finishes.
Definition: ConcurrentFilteringAndSmoothing.h:92
A non-linear factor graph is a graph of non-Gaussian, i.e.
Definition: NonlinearFactorGraph.h:77
virtual void presync()
Perform any required operations before the synchronization process starts.
Definition: ConcurrentFilteringAndSmoothing.h:59
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Linear Factor Graph where all factors are Gaussians.
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
Symbols for exporting classes and methods from DLLs.