diff --git a/wrap/Argument.cpp b/wrap/Argument.cpp index 67d5c2870..f6226f024 100644 --- a/wrap/Argument.cpp +++ b/wrap/Argument.cpp @@ -103,7 +103,7 @@ void Argument::emit_cython_pxd(FileWriter& file) const { string typeName = type.cythonClassName(); string cythonType = typeName; if (type.isEigen()) { - cythonType = "Map[" + typeName + "Xd]&"; + cythonType = "const " + typeName + "Xd&"; } else { if (is_ptr) cythonType = "shared_ptr[" + typeName + "]&"; if (is_ref) cythonType = cythonType + "&"; @@ -130,7 +130,7 @@ void Argument::emit_cython_pyx_asParam(FileWriter& file) const { cythonVar = name + "." + type.pyxCythonObj(); if (!is_ptr) cythonVar = "deref(" + cythonVar + ")"; } else if (type.isEigen()) { - cythonVar = "Map[" + cythonType + "Xd](" + name + ")"; + cythonVar = "<" + cythonType + "Xd>" + "(Map[" + cythonType + "Xd](" + name + "))"; } else { cythonVar = name; } diff --git a/wrap/tests/cythontest.h b/wrap/tests/cythontest.h index d154ff778..6c0d586ea 100644 --- a/wrap/tests/cythontest.h +++ b/wrap/tests/cythontest.h @@ -2,7 +2,7 @@ namespace gtsam { #include template class FastVector{}; -typedef gtsam::FastVector KeyVector; +typedef gtsam::FastVector KeyVector; #include template class FastList{}; @@ -20,7 +20,7 @@ class Point2 { // Standard Constructors Point2(); Point2(double x, double y); - // Point2(Vector v); + Point2(Vector v); // Testable void print(string s) const; @@ -92,7 +92,8 @@ class Pose2 { Pose2(double x, double y, double theta); Pose2(double theta, const gtsam::Point2& t); Pose2(const gtsam::Rot2& r, const gtsam::Point2& t); - // Pose2(Vector v); + Pose2(Vector v); + Pose2(Matrix T); // Testable void print(string s) const; @@ -460,10 +461,10 @@ class Values { // void update(size_t j, const gtsam::Value& val); // gtsam::Value at(size_t j) const; - template + template void insert(size_t j, const T& t); - template + template void update(size_t j, const T& t); template