Skip to content

Commit 2aeb383

Browse files
committed
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.
1 parent 551f08a commit 2aeb383

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/fwd.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323
namespace eigenpy
2424
{
25-
template<typename D>
25+
template<typename D, typename Scalar = typename D::Scalar>
2626
struct UnalignedEquivalent
2727
{
2828
typedef Eigen::MatrixBase<D> MatType;
29-
typedef Eigen::Matrix<typename D::Scalar,
29+
typedef Eigen::Matrix<Scalar,
3030
D::RowsAtCompileTime,
3131
D::ColsAtCompileTime,
3232
#ifndef EIGENPY_ALIGNED

0 commit comments

Comments
 (0)