Transform<Scalar,Dim,Mode,Options>::preshear fails to compile with error THIS_METHOD_IS_ONLY_FOR_VECTORS_OF_A_SPECIFIC_SIZE

Summary

From what I've gathered, the issue is how Transform<Scalar,Dim,Mode,Options>::preshear internally constructs the LinearMatrixType. For this it uses a constructor that is intended for 4D vectors instead of one for a 2x2 matrix. I think LinearMatrixType({ { 1, sx }, { sy, 1 } }) would be the correct way to initialize the 2x2 matrix. (I hope I'm not mixing up rows/columns)

Environment

  • Operating System : Windows
  • Architecture : x64
  • Eigen Version : 3.4.0
  • Compiler Version : MSVC 19.38.33134

Minimal Example

using Transform = Eigen::Transform<float, 2, Eigen::AffineCompact, Eigen::DontAlign>;
Transform transform;
transform.setIdentity();
transform.preshear(1.0f, 0.0f);