1 #include <gtwrap/matlab.h> 4 #include <boost/archive/text_iarchive.hpp> 5 #include <boost/archive/text_oarchive.hpp> 6 #include <boost/serialization/export.hpp> 8 #include <folder/path/to/Test.h> 49 std::streambuf *outbuf = std::cout.rdbuf(&mout);
51 bool anyDeleted =
false;
120 "WARNING: Wrap modules with variables in the workspace have been reloaded due to\n" 121 "calling destructors, call 'clear all' again if you plan to now recompile a wrap\n" 122 "module, so that your recompiled module is used instead of the old one." << endl;
123 std::cout.rdbuf(outbuf);
127 const mxArray *alreadyCreated = mexGetVariablePtr(
"global",
"gtsam_geometry_rttiRegistry_created");
128 if(!alreadyCreated) {
129 std::map<std::string, std::string> types;
131 mxArray *registry = mexGetVariable(
"global",
"gtsamwrap_rttiRegistry");
133 registry = mxCreateStructMatrix(1, 1, 0,
NULL);
134 typedef std::pair<std::string, std::string> StringPair;
135 for(
const StringPair& rtti_matlab: types) {
136 int fieldId = mxAddField(registry, rtti_matlab.first.c_str());
138 mexErrMsgTxt(
"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
139 mxArray *matlabName = mxCreateString(rtti_matlab.second.c_str());
140 mxSetFieldByNumber(registry, 0, fieldId, matlabName);
142 if(mexPutVariable(
"global",
"gtsamwrap_rttiRegistry", registry) != 0)
143 mexErrMsgTxt(
"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
144 mxDestroyArray(registry);
146 mxArray *newAlreadyCreated = mxCreateNumericMatrix(0, 0, mxINT8_CLASS, mxREAL);
147 if(mexPutVariable(
"global",
"gtsam_geometry_rttiRegistry_created", newAlreadyCreated) != 0)
148 mexErrMsgTxt(
"gtsam wrap: Error indexing RTTI types, inheritance will not work correctly");
149 mxDestroyArray(newAlreadyCreated);
156 typedef boost::shared_ptr<gtsam::Point2> Shared;
158 Shared *
self = *
reinterpret_cast<Shared**
> (mxGetData(in[0]));
165 typedef boost::shared_ptr<gtsam::Point2> Shared;
170 *
reinterpret_cast<Shared**
> (mxGetData(out[0])) =
self;
176 typedef boost::shared_ptr<gtsam::Point2> Shared;
183 *
reinterpret_cast<Shared**
> (mxGetData(out[0])) =
self;
188 typedef boost::shared_ptr<gtsam::Point2> Shared;
190 Shared *
self = *
reinterpret_cast<Shared**
>(mxGetData(in[0]));
191 Collector_gtsamPoint2::iterator item;
202 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
210 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
211 boost::shared_ptr<char>
a = unwrap_shared_ptr< char >(in[1],
"ptr_char");
218 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
226 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
227 boost::shared_ptr<char>
a = unwrap_shared_ptr< char >(in[1],
"ptr_char");
234 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
235 boost::shared_ptr<char>
a = unwrap_shared_ptr< char >(in[1],
"ptr_char");
242 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
250 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
251 boost::shared_ptr<char>
a = unwrap_shared_ptr< char >(in[1],
"ptr_char");
258 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
266 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
273 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
274 Vector v = unwrap< Vector >(in[1]);
275 Matrix m = unwrap< Matrix >(in[2]);
276 obj->eigenArguments(v,m);
282 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
289 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
290 out[0] =
wrap_shared_ptr(boost::make_shared<VectorNotEigen>(obj->vectorConfusion()),
"VectorNotEigen",
false);
296 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
303 auto obj = unwrap_shared_ptr<gtsam::Point2>(in[0],
"ptr_gtsamPoint2");
310 typedef boost::shared_ptr<gtsam::Point3> Shared;
312 Shared *
self = *
reinterpret_cast<Shared**
> (mxGetData(in[0]));
319 typedef boost::shared_ptr<gtsam::Point3> Shared;
327 *
reinterpret_cast<Shared**
> (mxGetData(out[0])) =
self;
332 typedef boost::shared_ptr<gtsam::Point3> Shared;
334 Shared *
self = *
reinterpret_cast<Shared**
>(mxGetData(in[0]));
335 Collector_gtsamPoint3::iterator item;
346 auto obj = unwrap_shared_ptr<gtsam::Point3>(in[0],
"ptr_gtsamPoint3");
352 typedef boost::shared_ptr<gtsam::Point3> Shared;
354 Shared obj = unwrap_shared_ptr<gtsam::Point3>(in[0],
"ptr_gtsamPoint3");
355 ostringstream out_archive_stream;
356 boost::archive::text_oarchive out_archive(out_archive_stream);
364 out[0] = wrap< Point3 >(gtsam::Point3::StaticFunctionRet(z));
375 typedef boost::shared_ptr<gtsam::Point3> Shared;
376 checkArguments(
"gtsamPoint3.string_deserialize",nargout,nargin,1);
378 istringstream in_archive_stream(serialized);
379 boost::archive::text_iarchive in_archive(in_archive_stream);
381 in_archive >> *output;
385 void mexFunction(
int nargout, mxArray *out[],
int nargin,
const mxArray *in[])
388 std::streambuf *outbuf = std::cout.rdbuf(&mout);
475 }
catch(
const std::exception&
e) {
476 mexErrMsgTxt((
"Exception from gtsam:\n" + std::string(e.what()) +
"\n").c_str());
479 std::cout.rdbuf(outbuf);
int unwrap< int >(const mxArray *array)
std::set< boost::shared_ptr< Test > * > Collector_Test
std::set< boost::shared_ptr< MultipleTemplatesIntDouble > * > Collector_MultipleTemplatesIntDouble
std::set< boost::shared_ptr< gtsam::Point2 > * > Collector_gtsamPoint2
std::set< boost::shared_ptr< Test > * > Collector_Test
void _geometry_RTTIRegister()
void gtsamPoint2_x_16(int nargout, mxArray *out[], int nargin, const mxArray *in[])
PrimitiveRef< double > PrimitiveRefDouble
void gtsamPoint3_collectorInsertAndMakeBase_18(int nargout, mxArray *out[], int nargin, const mxArray *in[])
char unwrap< char >(const mxArray *array)
void checkArguments(const string &name, int nargout, int nargin, int expected)
void gtsamPoint2_eigenArguments_13(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint2_deconstructor_3(int nargout, mxArray *out[], int nargin, const mxArray *in[])
string unwrap< string >(const mxArray *array)
iterator iter(handle obj)
void gtsamPoint2_argChar_5(int nargout, mxArray *out[], int nargin, const mxArray *in[])
static Collector_Test collector_Test
std::set< boost::shared_ptr< gtsam::Point3 > * > Collector_gtsamPoint3
unsigned char unwrap< unsigned char >(const mxArray *array)
std::set< boost::shared_ptr< MyVector12 > * > Collector_MyVector12
mxArray * wrap_shared_ptr(boost::shared_ptr< Class > shared_ptr, const std::string &matlabName, bool isVirtual)
MyVector< 12 > MyVector12
GeneralSFMFactor< SfmCamera, Point3 > MyFactor
std::set< boost::shared_ptr< MultipleTemplatesIntDouble > * > Collector_MultipleTemplatesIntDouble
void gtsamPoint2_constructor_1(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint3_deconstructor_20(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint2_argChar_9(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint2_argChar_8(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint2_argChar_4(int nargout, mxArray *out[], int nargin, const mxArray *in[])
MultipleTemplates< int, double > MultipleTemplatesIntDouble
static Collector_MyVector12 collector_MyVector12
std::set< boost::shared_ptr< FunRange > * > Collector_FunRange
void mexFunction(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint3_constructor_19(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< MultipleTemplatesIntFloat > * > Collector_MultipleTemplatesIntFloat
static Collector_FunDouble collector_FunDouble
void gtsamPoint2_y_17(int nargout, mxArray *out[], int nargin, const mxArray *in[])
double unwrap< double >(const mxArray *array)
std::set< boost::shared_ptr< MyFactorPosePoint2 > * > Collector_MyFactorPosePoint2
static Collector_PrimitiveRefDouble collector_PrimitiveRefDouble
static Collector_MultipleTemplatesIntDouble collector_MultipleTemplatesIntDouble
void gtsamPoint2_argChar_10(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint3_StaticFunctionRet_23(int nargout, mxArray *out[], int nargin, const mxArray *in[])
static Collector_MyVector3 collector_MyVector3
void gtsamPoint2_constructor_2(int nargout, mxArray *out[], int nargin, const mxArray *in[])
mxArray * wrap< char >(const char &value)
void gtsamPoint3_string_deserialize_25(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< FunDouble > * > Collector_FunDouble
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::set< boost::shared_ptr< PrimitiveRefDouble > * > Collector_PrimitiveRefDouble
BOOST_CLASS_EXPORT_GUID(gtsam::Point2,"gtsamPoint2")
std::set< boost::shared_ptr< MyVector12 > * > Collector_MyVector12
void gtsamPoint2_dim_12(int nargout, mxArray *out[], int nargin, const mxArray *in[])
void gtsamPoint3_staticFunction_24(int nargout, mxArray *out[], int nargin, const mxArray *in[])
static Collector_gtsamPoint3 collector_gtsamPoint3
mxArray * wrap< int >(const int &value)
void gtsamPoint3_norm_21(int nargout, mxArray *out[], int nargin, const mxArray *in[])
mxArray * wrap< double >(const double &value)
static Collector_FunRange collector_FunRange
static Collector_MyFactorPosePoint2 collector_MyFactorPosePoint2
std::set< boost::shared_ptr< MyVector3 > * > Collector_MyVector3
std::set< boost::shared_ptr< MyFactorPosePoint2 > * > Collector_MyFactorPosePoint2
void gtsamPoint2_argChar_7(int nargout, mxArray *out[], int nargin, const mxArray *in[])
#define mxUINT32OR64_CLASS
std::set< boost::shared_ptr< PrimitiveRefDouble > * > Collector_PrimitiveRefDouble
void gtsamPoint3_string_serialize_22(int nargout, mxArray *out[], int nargin, const mxArray *in[])
static Collector_gtsamPoint2 collector_gtsamPoint2
std::set< boost::shared_ptr< FunRange > * > Collector_FunRange
void gtsamPoint2_argUChar_11(int nargout, mxArray *out[], int nargin, const mxArray *in[])
mxArray * wrap< string >(const string &value)
MyFactor< gtsam::Pose2, gtsam::Matrix > MyFactorPosePoint2
void gtsamPoint2_collectorInsertAndMakeBase_0(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< MyVector3 > * > Collector_MyVector3
Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic, Eigen::RowMajor > Matrix
void gtsamPoint2_argChar_6(int nargout, mxArray *out[], int nargin, const mxArray *in[])
MultipleTemplates< int, float > MultipleTemplatesIntFloat
static Collector_MultipleTemplatesIntFloat collector_MultipleTemplatesIntFloat
void gtsamPoint2_returnChar_14(int nargout, mxArray *out[], int nargin, const mxArray *in[])
set noclip points set clip one set noclip two set bar set border lt lw set xdata set ydata set zdata set x2data set y2data set boxwidth set dummy x
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
void gtsamPoint2_vectorConfusion_15(int nargout, mxArray *out[], int nargin, const mxArray *in[])
std::set< boost::shared_ptr< FunDouble > * > Collector_FunDouble
std::set< boost::shared_ptr< MultipleTemplatesIntFloat > * > Collector_MultipleTemplatesIntFloat