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 std::shared_ptr<ConcurrentFilter> shared_ptr;
42 
44  ConcurrentFilter() = default;
45 
47  virtual ~ConcurrentFilter() = default;
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 
101 class GTSAM_UNSTABLE_EXPORT ConcurrentSmoother {
102 public:
103  typedef std::shared_ptr<ConcurrentSmoother> shared_ptr;
104 
107 
109  virtual ~ConcurrentSmoother() = default;
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 
154 namespace internal {
155 
158  NonlinearFactorGraph calculateMarginalFactors(const NonlinearFactorGraph& graph, const Values& theta,
159  const KeySet& remainingKeys, const GaussianFactorGraph::Eliminate& eliminateFunction);
160 
161 }
162 
163 }
gtsam::ConcurrentFilter::postsync
virtual void postsync()
Definition: ConcurrentFilteringAndSmoothing.h:94
GaussianFactorGraph.h
Linear Factor Graph where all factors are Gaussians.
s
RealScalar s
Definition: level1_cplx_impl.h:126
e
Array< double, 1, 3 > e(1./3., 0.5, 2.)
gtsam::synchronize
void synchronize(ConcurrentFilter &filter, ConcurrentSmoother &smoother)
Definition: ConcurrentFilteringAndSmoothing.cpp:28
gtsam::ConcurrentSmoother::shared_ptr
std::shared_ptr< ConcurrentSmoother > shared_ptr
Definition: ConcurrentFilteringAndSmoothing.h:103
Values
gtsam::ConcurrentSmoother::ConcurrentSmoother
ConcurrentSmoother()
Definition: ConcurrentFilteringAndSmoothing.h:106
gtsam::ConcurrentSmoother::postsync
virtual void postsync()
Definition: ConcurrentFilteringAndSmoothing.h:150
gtsam::DefaultKeyFormatter
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition: Key.cpp:30
gtsam::ConcurrentFilter
Definition: ConcurrentFilteringAndSmoothing.h:39
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:156
gtsam::KeySet
FastSet< Key > KeySet
Definition: Key.h:96
gtsam::ConcurrentFilter::presync
virtual void presync()
Definition: ConcurrentFilteringAndSmoothing.h:61
gtsam::internal::calculateMarginalFactors
NonlinearFactorGraph calculateMarginalFactors(const NonlinearFactorGraph &graph, const Values &theta, const KeySet &remainingKeys, const GaussianFactorGraph::Eliminate &eliminateFunction)
Definition: ConcurrentFilteringAndSmoothing.cpp:54
gtsam::KeyFormatter
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
gtsam::ConcurrentSmoother
Definition: ConcurrentFilteringAndSmoothing.h:101
gtsam::NonlinearFactorGraph
Definition: NonlinearFactorGraph.h:55
gtsam::ConcurrentFilter::shared_ptr
std::shared_ptr< ConcurrentFilter > shared_ptr
Definition: ConcurrentFilteringAndSmoothing.h:41
gtsam::equals
Definition: Testable.h:112
gtsam
traits
Definition: SFMdata.h:40
NonlinearFactorGraph.h
Factor Graph consisting of non-linear factors.
gtsam::Values
Definition: Values.h:65
gtsam::EliminateableFactorGraph< GaussianFactorGraph >::Eliminate
std::function< EliminationResult(const FactorGraphType &, const Ordering &)> Eliminate
The function type that does a single dense elimination step on a subgraph.
Definition: EliminateableFactorGraph.h:88
gtsam::tol
const G double tol
Definition: Group.h:79
gtsam::ConcurrentSmoother::presync
virtual void presync()
Definition: ConcurrentFilteringAndSmoothing.h:123
internal
Definition: BandTriangularSolver.h:13
graph
NonlinearFactorGraph graph
Definition: doc/Code/OdometryExample.cpp:2
Values.h
A non-templated config holding any types of Manifold-group elements.


gtsam
Author(s):
autogenerated on Sun Dec 22 2024 04:11:17