| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | #include <wrap/matlab.h>
 | 
					
						
							|  |  |  | #include <map>
 | 
					
						
							|  |  |  | #include <boost/foreach.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:03 +08:00
										 |  |  | #include <boost/serialization/export.hpp>
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:49:57 +08:00
										 |  |  | #include <boost/archive/text_iarchive.hpp>
 | 
					
						
							|  |  |  | #include <boost/archive/text_oarchive.hpp>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | #include <folder/path/to/Test.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:04 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:05 +08:00
										 |  |  | BOOST_CLASS_EXPORT_GUID(Point2, "Point2"); | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:03 +08:00
										 |  |  | BOOST_CLASS_EXPORT_GUID(Point3, "Point3"); | 
					
						
							| 
									
										
										
										
											2012-07-12 10:11:36 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | typedef std::set<boost::shared_ptr<Point2>*> Collector_Point2; | 
					
						
							|  |  |  | static Collector_Point2 collector_Point2; | 
					
						
							|  |  |  | typedef std::set<boost::shared_ptr<Point3>*> Collector_Point3; | 
					
						
							|  |  |  | static Collector_Point3 collector_Point3; | 
					
						
							|  |  |  | typedef std::set<boost::shared_ptr<Test>*> Collector_Test; | 
					
						
							|  |  |  | static Collector_Test collector_Test; | 
					
						
							| 
									
										
										
										
											2012-07-11 22:54:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | void _deleteAllObjects() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |   mstream mout; | 
					
						
							|  |  |  |   std::streambuf *outbuf = std::cout.rdbuf(&mout); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   bool anyDeleted = false; | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   { for(Collector_Point2::iterator iter = collector_Point2.begin(); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |       iter != collector_Point2.end(); ) { | 
					
						
							|  |  |  |     delete *iter; | 
					
						
							|  |  |  |     collector_Point2.erase(iter++); | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |     anyDeleted = true; | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   } } | 
					
						
							|  |  |  |   { for(Collector_Point3::iterator iter = collector_Point3.begin(); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |       iter != collector_Point3.end(); ) { | 
					
						
							|  |  |  |     delete *iter; | 
					
						
							|  |  |  |     collector_Point3.erase(iter++); | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |     anyDeleted = true; | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   } } | 
					
						
							|  |  |  |   { for(Collector_Test::iterator iter = collector_Test.begin(); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |       iter != collector_Test.end(); ) { | 
					
						
							|  |  |  |     delete *iter; | 
					
						
							|  |  |  |     collector_Test.erase(iter++); | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |     anyDeleted = true; | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   } } | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |   if(anyDeleted) | 
					
						
							|  |  |  |     cout << | 
					
						
							|  |  |  |       "WARNING:  Wrap modules with variables in the workspace have been reloaded due to\n" | 
					
						
							|  |  |  |       "calling destructors, call 'clear all' again if you plan to now recompile a wrap\n" | 
					
						
							|  |  |  |       "module, so that your recompiled module is used instead of the old one." << endl; | 
					
						
							|  |  |  |   std::cout.rdbuf(outbuf); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  | void _geometry_RTTIRegister() { | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |   const mxArray *alreadyCreated = mexGetVariablePtr("global", "gtsam_geometry_rttiRegistry_created"); | 
					
						
							|  |  |  |   if(!alreadyCreated) { | 
					
						
							|  |  |  |     std::map<std::string, std::string> types; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     mxArray *registry = mexGetVariable("global", "gtsamwrap_rttiRegistry"); | 
					
						
							|  |  |  |     if(!registry) | 
					
						
							|  |  |  |       registry = mxCreateStructMatrix(1, 1, 0, NULL); | 
					
						
							|  |  |  |     typedef std::pair<std::string, std::string> StringPair; | 
					
						
							|  |  |  |     BOOST_FOREACH(const StringPair& rtti_matlab, types) { | 
					
						
							|  |  |  |       int fieldId = mxAddField(registry, rtti_matlab.first.c_str()); | 
					
						
							|  |  |  |       if(fieldId < 0) | 
					
						
							|  |  |  |         mexErrMsgTxt("gtsam wrap:  Error indexing RTTI types, inheritance will not work correctly"); | 
					
						
							|  |  |  |       mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str()); | 
					
						
							|  |  |  |       mxSetFieldByNumber(registry, 0, fieldId, matlabName); | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  |     if(mexPutVariable("global", "gtsamwrap_rttiRegistry", registry) != 0) | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  |       mexErrMsgTxt("gtsam wrap:  Error indexing RTTI types, inheritance will not work correctly"); | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |     mxDestroyArray(registry); | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     mxArray *newAlreadyCreated = mxCreateNumericMatrix(0, 0, mxINT8_CLASS, mxREAL); | 
					
						
							|  |  |  |     if(mexPutVariable("global", "gtsam_geometry_rttiRegistry_created", newAlreadyCreated) != 0) | 
					
						
							|  |  |  |       mexErrMsgTxt("gtsam wrap:  Error indexing RTTI types, inheritance will not work correctly"); | 
					
						
							|  |  |  |     mxDestroyArray(newAlreadyCreated); | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  | void Point2_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Shared *self = *reinterpret_cast<Shared**> (mxGetData(in[0])); | 
					
						
							|  |  |  |   collector_Point2.insert(self); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | void Point2_constructor_1(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Shared *self = new Shared(new Point2()); | 
					
						
							|  |  |  |   collector_Point2.insert(self); | 
					
						
							|  |  |  |   out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); | 
					
						
							|  |  |  |   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_constructor_2(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   double x = unwrap< double >(in[0]); | 
					
						
							|  |  |  |   double y = unwrap< double >(in[1]); | 
					
						
							|  |  |  |   Shared *self = new Shared(new Point2(x,y)); | 
					
						
							|  |  |  |   collector_Point2.insert(self); | 
					
						
							|  |  |  |   out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); | 
					
						
							|  |  |  |   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_deconstructor_3(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("delete_Point2",nargout,nargin,1); | 
					
						
							|  |  |  |   Shared *self = *reinterpret_cast<Shared**>(mxGetData(in[0])); | 
					
						
							|  |  |  |   Collector_Point2::iterator item; | 
					
						
							|  |  |  |   item = collector_Point2.find(self); | 
					
						
							|  |  |  |   if(item != collector_Point2.end()) { | 
					
						
							|  |  |  |     delete self; | 
					
						
							|  |  |  |     collector_Point2.erase(item); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_argChar_4(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("argChar",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   char a = unwrap< char >(in[1]); | 
					
						
							|  |  |  |   obj->argChar(a); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_argUChar_5(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("argUChar",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   unsigned char a = unwrap< unsigned char >(in[1]); | 
					
						
							|  |  |  |   obj->argUChar(a); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_dim_6(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("dim",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							|  |  |  |   out[0] = wrap< int >(obj->dim()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_returnChar_7(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("returnChar",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							|  |  |  |   out[0] = wrap< char >(obj->returnChar()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_vectorConfusion_8(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<VectorNotEigen> SharedVectorNotEigen; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("vectorConfusion",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  |   out[0] = wrap_shared_ptr(SharedVectorNotEigen(new VectorNotEigen(obj->vectorConfusion())),"VectorNotEigen", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_x_9(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("x",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							|  |  |  |   out[0] = wrap< double >(obj->x()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point2_y_10(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> Shared; | 
					
						
							|  |  |  |   checkArguments("y",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point2>(in[0], "ptr_Point2"); | 
					
						
							|  |  |  |   out[0] = wrap< double >(obj->y()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  | void Point3_collectorInsertAndMakeBase_11(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Shared *self = *reinterpret_cast<Shared**> (mxGetData(in[0])); | 
					
						
							|  |  |  |   collector_Point3.insert(self); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | void Point3_constructor_12(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   double x = unwrap< double >(in[0]); | 
					
						
							|  |  |  |   double y = unwrap< double >(in[1]); | 
					
						
							|  |  |  |   double z = unwrap< double >(in[2]); | 
					
						
							|  |  |  |   Shared *self = new Shared(new Point3(x,y,z)); | 
					
						
							|  |  |  |   collector_Point3.insert(self); | 
					
						
							|  |  |  |   out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); | 
					
						
							|  |  |  |   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point3_deconstructor_13(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  |   checkArguments("delete_Point3",nargout,nargin,1); | 
					
						
							|  |  |  |   Shared *self = *reinterpret_cast<Shared**>(mxGetData(in[0])); | 
					
						
							|  |  |  |   Collector_Point3::iterator item; | 
					
						
							|  |  |  |   item = collector_Point3.find(self); | 
					
						
							|  |  |  |   if(item != collector_Point3.end()) { | 
					
						
							|  |  |  |     delete self; | 
					
						
							|  |  |  |     collector_Point3.erase(item); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Point3_norm_14(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  |   checkArguments("norm",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Point3>(in[0], "ptr_Point3"); | 
					
						
							|  |  |  |   out[0] = wrap< double >(obj->norm()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:49:59 +08:00
										 |  |  | void Point3_string_serialize_15(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  |   checkArguments("string_serialize",nargout,nargin-1,0); | 
					
						
							|  |  |  |   Shared obj = unwrap_shared_ptr<Point3>(in[0], "ptr_Point3"); | 
					
						
							|  |  |  |   std::ostringstream out_archive_stream; | 
					
						
							|  |  |  |   boost::archive::text_oarchive out_archive(out_archive_stream); | 
					
						
							|  |  |  |   out_archive << *obj; | 
					
						
							|  |  |  |   out[0] = wrap< string >(out_archive_stream.str()); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | void Point3_StaticFunctionRet_16(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> SharedPoint3; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  |   checkArguments("Point3.StaticFunctionRet",nargout,nargin,1); | 
					
						
							|  |  |  |   double z = unwrap< double >(in[0]); | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   out[0] = wrap_shared_ptr(SharedPoint3(new Point3(Point3::StaticFunctionRet(z))),"Point3", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:49:59 +08:00
										 |  |  | void Point3_staticFunction_17(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  |   checkArguments("Point3.staticFunction",nargout,nargin,0); | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   out[0] = wrap< double >(Point3::staticFunction()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:49:57 +08:00
										 |  |  | void Point3_string_deserialize_18(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point3> Shared; | 
					
						
							|  |  |  |   checkArguments("Point3.string_deserialize",nargout,nargin,1); | 
					
						
							|  |  |  |   string serialized = unwrap< string >(in[0]); | 
					
						
							|  |  |  |   std::istringstream in_archive_stream(serialized); | 
					
						
							|  |  |  |   boost::archive::text_iarchive in_archive(in_archive_stream); | 
					
						
							|  |  |  |   Shared output(new Point3()); | 
					
						
							| 
									
										
										
										
											2013-06-20 01:49:59 +08:00
										 |  |  |   in_archive >> *output; | 
					
						
							| 
									
										
										
										
											2013-06-20 01:49:57 +08:00
										 |  |  |   out[0] = wrap_shared_ptr(output,"Point3", false); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_collectorInsertAndMakeBase_19(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Shared *self = *reinterpret_cast<Shared**> (mxGetData(in[0])); | 
					
						
							|  |  |  |   collector_Test.insert(self); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_constructor_20(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   Shared *self = new Shared(new Test()); | 
					
						
							|  |  |  |   collector_Test.insert(self); | 
					
						
							|  |  |  |   out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); | 
					
						
							|  |  |  |   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_constructor_21(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   mexAtExit(&_deleteAllObjects); | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   double a = unwrap< double >(in[0]); | 
					
						
							|  |  |  |   Matrix b = unwrap< Matrix >(in[1]); | 
					
						
							|  |  |  |   Shared *self = new Shared(new Test(a,b)); | 
					
						
							|  |  |  |   collector_Test.insert(self); | 
					
						
							|  |  |  |   out[0] = mxCreateNumericMatrix(1, 1, mxUINT32OR64_CLASS, mxREAL); | 
					
						
							|  |  |  |   *reinterpret_cast<Shared**> (mxGetData(out[0])) = self; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_deconstructor_22(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("delete_Test",nargout,nargin,1); | 
					
						
							|  |  |  |   Shared *self = *reinterpret_cast<Shared**>(mxGetData(in[0])); | 
					
						
							|  |  |  |   Collector_Test::iterator item; | 
					
						
							|  |  |  |   item = collector_Test.find(self); | 
					
						
							|  |  |  |   if(item != collector_Test.end()) { | 
					
						
							|  |  |  |     delete self; | 
					
						
							|  |  |  |     collector_Test.erase(item); | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_arg_EigenConstRef_23(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("arg_EigenConstRef",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							|  |  |  |   Matrix& value = *unwrap_shared_ptr< Matrix >(in[1], "ptr_Matrix"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   obj->arg_EigenConstRef(value); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_create_MixedPtrs_24(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("create_MixedPtrs",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   pair< Test, SharedTest > pairResult = obj->create_MixedPtrs(); | 
					
						
							|  |  |  |   out[0] = wrap_shared_ptr(SharedTest(new Test(pairResult.first)),"Test", false); | 
					
						
							|  |  |  |   out[1] = wrap_shared_ptr(pairResult.second,"Test", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_create_ptrs_25(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("create_ptrs",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   pair< SharedTest, SharedTest > pairResult = obj->create_ptrs(); | 
					
						
							|  |  |  |   out[0] = wrap_shared_ptr(pairResult.first,"Test", false); | 
					
						
							|  |  |  |   out[1] = wrap_shared_ptr(pairResult.second,"Test", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_print_26(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("print",nargout,nargin-1,0); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   obj->print(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_Point2Ptr_27(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Point2> SharedPoint2; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_Point2Ptr",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   bool value = unwrap< bool >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  |   out[0] = wrap_shared_ptr(obj->return_Point2Ptr(value),"Point2", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_Test_28(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_Test",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							|  |  |  |   boost::shared_ptr<Test> value = unwrap_shared_ptr< Test >(in[1], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  |   out[0] = wrap_shared_ptr(SharedTest(new Test(obj->return_Test(value))),"Test", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_TestPtr_29(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_TestPtr",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							|  |  |  |   boost::shared_ptr<Test> value = unwrap_shared_ptr< Test >(in[1], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-11 23:58:01 +08:00
										 |  |  |   out[0] = wrap_shared_ptr(obj->return_TestPtr(value),"Test", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_bool_30(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_bool",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   bool value = unwrap< bool >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< bool >(obj->return_bool(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_double_31(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_double",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   double value = unwrap< double >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< double >(obj->return_double(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_field_32(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_field",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							|  |  |  |   Test& t = *unwrap_shared_ptr< Test >(in[1], "ptr_Test"); | 
					
						
							|  |  |  |   out[0] = wrap< bool >(obj->return_field(t)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_int_33(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_int",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   int value = unwrap< int >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< int >(obj->return_int(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_matrix1_34(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_matrix1",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   Matrix value = unwrap< Matrix >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< Matrix >(obj->return_matrix1(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_matrix2_35(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_matrix2",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   Matrix value = unwrap< Matrix >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< Matrix >(obj->return_matrix2(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_pair_36(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_pair",nargout,nargin-1,2); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   Vector v = unwrap< Vector >(in[1]); | 
					
						
							|  |  |  |   Matrix A = unwrap< Matrix >(in[2]); | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   pair< Vector, Matrix > pairResult = obj->return_pair(v,A); | 
					
						
							|  |  |  |   out[0] = wrap< Vector >(pairResult.first); | 
					
						
							|  |  |  |   out[1] = wrap< Matrix >(pairResult.second); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_ptrs_37(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> SharedTest; | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_ptrs",nargout,nargin-1,2); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							|  |  |  |   boost::shared_ptr<Test> p1 = unwrap_shared_ptr< Test >(in[1], "ptr_Test"); | 
					
						
							|  |  |  |   boost::shared_ptr<Test> p2 = unwrap_shared_ptr< Test >(in[2], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-28 03:16:00 +08:00
										 |  |  |   pair< SharedTest, SharedTest > pairResult = obj->return_ptrs(p1,p2); | 
					
						
							|  |  |  |   out[0] = wrap_shared_ptr(pairResult.first,"Test", false); | 
					
						
							|  |  |  |   out[1] = wrap_shared_ptr(pairResult.second,"Test", false); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_size_t_38(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_size_t",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   size_t value = unwrap< size_t >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< size_t >(obj->return_size_t(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_string_39(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_string",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   string value = unwrap< string >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< string >(obj->return_string(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_vector1_40(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_vector1",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   Vector value = unwrap< Vector >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< Vector >(obj->return_vector1(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void Test_return_vector2_41(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   typedef boost::shared_ptr<Test> Shared; | 
					
						
							|  |  |  |   checkArguments("return_vector2",nargout,nargin-1,1); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   Shared obj = unwrap_shared_ptr<Test>(in[0], "ptr_Test"); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   Vector value = unwrap< Vector >(in[1]); | 
					
						
							| 
									
										
										
										
											2012-07-10 22:21:58 +08:00
										 |  |  |   out[0] = wrap< Vector >(obj->return_vector2(value)); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  | void aGlobalFunction_42(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							| 
									
										
										
										
											2012-07-24 02:24:35 +08:00
										 |  |  | { | 
					
						
							|  |  |  |   checkArguments("aGlobalFunction",nargout,nargin,0); | 
					
						
							|  |  |  |   out[0] = wrap< Vector >(aGlobalFunction()); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-05-26 04:28:59 +08:00
										 |  |  | void overloadedGlobalFunction_43(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   checkArguments("overloadedGlobalFunction",nargout,nargin,1); | 
					
						
							|  |  |  |   int a = unwrap< int >(in[0]); | 
					
						
							|  |  |  |   out[0] = wrap< Vector >(overloadedGlobalFunction(a)); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | void overloadedGlobalFunction_44(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   checkArguments("overloadedGlobalFunction",nargout,nargin,2); | 
					
						
							|  |  |  |   int a = unwrap< int >(in[0]); | 
					
						
							|  |  |  |   double b = unwrap< double >(in[1]); | 
					
						
							|  |  |  |   out[0] = wrap< Vector >(overloadedGlobalFunction(a,b)); | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2012-07-11 22:54:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  | void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[]) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |   mstream mout; | 
					
						
							|  |  |  |   std::streambuf *outbuf = std::cout.rdbuf(&mout); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-18 06:10:39 +08:00
										 |  |  |   _geometry_RTTIRegister(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   int id = unwrap<int>(in[0]); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |   try { | 
					
						
							|  |  |  |     switch(id) { | 
					
						
							|  |  |  |     case 0: | 
					
						
							|  |  |  |       Point2_collectorInsertAndMakeBase_0(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 1: | 
					
						
							|  |  |  |       Point2_constructor_1(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 2: | 
					
						
							|  |  |  |       Point2_constructor_2(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 3: | 
					
						
							|  |  |  |       Point2_deconstructor_3(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 4: | 
					
						
							|  |  |  |       Point2_argChar_4(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 5: | 
					
						
							|  |  |  |       Point2_argUChar_5(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 6: | 
					
						
							|  |  |  |       Point2_dim_6(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 7: | 
					
						
							|  |  |  |       Point2_returnChar_7(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 8: | 
					
						
							|  |  |  |       Point2_vectorConfusion_8(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 9: | 
					
						
							|  |  |  |       Point2_x_9(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 10: | 
					
						
							|  |  |  |       Point2_y_10(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 11: | 
					
						
							|  |  |  |       Point3_collectorInsertAndMakeBase_11(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 12: | 
					
						
							|  |  |  |       Point3_constructor_12(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 13: | 
					
						
							|  |  |  |       Point3_deconstructor_13(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 14: | 
					
						
							|  |  |  |       Point3_norm_14(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 15: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Point3_string_serialize_15(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 16: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Point3_StaticFunctionRet_16(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 17: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Point3_staticFunction_17(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 18: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Point3_string_deserialize_18(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 19: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_collectorInsertAndMakeBase_19(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 20: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_constructor_20(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 21: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_constructor_21(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 22: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_deconstructor_22(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 23: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_arg_EigenConstRef_23(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 24: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_create_MixedPtrs_24(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 25: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_create_ptrs_25(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 26: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_print_26(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 27: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_Point2Ptr_27(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 28: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_Test_28(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 29: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_TestPtr_29(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 30: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_bool_30(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 31: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_double_31(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 32: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_field_32(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 33: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_int_33(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 34: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_matrix1_34(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 35: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_matrix2_35(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 36: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_pair_36(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 37: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_ptrs_37(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 38: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_size_t_38(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 39: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_string_39(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							|  |  |  |     case 40: | 
					
						
							| 
									
										
										
										
											2013-06-20 01:50:02 +08:00
										 |  |  |       Test_return_vector1_40(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 41: | 
					
						
							|  |  |  |       Test_return_vector2_41(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 42: | 
					
						
							|  |  |  |       aGlobalFunction_42(nargout, out, nargin-1, in+1); | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |       break; | 
					
						
							| 
									
										
										
										
											2014-05-26 04:28:59 +08:00
										 |  |  |     case 43: | 
					
						
							|  |  |  |       overloadedGlobalFunction_43(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							|  |  |  |     case 44: | 
					
						
							|  |  |  |       overloadedGlobalFunction_44(nargout, out, nargin-1, in+1); | 
					
						
							|  |  |  |       break; | 
					
						
							| 
									
										
										
										
											2012-08-23 06:40:38 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |   } catch(const std::exception& e) { | 
					
						
							|  |  |  |     mexErrMsgTxt(("Exception from gtsam:\n" + std::string(e.what()) + "\n").c_str()); | 
					
						
							| 
									
										
										
										
											2012-07-09 04:23:47 +08:00
										 |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   std::cout.rdbuf(outbuf); | 
					
						
							|  |  |  | } |