| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  | /**
 | 
					
						
							|  |  |  |  * @file     LPState.h | 
					
						
							|  |  |  |  * @brief    This struct holds the state of QPSolver at each iteration     | 
					
						
							|  |  |  |  * @author   Ivan Dario Jimenez | 
					
						
							|  |  |  |  * @date     1/24/16 | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-26 22:34:05 +08:00
										 |  |  | #include <gtsam/linear/VectorValues.h>
 | 
					
						
							|  |  |  | #include "InequalityFactorGraph.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  | namespace gtsam { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-02 10:10:16 +08:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * This struct contains the state information for a single iteration of an | 
					
						
							|  |  |  |  * active set method iteration. | 
					
						
							|  |  |  |  */ | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  | struct LPState { | 
					
						
							| 
									
										
										
										
											2016-02-02 10:10:16 +08:00
										 |  |  |   // A itermediate value for the value of the final solution.
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   VectorValues values; | 
					
						
							| 
									
										
										
										
											2016-02-02 10:10:16 +08:00
										 |  |  |   // Constains the set of duals computed during the iteration that retuned this
 | 
					
						
							|  |  |  |   // state.
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   VectorValues duals; | 
					
						
							| 
									
										
										
										
											2016-02-02 10:10:16 +08:00
										 |  |  |   // An inequality Factor Graph that contains only the active constriants.
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   InequalityFactorGraph workingSet; | 
					
						
							| 
									
										
										
										
											2016-02-02 10:10:16 +08:00
										 |  |  |   // True if the algorithm has converged to a solution
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   bool converged; | 
					
						
							| 
									
										
										
										
											2016-02-02 10:10:16 +08:00
										 |  |  |   // counter for the number of iteration. Incremented at the end of each iter.
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   size_t iterations; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /// default constructor
 | 
					
						
							|  |  |  |   LPState() : | 
					
						
							| 
									
										
										
										
											2016-01-25 08:58:42 +08:00
										 |  |  |       values(), duals(), workingSet(), converged(false), iterations(0) { | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   /// constructor with initial values
 | 
					
						
							|  |  |  |   LPState(const VectorValues& initialValues, const VectorValues& initialDuals, | 
					
						
							| 
									
										
										
										
											2016-01-25 08:58:42 +08:00
										 |  |  |       const InequalityFactorGraph& initialWorkingSet, bool _converged, | 
					
						
							|  |  |  |       size_t _iterations) : | 
					
						
							|  |  |  |       values(initialValues), duals(initialDuals), workingSet(initialWorkingSet), converged( | 
					
						
							|  |  |  |           _converged), iterations(_iterations) { | 
					
						
							| 
									
										
										
										
											2016-01-25 08:44:43 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-01-25 08:58:42 +08:00
										 |  |  | } |