From 2aeb383825a6d67e13dd9e4afbc6f02759985070 Mon Sep 17 00:00:00 2001 From: Antonio El Khoury <antonio.elkhoury@wandercraft.eu> Date: Thu, 7 Jul 2016 15:05:06 +0200 Subject: [PATCH] Add Scalar template argument to UnalignedEquivalent struct. * It allows creating unaligned equivalent of Eigen matrix using a different scalar type. This can be useful when matrix types use single precision floats, whereas Numpy matrix types use double precision floats by default. * Default template argument value is Matrix D scalar type to preserve backward-compatibility. --- src/fwd.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fwd.hpp b/src/fwd.hpp index 37aa6a20..1fe3dd1d 100644 --- a/src/fwd.hpp +++ b/src/fwd.hpp @@ -22,11 +22,11 @@ namespace eigenpy { - template<typename D> + template<typename D, typename Scalar = typename D::Scalar> struct UnalignedEquivalent { typedef Eigen::MatrixBase<D> MatType; - typedef Eigen::Matrix<typename D::Scalar, + typedef Eigen::Matrix<Scalar, D::RowsAtCompileTime, D::ColsAtCompileTime, #ifndef EIGENPY_ALIGNED -- GitLab