remove extra Xd of Eigen types in Argument and ReturnType

release/4.3a0
Duy-Nguyen Ta 2016-09-14 07:44:38 -04:00
parent 892b9264a4
commit 435870ebf0
2 changed files with 3 additions and 4 deletions

View File

@ -105,7 +105,7 @@ void Argument::emit_cython_pxd(FileWriter& file, const std::string& className) c
string cythonType = typeName;
if (type.isEigen()) {
cythonType = "const " + typeName + "Xd&";
cythonType = "const " + typeName + "&";
} else {
if (is_ptr) cythonType = "shared_ptr[" + typeName + "]&";
if (is_ref) cythonType = cythonType + "&";
@ -132,7 +132,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 = "<" + cythonType + "Xd>" + "(Map[" + cythonType + "Xd](" + name + "))";
cythonVar = "<" + cythonType + ">" + "(Map[" + cythonType + "](" + name + "))";
} else {
cythonVar = name;
}

View File

@ -70,8 +70,7 @@ void ReturnType::wrapTypeUnwrap(FileWriter& wrapperFile) const {
void ReturnType::emit_cython_pxd(FileWriter& file, const std::string& className) const {
string typeName = cythonClass();
string cythonType;
if (isEigen()) cythonType = typeName + "Xd";
else if (isPtr) cythonType = "shared_ptr[" + typeName + "]";
if (isPtr) cythonType = "shared_ptr[" + typeName + "]";
else cythonType = typeName;
if (typeName == "This") cythonType = className;
file.oss << cythonType;