Merged in infinitei/eigen (pull request PR-328)

bug #1464 : Fixes construction of EulerAngles from 3D vector expression.

Approved-by: Tal Hadad <tal_hd@hotmail.com>
Approved-by: Abhijit Kundu <abhijit.kundu@gatech.edu>
This commit is contained in:
Gael Guennebaud 2017-09-06 08:42:14 +00:00
commit a91918a105
2 changed files with 4 additions and 1 deletions

View File

@ -341,7 +341,7 @@ EIGEN_EULER_ANGLES_TYPEDEFS(double, d)
// set from a vector of Euler angles // set from a vector of Euler angles
template<class System, class Other> template<class System, class Other>
struct eulerangles_assign_impl<System,Other,4,1> struct eulerangles_assign_impl<System,Other,3,1>
{ {
typedef typename Other::Scalar Scalar; typedef typename Other::Scalar Scalar;
static void run(EulerAngles<Scalar, System>& e, const Other& vec) static void run(EulerAngles<Scalar, System>& e, const Other& vec)

View File

@ -278,6 +278,9 @@ void test_EulerAngles()
EulerAnglesXYZd onesEd(1, 1, 1); EulerAnglesXYZd onesEd(1, 1, 1);
EulerAnglesXYZf onesEf = onesEd.cast<float>(); EulerAnglesXYZf onesEf = onesEd.cast<float>();
VERIFY_IS_APPROX(onesEd, onesEf.cast<double>()); VERIFY_IS_APPROX(onesEd, onesEf.cast<double>());
// Simple Construction from Vector3 test
VERIFY_IS_APPROX(onesEd, EulerAnglesXYZd(Vector3d::Ones()));
CALL_SUBTEST_1( eulerangles_manual<float>() ); CALL_SUBTEST_1( eulerangles_manual<float>() );
CALL_SUBTEST_2( eulerangles_manual<double>() ); CALL_SUBTEST_2( eulerangles_manual<double>() );