| 
									
										
										
										
											2010-10-14 12:54:38 +08:00
										 |  |  | /* ----------------------------------------------------------------------------
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * GTSAM Copyright 2010, Georgia Tech Research Corporation,  | 
					
						
							|  |  |  |  * Atlanta, Georgia 30332-0415 | 
					
						
							|  |  |  |  * All Rights Reserved | 
					
						
							|  |  |  |  * Authors: Frank Dellaert, et al. (see THANKS for the full author list) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * See LICENSE for the license information | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |  * -------------------------------------------------------------------------- */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-27 06:48:41 +08:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @file    Errors.h | 
					
						
							|  |  |  |  * @brief   vector of errors | 
					
						
							|  |  |  |  * @author  Frank Dellaert | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // \callgraph
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <vector>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-20 01:23:19 +08:00
										 |  |  | #include <gtsam/base/Testable.h>
 | 
					
						
							|  |  |  | #include <gtsam/base/Vector.h>
 | 
					
						
							| 
									
										
										
										
											2010-10-15 00:08:16 +08:00
										 |  |  | #include <gtsam/linear/VectorValues.h>
 | 
					
						
							| 
									
										
										
										
											2009-12-27 06:48:41 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace gtsam { | 
					
						
							|  |  |  | 	 | 
					
						
							|  |  |  |   /** vector of errors */ | 
					
						
							| 
									
										
										
										
											2009-12-31 01:13:36 +08:00
										 |  |  |   class Errors : public std::list<Vector>, public Testable<Errors> { | 
					
						
							| 
									
										
										
										
											2009-12-27 06:48:41 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   public: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-15 00:08:16 +08:00
										 |  |  |     Errors() ; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	/** break V into pieces according to its start indices */ | 
					
						
							|  |  |  | 	Errors(const VectorValues &V) ; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-27 06:48:41 +08:00
										 |  |  |   	/** print */ | 
					
						
							|  |  |  |     void print(const std::string& s = "Errors") const; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     /** equals, for unit testing */ | 
					
						
							|  |  |  |     bool equals(const Errors& expected, double tol=1e-9) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-15 00:08:16 +08:00
										 |  |  |     /** Addition */ | 
					
						
							|  |  |  |     Errors operator+(const Errors& b) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-31 18:27:16 +08:00
										 |  |  |     /** subtraction */ | 
					
						
							|  |  |  |     Errors operator-(const Errors& b) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-10-15 00:08:16 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-27 06:48:41 +08:00
										 |  |  |   }; // Errors
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-28 16:15:09 +08:00
										 |  |  |   /**
 | 
					
						
							|  |  |  |    * dot product | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   double dot(const Errors& a, const Errors& b); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-21 08:01:43 +08:00
										 |  |  |   /**
 | 
					
						
							|  |  |  |    * BLAS level 2 style | 
					
						
							|  |  |  |    */ | 
					
						
							|  |  |  |   void axpy(double alpha, const Errors& x, Errors& y); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-11 16:32:59 +08:00
										 |  |  |   /** print with optional string */ | 
					
						
							|  |  |  |   void print(const Errors& a, const std::string& s = "Error"); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-27 06:48:41 +08:00
										 |  |  | } // gtsam
 |