timing/DummyFactor.h
Go to the documentation of this file.
1 
7 #pragma once
8 
10 
11 namespace gtsam {
12 
16 template<typename CAMERA> //
17 class DummyFactor: public RegularImplicitSchurFactor<CAMERA> {
18 
19 public:
20 
22  typedef std::pair<Key, Matrix2D> KeyMatrix2D;
23 
25  }
26 
27  DummyFactor(const std::vector<KeyMatrix2D>& Fblocks, const Matrix& E,
28  const Matrix3& P, const Vector& b) :
29  RegularImplicitSchurFactor<CAMERA>(Fblocks, E, P, b) {
30  }
31 
32  virtual ~DummyFactor() {
33  }
34 
35 public:
36 
40  void multiplyHessian(double alpha, const VectorValues& x,
41  VectorValues& y) const {
42 
43  for(const KeyMatrix2D& Fi: this->Fblocks_) {
44  static const Vector empty;
45  Key key = Fi.first;
46  std::pair<VectorValues::iterator, bool> it = y.tryInsert(key, empty);
47  Vector& yi = it.first->second;
48  yi = x.at(key);
49  }
50  }
51 
52 };
53 // DummyFactor
54 
55 }
56 
gtsam::DummyFactor::DummyFactor
DummyFactor()
Definition: timing/DummyFactor.h:24
alpha
RealScalar alpha
Definition: level1_cplx_impl.h:147
gtsam::DummyFactor::multiplyHessian
void multiplyHessian(double alpha, const VectorValues &x, VectorValues &y) const
Dummy version to measure overhead of key access.
Definition: timing/DummyFactor.h:40
x
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Definition: gnuplot_common_settings.hh:12
gtsam::RegularImplicitSchurFactor
Definition: RegularImplicitSchurFactor.h:39
gtsam::Factor::empty
bool empty() const
Whether the factor is empty (involves zero variables).
Definition: Factor.h:131
gtsam::Matrix
Eigen::MatrixXd Matrix
Definition: base/Matrix.h:39
gtsam::Vector
Eigen::VectorXd Vector
Definition: Vector.h:38
gtsam::DummyFactor::Matrix2D
Eigen::Matrix< double, 2, CAMERA::dimension > Matrix2D
Definition: timing/DummyFactor.h:21
gtsam::DummyFactor::KeyMatrix2D
std::pair< Key, Matrix2D > KeyMatrix2D
Definition: timing/DummyFactor.h:22
gtsam::VectorValues
Definition: VectorValues.h:74
y
Scalar * y
Definition: level1_cplx_impl.h:124
key
const gtsam::Symbol key('X', 0)
E
DiscreteKey E(5, 2)
gtsam::DummyFactor::~DummyFactor
virtual ~DummyFactor()
Definition: timing/DummyFactor.h:32
gtsam::b
const G & b
Definition: Group.h:79
empty
Definition: test_copy_move.cpp:19
gtsam
traits
Definition: SFMdata.h:40
P
static double P[]
Definition: ellpe.c:68
Eigen::Matrix
The matrix class, also used for vectors and row-vectors.
Definition: 3rdparty/Eigen/Eigen/src/Core/Matrix.h:178
RegularImplicitSchurFactor.h
A subclass of GaussianFactor specialized to structureless SFM.
gtsam::Key
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:97
gtsam::DummyFactor::DummyFactor
DummyFactor(const std::vector< KeyMatrix2D > &Fblocks, const Matrix &E, const Matrix3 &P, const Vector &b)
Definition: timing/DummyFactor.h:27


gtsam
Author(s):
autogenerated on Sat Nov 16 2024 04:02:14