Commit 474a2250 authored by Nicolas Mansard's avatar Nicolas Mansard Committed by nmansard
Browse files

Correction of a bug in vector wrapping.

parent 769715cf
......@@ -3,16 +3,11 @@ IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "DEBUG")
ENDIF()
IF(NOT BOOST_NUMPY_DIR)
SET(BOOST_NUMPY_DIR ".")
ENDIF()
FIND_PACKAGE(Boost 1.45.0)
IF(Boost_FOUND)
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" "/usr/include/python2.7" "/usr/include/eigen3" "Boost.NumPy")
LINK_DIRECTORIES(${BOOST_NUMPY_DIR})
INCLUDE_DIRECTORIES("${Boost_INCLUDE_DIRS}" "/usr/include/python2.7" "/usr/include/eigen3")
SET(Boost_USE_STATIC_LIBS OFF)
SET(Boost_USE_MULTITHREADED ON)
......@@ -22,24 +17,6 @@ IF(Boost_FOUND)
ADD_LIBRARY(eigenpy SHARED unittest/libeigenpy.cpp)
TARGET_LINK_LIBRARIES(eigenpy ${Boost_LIBRARIES})
ADD_LIBRARY(simple SHARED unittest/alpha/simple.cpp)
TARGET_LINK_LIBRARIES(simple ${Boost_LIBRARIES})
ADD_LIBRARY(mystring SHARED unittest/alpha/mystring.cpp)
TARGET_LINK_LIBRARIES(mystring ${Boost_LIBRARIES})
ADD_LIBRARY(bnpy SHARED unittest/alpha/bnpy.cpp)
TARGET_LINK_LIBRARIES(bnpy ${Boost_LIBRARIES})
ADD_LIBRARY(eigen SHARED unittest/alpha/eigen.cpp)
TARGET_LINK_LIBRARIES(eigen ${Boost_LIBRARIES} libboost_numpy.so)
ADD_LIBRARY(eigenc SHARED unittest/alpha/eigenc.cpp)
TARGET_LINK_LIBRARIES(eigenc ${Boost_LIBRARIES})
ADD_LIBRARY(eigentemplate SHARED unittest/alpha/eigentemplate.cpp)
TARGET_LINK_LIBRARIES(eigentemplate ${Boost_LIBRARIES})
ELSEIF(NOT Boost_FOUND)
MESSAGE(FATAL_ERROR "Unable to find correct Boost version. Did you set BOOST_ROOT?")
ENDIF()
......
......@@ -113,8 +113,8 @@ namespace eigenpy
const int itemsize = PyArray_ITEMSIZE(pyArray);
const int stride = PyArray_STRIDE(pyArray, rowMajor) / itemsize;;
if( (MatType::MaxSizeAtCompileTime==R)
|| (MatType::MaxSizeAtCompileTime==Eigen::Dynamic) )
if( (MatType::MaxSizeAtCompileTime!=R)
&& (MatType::MaxSizeAtCompileTime!=Eigen::Dynamic) )
{ throw eigenpy::exception("The number of elements does not fit with the vector type."); }
T* pyData = reinterpret_cast<T*>(PyArray_DATA(pyArray));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment