| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | /**
 | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  |  * @file    VectorConfig.h | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |  * @brief   Factor Graph Configuration | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  |  * @author Frank Dellaert | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #pragma once
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * There are two interchangeable implementations of VectorConfig. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * VectorMap uses a straightforward stl::map of Vectors. It has O(log n) | 
					
						
							|  |  |  |  * insert and access, and is fairly fast at both. However, it has high overhead | 
					
						
							|  |  |  |  * for arithmetic operations such as +, scale, axpy etc... | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * VectorBTree uses a functional BTree as a way to access SubVectors | 
					
						
							|  |  |  |  * in an ordinary Vector. Inserting is O(n) and much slower, but accessing, | 
					
						
							|  |  |  |  * is O(log n) and might be a bit slower than VectorMap. Arithmetic operations | 
					
						
							|  |  |  |  * are blindingly fast, however. The cost is it is not as KISS as VectorMap. | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Access to vectors is now exclusively via operator[] | 
					
						
							|  |  |  |  * Vector access in VectorMap is via a Vector reference | 
					
						
							|  |  |  |  * Vector access in VectorBtree is via the SubVector type (see Vector.h) | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * Feb 16 2010: FD: I made VectorMap the default, because I decided to try | 
					
						
							|  |  |  |  * and speed up conjugate gradients by using Sparse FactorGraphs all the way. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2009-12-12 05:38:08 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  | // we use define and not typedefs as typdefs cannot be forward declared
 | 
					
						
							|  |  |  | #ifdef VECTORBTREE
 | 
					
						
							| 
									
										
										
										
											2010-01-30 12:01:49 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  | #include "VectorBTree.h"
 | 
					
						
							|  |  |  | #define VectorConfig VectorBTree
 | 
					
						
							| 
									
										
										
										
											2010-01-30 10:04:37 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  | #else
 | 
					
						
							| 
									
										
										
										
											2009-12-28 20:37:34 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  | #include "VectorMap.h"
 | 
					
						
							|  |  |  | #define VectorConfig VectorMap
 | 
					
						
							| 
									
										
										
										
											2010-01-16 13:08:29 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-17 11:29:12 +08:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2010-01-11 16:32:59 +08:00
										 |  |  | 
 |