| 
									
										
										
										
											2010-01-23 01:36:57 +08:00
										 |  |  | class SharedGaussian { | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  | 	SharedGaussian(Matrix covariance); | 
					
						
							|  |  |  | 	SharedGaussian(Vector sigmas); | 
					
						
							| 
									
										
										
										
											2010-01-23 01:36:57 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SharedDiagonal { | 
					
						
							|  |  |  | 	SharedDiagonal(Vector sigmas); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  | class Ordering { | 
					
						
							|  |  |  |   Ordering(); | 
					
						
							| 
									
										
										
										
											2010-01-05 02:07:24 +08:00
										 |  |  |   Ordering(string key); | 
					
						
							|  |  |  |   Ordering subtract(const Ordering& keys) const; | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2010-01-05 02:07:24 +08:00
										 |  |  |   bool equals(const Ordering& ord, double tol) const; | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void push_back(string s); | 
					
						
							| 
									
										
										
										
											2009-12-12 05:34:08 +08:00
										 |  |  |   void unique (); | 
					
						
							| 
									
										
										
										
											2009-12-12 20:53:39 +08:00
										 |  |  |   void reverse (); | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class SymbolicFactor{ | 
					
						
							| 
									
										
										
										
											2009-11-24 03:45:09 +08:00
										 |  |  | 	SymbolicFactor(const Ordering& keys); | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  | class VectorConfig { | 
					
						
							|  |  |  |   VectorConfig(); | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const VectorConfig& expected, double tol) const; | 
					
						
							|  |  |  |   void insert(string name, Vector val); | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |   Vector get(string name) const; | 
					
						
							|  |  |  |   bool contains(string name) const; | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | class GaussianFactor { | 
					
						
							|  |  |  |   GaussianFactor(string key1, | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 	       Matrix A1, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  | 	       Vector b_in, | 
					
						
							| 
									
										
										
										
											2010-01-23 01:36:57 +08:00
										 |  |  | 	       const SharedDiagonal& model); | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  |   GaussianFactor(string key1, | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 	       Matrix A1, | 
					
						
							|  |  |  | 	       string key2, | 
					
						
							|  |  |  | 	       Matrix A2, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  | 	       Vector b_in, | 
					
						
							| 
									
										
										
										
											2010-01-23 01:36:57 +08:00
										 |  |  | 	       const SharedDiagonal& model); | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  |   GaussianFactor(string key1, | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 	       Matrix A1, | 
					
						
							|  |  |  | 	       string key2, | 
					
						
							|  |  |  | 	       Matrix A2, | 
					
						
							|  |  |  | 	       string key3, | 
					
						
							|  |  |  | 	       Matrix A3, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  | 	       Vector b_in, | 
					
						
							| 
									
										
										
										
											2010-01-23 01:36:57 +08:00
										 |  |  | 	       const SharedDiagonal& model); | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const GaussianFactor& lf, double tol) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |   bool empty() const; | 
					
						
							|  |  |  |   Vector get_b() const; | 
					
						
							|  |  |  |   Matrix get_A(string key) const; | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  |   double error(const VectorConfig& c) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |   bool involves(string key) const; | 
					
						
							|  |  |  |   pair<Matrix,Vector> matrix(const Ordering& ordering) const; | 
					
						
							| 
									
										
										
										
											2010-02-22 07:50:28 +08:00
										 |  |  |   pair<GaussianConditional*,GaussianFactor*> eliminate(string key) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-23 01:36:57 +08:00
										 |  |  | class GaussianFactorSet { | 
					
						
							|  |  |  |   GaussianFactorSet(); | 
					
						
							|  |  |  |   void push_back(GaussianFactor* factor); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-13 00:41:18 +08:00
										 |  |  | class GaussianConditional { | 
					
						
							|  |  |  |   GaussianConditional(); | 
					
						
							|  |  |  |   GaussianConditional(string key, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  |   		    Vector d, | 
					
						
							|  |  |  | 		      Matrix R, | 
					
						
							| 
									
										
										
										
											2009-11-11 15:14:13 +08:00
										 |  |  | 		      Vector sigmas); | 
					
						
							| 
									
										
										
										
											2009-11-13 00:41:18 +08:00
										 |  |  |   GaussianConditional(string key, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  |   		    Vector d, | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 		      Matrix R, | 
					
						
							|  |  |  | 		      string name1, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  | 		      Matrix S, | 
					
						
							| 
									
										
										
										
											2009-11-11 15:14:13 +08:00
										 |  |  | 		      Vector sigmas); | 
					
						
							| 
									
										
										
										
											2009-11-13 00:41:18 +08:00
										 |  |  |   GaussianConditional(string key, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  |   		    Vector d, | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 		      Matrix R, | 
					
						
							|  |  |  | 		      string name1, | 
					
						
							|  |  |  | 		      Matrix S, | 
					
						
							|  |  |  | 		      string name2, | 
					
						
							| 
									
										
										
										
											2009-11-05 11:26:04 +08:00
										 |  |  | 		      Matrix T, | 
					
						
							| 
									
										
										
										
											2009-11-11 15:14:13 +08:00
										 |  |  | 		      Vector sigmas); | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2009-11-13 00:41:18 +08:00
										 |  |  |   bool equals(const GaussianConditional &cg, double tol) const; | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void add(string key, Matrix S); | 
					
						
							|  |  |  |   Vector solve(const VectorConfig& x); | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-01 03:53:20 +08:00
										 |  |  | class GaussianBayesNet { | 
					
						
							|  |  |  |   GaussianBayesNet(); | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const GaussianBayesNet& cbn, double tol) const; | 
					
						
							| 
									
										
										
										
											2009-11-13 00:41:18 +08:00
										 |  |  |   void push_back(GaussianConditional* conditional); | 
					
						
							|  |  |  |   void push_front(GaussianConditional* conditional); | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  | class GaussianFactorGraph { | 
					
						
							|  |  |  |   GaussianFactorGraph(); | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const GaussianFactorGraph& lfgraph, double tol) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   size_t size() const; | 
					
						
							| 
									
										
										
										
											2009-11-13 00:16:32 +08:00
										 |  |  |   void push_back(GaussianFactor* ptr_f); | 
					
						
							| 
									
										
										
										
											2009-10-15 04:39:59 +08:00
										 |  |  |   double error(const VectorConfig& c) const; | 
					
						
							|  |  |  |   double probPrime(const VectorConfig& c) const; | 
					
						
							| 
									
										
										
										
											2009-12-02 00:01:29 +08:00
										 |  |  |   void combine(const GaussianFactorGraph& lfg); | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-13 00:41:18 +08:00
										 |  |  |   GaussianConditional* eliminateOne(string key); | 
					
						
							| 
									
										
										
										
											2009-11-11 15:14:13 +08:00
										 |  |  |   GaussianBayesNet* eliminate_(const Ordering& ordering); | 
					
						
							| 
									
										
										
										
											2009-11-12 06:45:08 +08:00
										 |  |  |   VectorConfig* optimize_(const Ordering& ordering); | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |   pair<Matrix,Vector> matrix(const Ordering& ordering) const; | 
					
						
							| 
									
										
										
										
											2009-11-06 13:43:03 +08:00
										 |  |  |   Matrix sparse(const Ordering& ordering) const; | 
					
						
							| 
									
										
										
										
											2009-12-28 20:37:34 +08:00
										 |  |  |   VectorConfig* steepestDescent_(const VectorConfig& x0) const; | 
					
						
							| 
									
										
										
										
											2009-12-13 11:02:14 +08:00
										 |  |  |   VectorConfig* conjugateGradientDescent_(const VectorConfig& x0) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Point2 { | 
					
						
							|  |  |  |   Point2(); | 
					
						
							|  |  |  |   Point2(double x, double y); | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |   double x(); | 
					
						
							|  |  |  |   double y(); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Point3 { | 
					
						
							|  |  |  |   Point3(); | 
					
						
							|  |  |  |   Point3(double x, double y, double z); | 
					
						
							|  |  |  |   Point3(Vector v); | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  |   void print(string s) const; | 
					
						
							| 
									
										
										
										
											2009-08-22 06:23:24 +08:00
										 |  |  |   Vector vector() const; | 
					
						
							|  |  |  |   double x(); | 
					
						
							|  |  |  |   double y(); | 
					
						
							|  |  |  |   double z(); | 
					
						
							|  |  |  | };  | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-05 02:07:24 +08:00
										 |  |  | class Pose2 { | 
					
						
							|  |  |  |   Pose2(); | 
					
						
							|  |  |  |   Pose2(const Pose2& pose); | 
					
						
							|  |  |  |   Pose2(double x, double y, double theta); | 
					
						
							|  |  |  |   Pose2(double theta, const Point2& t); | 
					
						
							|  |  |  |   Pose2(const Rot2& r, const Point2& t); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  |   bool equals(const Pose2& pose, double tol) const; | 
					
						
							|  |  |  |   double x() const; | 
					
						
							|  |  |  |   double y() const; | 
					
						
							|  |  |  |   double theta() const; | 
					
						
							| 
									
										
										
										
											2010-01-11 05:53:38 +08:00
										 |  |  |   size_t dim() const; | 
					
						
							|  |  |  |   Pose2 expmap(const Vector& v) const; | 
					
						
							|  |  |  |   Vector logmap(const Pose2& pose) const; | 
					
						
							| 
									
										
										
										
											2010-01-05 02:07:24 +08:00
										 |  |  |   Point2 t() const; | 
					
						
							|  |  |  |   Rot2 r() const; | 
					
						
							| 
									
										
										
										
											2009-12-10 03:55:25 +08:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | class Simulated2DConfig { | 
					
						
							|  |  |  | 	Simulated2DConfig(); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	void insertPose(int i, const Point2& p); | 
					
						
							|  |  |  | 	void insertPoint(int j, const Point2& p); | 
					
						
							|  |  |  | 	int nrPoses() const; | 
					
						
							|  |  |  | 	int nrPoints() const; | 
					
						
							|  |  |  | 	Point2* pose(int i); | 
					
						
							|  |  |  | 	Point2* point(int j); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-08 03:09:14 +08:00
										 |  |  | class Simulated2DOrientedConfig { | 
					
						
							|  |  |  | 	Simulated2DOrientedConfig(); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	void insertPose(int i, const Pose2& p); | 
					
						
							|  |  |  | 	void insertPoint(int j, const Point2& p); | 
					
						
							|  |  |  | 	int nrPoses() const; | 
					
						
							|  |  |  | 	int nrPoints() const; | 
					
						
							|  |  |  | 	Pose2* pose(int i); | 
					
						
							|  |  |  | 	Point2* point(int j); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  | class Simulated2DPosePrior { | 
					
						
							|  |  |  | 	Simulated2DPosePrior(Point2& mu, const SharedDiagonal& model, int i); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	GaussianFactor* linearize(const Simulated2DConfig& config) const; | 
					
						
							|  |  |  |   double error(const Simulated2DConfig& c) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-08 03:09:14 +08:00
										 |  |  | class Simulated2DOrientedPosePrior { | 
					
						
							|  |  |  | 	Simulated2DOrientedPosePrior(Pose2& mu, const SharedDiagonal& model, int i); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	GaussianFactor* linearize(const Simulated2DOrientedConfig& config) const; | 
					
						
							|  |  |  |   double error(const Simulated2DOrientedConfig& c) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  | class Simulated2DPointPrior { | 
					
						
							|  |  |  | 	Simulated2DPointPrior(Point2& mu, const SharedDiagonal& model, int i); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	GaussianFactor* linearize(const Simulated2DConfig& config) const; | 
					
						
							|  |  |  |   double error(const Simulated2DConfig& c) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Simulated2DOdometry { | 
					
						
							|  |  |  |   Simulated2DOdometry(Point2& mu, const SharedDiagonal& model, int i1, int i2); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	GaussianFactor* linearize(const Simulated2DConfig& config) const; | 
					
						
							|  |  |  |   double error(const Simulated2DConfig& c) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-04-08 05:27:16 +08:00
										 |  |  | class Simulated2DOrientedOdometry { | 
					
						
							|  |  |  | 	Simulated2DOrientedOdometry(Pose2& mu, const SharedDiagonal& model, int i1, int i2); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	GaussianFactor* linearize(const Simulated2DOrientedConfig& config) const; | 
					
						
							|  |  |  |   double error(const Simulated2DOrientedConfig& c) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-23 13:06:16 +08:00
										 |  |  | class Simulated2DMeasurement { | 
					
						
							|  |  |  |   Simulated2DMeasurement(Point2& mu, const SharedDiagonal& model, int i, int j); | 
					
						
							|  |  |  |   void print(string s) const; | 
					
						
							|  |  |  | 	GaussianFactor* linearize(const Simulated2DConfig& config) const; | 
					
						
							|  |  |  |   double error(const Simulated2DConfig& c) const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class Pose2SLAMOptimizer { | 
					
						
							|  |  |  | 	Pose2SLAMOptimizer(string dataset_name); | 
					
						
							|  |  |  | 	void print(string s) const; | 
					
						
							|  |  |  | 	void update(Vector x) const; | 
					
						
							|  |  |  | 	Vector optimize() const; | 
					
						
							|  |  |  | 	double error() const; | 
					
						
							|  |  |  | 	Matrix a1() const; | 
					
						
							|  |  |  | 	Matrix a2() const; | 
					
						
							|  |  |  | 	Vector b1() const; | 
					
						
							|  |  |  | 	Vector b2() const; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 |