| 
									
										
										
										
											2015-02-22 21:03:13 +08:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @file    DummyFactor.h | 
					
						
							|  |  |  |  * @brief   Just to help in timing overhead | 
					
						
							|  |  |  |  * @author  Frank Dellaert | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <gtsam/slam/RegularImplicitSchurFactor.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace gtsam { | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /**
 | 
					
						
							|  |  |  |  * DummyFactor | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2015-06-28 04:29:54 +08:00
										 |  |  | template<typename CAMERA> //
 | 
					
						
							|  |  |  | class DummyFactor: public RegularImplicitSchurFactor<CAMERA> { | 
					
						
							| 
									
										
										
										
											2015-02-22 21:03:13 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-28 04:29:54 +08:00
										 |  |  |   typedef Eigen::Matrix<double, 2, CAMERA::dimension> Matrix2D; | 
					
						
							| 
									
										
										
										
											2015-02-22 21:03:13 +08:00
										 |  |  |   typedef std::pair<Key, Matrix2D> KeyMatrix2D; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   DummyFactor() { | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   DummyFactor(const std::vector<KeyMatrix2D>& Fblocks, const Matrix& E, | 
					
						
							| 
									
										
										
										
											2015-06-28 04:29:54 +08:00
										 |  |  |       const Matrix3& P, const Vector& b) : | 
					
						
							|  |  |  |       RegularImplicitSchurFactor<CAMERA>(Fblocks, E, P, b) { | 
					
						
							| 
									
										
										
										
											2015-02-22 21:03:13 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   virtual ~DummyFactor() { | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /**
 | 
					
						
							|  |  |  |    * @brief Dummy version to measure overhead of key access | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   void multiplyHessian(double alpha, const VectorValues& x, | 
					
						
							|  |  |  |       VectorValues& y) const { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-05-21 09:22:30 +08:00
										 |  |  |     for(const KeyMatrix2D& Fi: this->Fblocks_) { | 
					
						
							| 
									
										
										
										
											2015-02-22 21:03:13 +08:00
										 |  |  |       static const Vector empty; | 
					
						
							|  |  |  |       Key key = Fi.first; | 
					
						
							|  |  |  |       std::pair<VectorValues::iterator, bool> it = y.tryInsert(key, empty); | 
					
						
							|  |  |  |       Vector& yi = it.first->second; | 
					
						
							|  |  |  |       yi = x.at(key); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | // DummyFactor
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 |