This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen

Bug 487

Summary: Transform concatenation fails with THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS
Product: Eigen Reporter: Ferdinand Beyer <fb>
Component: GeometryAssignee: Nobody <eigen.nobody>
Status: RESOLVED FIXED    
Severity: major CC: gael.guennebaud, hauke.heibel, jacob.benoit.1
Priority: Normal    
Version: 3.1   
Hardware: All   
OS: All   
Whiteboard:

Description Ferdinand Beyer 2012-07-03 14:04:06 UTC
The following code fails to compile because of the static assertion THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS:

    Affine2f a = Translation2f(Vector2f(1, 1)) *
                 Rotation2Df(-0.5f) *
                 Scaling(2.0f);

Origin in Geometry/Transform.h, line 809:

Transform<Scalar,Dim,Mode,Options>& Transform<Scalar,Dim,Mode,Options>::scale(Scalar s)
{
  EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS)

I guess that (Translation * Rotation) yields a temporary isometry, and this cannot be scaled.

My current workaround is to switch the order of rotation and scaling:

    Affine2f a = Translation2f(Vector2f(1, 1)) *
                 Scaling(2.0f) *
                 Rotation2Df(-0.5f);
Comment 1 Gael Guennebaud 2012-07-04 18:26:35 UTC
thank you for the report, fixed:

https://bitbucket.org/eigen/eigen/changeset/71230229983b/
changeset:   71230229983b
user:        ggael
date:        2012-07-04 18:25:07
summary:     fix bug 487: isometry * scaling was not compiling

https://bitbucket.org/eigen/eigen/changeset/20f06227c1d4/
changeset:   20f06227c1d4
branch:      3.1
Comment 2 Nobody 2019-12-04 11:46:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/487.