JacobianFactorQR.h
Go to the documentation of this file.
1 /*
2  * @file JacobianFactorQR.h
3  * @brief Jacobianfactor that combines and eliminates points
4  * @date Oct 27, 2013
5  * @uthor Frank Dellaert
6  */
7 
8 #pragma once
11 #include <gtsam/inference/Symbol.h>
12 
13 namespace gtsam {
14 
15 class GaussianBayesNet;
16 
20 template<size_t D, size_t ZDim>
22 
25 
26 public:
27 
32  const std::vector<MatrixZD, Eigen::aligned_allocator<MatrixZD> >& FBlocks, const Matrix& E, const Matrix3& P,
33  const Vector& b, //
34  const SharedDiagonal& model = SharedDiagonal()) :
35  Base() {
36  // Create a number of Jacobian factors in a factor graph
38  Symbol pointKey('p', 0);
39  for (size_t k = 0; k < FBlocks.size(); ++k) {
40  Key key = keys[k];
41  gfg.add(pointKey, E.block<ZDim, 3>(ZDim * k, 0), key, FBlocks[k],
42  b.segment < ZDim > (ZDim * k), model);
43  }
44  //gfg.print("gfg");
45 
46  // eliminate the point
47  boost::shared_ptr<GaussianBayesNet> bn;
49  KeyVector variables;
50  variables.push_back(pointKey);
51  boost::tie(bn, fg) = gfg.eliminatePartialSequential(variables, EliminateQR);
52  //fg->print("fg");
53 
54  JacobianFactor::operator=(JacobianFactor(*fg));
55  }
56 };
57 // end class JacobianFactorQR
58 
59 }// end namespace gtsam
Key E(std::uint64_t j)
noiseModel::Diagonal::shared_ptr model
boost::shared_ptr< This > shared_ptr
shared_ptr to this class
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:43
RegularJacobianFactor< D > Base
const vector< Matrix26, Eigen::aligned_allocator< Matrix26 > > FBlocks
const gtsam::Key pointKey
JacobianFactorQR(const KeyVector &keys, const std::vector< MatrixZD, Eigen::aligned_allocator< MatrixZD > > &FBlocks, const Matrix &E, const Matrix3 &P, const Vector &b, const SharedDiagonal &model=SharedDiagonal())
void add(const GaussianFactor &factor)
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
Eigen::VectorXd Vector
Definition: Vector.h:38
STL compatible allocator to use with types requiring a non standrad alignment.
Definition: Memory.h:721
std::pair< boost::shared_ptr< BayesNetType >, boost::shared_ptr< FactorGraphType > > eliminatePartialSequential(const Ordering &ordering, const Eliminate &function=EliminationTraitsType::DefaultEliminate, OptionalVariableIndex variableIndex=boost::none) const
JacobianFactor class with fixed sized blcoks.
Linear Factor Graph where all factors are Gaussians.
const G & b
Definition: Group.h:83
noiseModel::Diagonal::shared_ptr SharedDiagonal
Definition: NoiseModel.h:736
traits
Definition: chartTesting.h:28
const KeyVector & keys() const
Access the factor&#39;s involved variable keys.
Definition: Factor.h:124
Eigen::Matrix< double, ZDim, D > MatrixZD
The matrix class, also used for vectors and row-vectors.
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
friend GTSAM_EXPORT std::pair< boost::shared_ptr< GaussianConditional >, shared_ptr > EliminateQR(const GaussianFactorGraph &factors, const Ordering &keys)


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:42:23