diff --git a/CMakeLists.txt b/CMakeLists.txt index ac1e31934..ee134df06 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,22 +109,6 @@ MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/eigenpy") MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/eigenpy/solvers") INCLUDE_DIRECTORIES(${${PROJECT_NAME}_BINARY_DIR}/include/eigenpy) -#FOREACH(header ${HEADERS}) -# GET_FILENAME_COMPONENT(headerName ${header} NAME) -# IF(WIN32) -# execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different -# ${${PROJECT_NAME}_SOURCE_DIR}/${header} -# ${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/) -# ELSE(WIN32) -# execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink -# ${${PROJECT_NAME}_SOURCE_DIR}/${header} -# ${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/${headerName}) -# ENDIF(WIN32) -# INSTALL(FILES ${${PROJECT_NAME}_SOURCE_DIR}/${header} -# DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME} -# PERMISSIONS OWNER_READ GROUP_READ WORLD_READ) -#ENDFOREACH(header) - SET(${PROJECT_NAME}_HEADERS) FOREACH(header ${HEADERS}) GET_FILENAME_COMPONENT(headerName ${header} NAME) diff --git a/src/angle-axis.cpp b/src/angle-axis.cpp index 94c673b75..14f98546a 100644 --- a/src/angle-axis.cpp +++ b/src/angle-axis.cpp @@ -14,9 +14,12 @@ * with eigenpy. If not, see . */ +#include "eigenpy/memory.hpp" #include "eigenpy/geometry.hpp" #include "eigenpy/angle-axis.hpp" +EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(Eigen::AngleAxisd) + namespace eigenpy { void exposeAngleAxis() diff --git a/src/eigenpy.hpp b/src/eigenpy.hpp index 9acb89771..cd01d8bcc 100644 --- a/src/eigenpy.hpp +++ b/src/eigenpy.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2014, Nicolas Mansard, LAAS-CNRS + * Copyright 2014-2017, Nicolas Mansard and Justin Carpentier, LAAS-CNRS * * This file is part of eigenpy. * eigenpy is free software: you can redistribute it and/or @@ -22,13 +22,6 @@ namespace eigenpy { - typedef UnalignedEquivalent::type MatrixXd_fx; - typedef UnalignedEquivalent::type Matrix3d_fx; - typedef UnalignedEquivalent::type Matrix4d_fx; - typedef UnalignedEquivalent::type VectorXd_fx; - typedef UnalignedEquivalent::type Vector3d_fx; - typedef UnalignedEquivalent::type Vector4d_fx; - /* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */ void enableEigenPy(); diff --git a/src/fwd.hpp b/src/fwd.hpp index 378046ed5..ab9cf717f 100644 --- a/src/fwd.hpp +++ b/src/fwd.hpp @@ -1,5 +1,5 @@ /* - * Copyright 2014, Nicolas Mansard, LAAS-CNRS + * Copyright 2014-2017, Nicolas Mansard and Justin Carpentier, LAAS-CNRS * * This file is part of eigenpy. * eigenpy is free software: you can redistribute it and/or @@ -24,24 +24,4 @@ #define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION #endif -namespace eigenpy -{ - template - struct UnalignedEquivalent - { - typedef Eigen::MatrixBase MatType; - typedef Eigen::Matrix type; - }; - -} // namespace eigenpy - #endif // ifndef __eigenpy_fwd_hpp__ diff --git a/src/quaternion.cpp b/src/quaternion.cpp index 8bbdf04c0..3b472fae8 100644 --- a/src/quaternion.cpp +++ b/src/quaternion.cpp @@ -14,9 +14,12 @@ * with eigenpy. If not, see . */ +#include "eigenpy/memory.hpp" #include "eigenpy/geometry.hpp" #include "eigenpy/quaternion.hpp" +EIGENPY_DEFINE_STRUCT_ALLOCATOR_SPECIALIZATION(Eigen::Quaterniond) + namespace eigenpy { void exposeQuaternion() diff --git a/src/quaternion.hpp b/src/quaternion.hpp index b35a76724..f85248309 100644 --- a/src/quaternion.hpp +++ b/src/quaternion.hpp @@ -112,7 +112,7 @@ namespace eigenpy .def("_transformVector",&Quaternion::_transformVector,bp::arg("vector"),"Rotation of a vector by a quaternion.") .def("vec",&vec,"Returns a vector expression of the imaginary part (x,y,z).") .def("angularDistance",&Quaternion::template angularDistance,"Returns the angle (in radian) between two rotations.") - .def("slerp",&Quaternion::template slerp,bp::args("t","other"), + .def("slerp",&slerp,bp::args("t","other"), "Returns the spherical linear interpolation between the two quaternions *this and other at the parameter t in [0;1].") /* --- Operators --- */ @@ -205,6 +205,9 @@ namespace eigenpy return ss.str(); } + + static Quaternion slerp(const Quaternion & self, const Scalar t, const Quaternion & other) + { return self.slerp(t,other); } public: diff --git a/src/solvers/BasicPreconditioners.hpp b/src/solvers/BasicPreconditioners.hpp index 92a9af5cb..3fe921ac5 100644 --- a/src/solvers/BasicPreconditioners.hpp +++ b/src/solvers/BasicPreconditioners.hpp @@ -93,7 +93,7 @@ namespace eigenpy } }; -#if EIGEN_VERSION_AT_LEAST(3,3,0) +#if EIGEN_VERSION_AT_LEAST(3,3,5) template struct LeastSquareDiagonalPreconditionerVisitor : PreconditionerBaseVisitor > { diff --git a/src/solvers/preconditioners.cpp b/src/solvers/preconditioners.cpp index bea99da10..fb2f2e35a 100644 --- a/src/solvers/preconditioners.cpp +++ b/src/solvers/preconditioners.cpp @@ -25,7 +25,7 @@ namespace eigenpy using namespace Eigen; DiagonalPreconditionerVisitor::expose(); -#if EIGEN_VERSION_AT_LEAST(3,3,0) +#if EIGEN_VERSION_AT_LEAST(3,3,5) LeastSquareDiagonalPreconditionerVisitor::expose(); #endif IdentityPreconditionerVisitor::expose(); diff --git a/src/solvers/solvers.cpp b/src/solvers/solvers.cpp index 0cca3f8c9..d0d7103ff 100644 --- a/src/solvers/solvers.cpp +++ b/src/solvers/solvers.cpp @@ -17,7 +17,7 @@ #include "eigenpy/solvers/solvers.hpp" #include "eigenpy/solvers/ConjugateGradient.hpp" -#if EIGEN_VERSION_AT_LEAST(3,3,0) +#if EIGEN_VERSION_AT_LEAST(3,3,5) #include "eigenpy/solvers/LeastSquaresConjugateGradient.hpp" #endif @@ -27,7 +27,7 @@ namespace eigenpy { using namespace Eigen; ConjugateGradientVisitor< ConjugateGradient >::expose(); -#if EIGEN_VERSION_AT_LEAST(3,3,0) +#if EIGEN_VERSION_AT_LEAST(3,3,5) LeastSquaresConjugateGradientVisitor< LeastSquaresConjugateGradient > >::expose(); #endif diff --git a/unittest/matrix.cpp b/unittest/matrix.cpp index a1f30d5f5..8eff29468 100644 --- a/unittest/matrix.cpp +++ b/unittest/matrix.cpp @@ -53,7 +53,7 @@ Eigen::Matrix3d naturals(bool verbose) } template -Eigen::MatrixXd reflex(const typename eigenpy::UnalignedEquivalent::type & M, bool verbose) +Eigen::MatrixXd reflex(const MatType & M, bool verbose) { if(verbose) std::cout << "EigenMat = " << M << std::endl;