Commit 412720a5 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

Fix compatibility with Eigen 3.0.5

parent aacde161
......@@ -85,6 +85,7 @@ namespace eigenpy
}
};
#if EIGEN_VERSION_AT_LEAST(3,2,0)
template<typename MatType>
struct EigenObjectAllocator< eigenpy::Ref<MatType> >
{
......@@ -101,6 +102,7 @@ namespace eigenpy
MapNumpy<MatType>::map(pyArray) = mat;
}
};
#endif
/* --- TO PYTHON -------------------------------------------------------------- */
template<typename MatType>
......
......@@ -19,12 +19,20 @@
#include "eigenpy/fwd.hpp"
#include "eigenpy/deprecated.hh"
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#include "eigenpy/ref.hpp"
#define ENABLE_SPECIFIC_MATRIX_TYPE(TYPE) \
enableEigenPySpecific<TYPE>(); \
enableEigenPySpecific< eigenpy::Ref<TYPE> >();
#else
#define ENABLE_SPECIFIC_MATRIX_TYPE(TYPE) \
enableEigenPySpecific<TYPE>();
#endif
namespace eigenpy
{
/* Enable Eigen-Numpy serialization for a set of standard MatrixBase instance. */
......
/*
* Copyright 2017, Justin Carpentier, LAAS-CNRS
* Copyright 2017-2018, Justin Carpentier, LAAS-CNRS
*
* This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or
......@@ -14,12 +14,16 @@
* with eigenpy. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Eigen/Core>
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#include "eigenpy/solvers/preconditioners.hpp"
#include "eigenpy/solvers/BasicPreconditioners.hpp"
//#include "eigenpy/solvers/BFGSPreconditioners.hpp"
namespace eigenpy
{
void exposePreconditioners()
{
using namespace Eigen;
......@@ -32,4 +36,8 @@ namespace eigenpy
// LimitedBFGSPreconditionerBaseVisitor< LimitedBFGSPreconditioner<double,Eigen::Dynamic,Eigen::Upper|Eigen::Lower> >::expose("LimitedBFGSPreconditioner");
}
} // namespace eigenpy
#endif
/*
* Copyright 2017, Justin Carpentier, LAAS-CNRS
* Copyright 2017-2018, Justin Carpentier, LAAS-CNRS
*
* This file is part of eigenpy.
* eigenpy is free software: you can redistribute it and/or
......@@ -14,6 +14,10 @@
* with eigenpy. If not, see <http://www.gnu.org/licenses/>.
*/
#include <Eigen/Core>
#if EIGEN_VERSION_AT_LEAST(3,2,0)
#include "eigenpy/solvers/solvers.hpp"
#include "eigenpy/solvers/ConjugateGradient.hpp"
......@@ -43,3 +47,6 @@ namespace eigenpy
;
}
} // namespace eigenpy
#endif
......@@ -40,5 +40,7 @@ ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
ADD_LIB_UNIT_TEST(matrix "eigen3")
ADD_LIB_UNIT_TEST(geometry "eigen3")
ADD_LIB_UNIT_TEST(ref "eigen3")
IF(NOT ${EIGEN3_VERSION} VERSION_LESS "3.2.0")
ADD_LIB_UNIT_TEST(ref "eigen3")
ENDIF()
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