mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
* revert the previous interface change in solveTriangular (pointer vs reference)
* remove the cast operators in the Geometry module: they are replaced by constructors and new operator= in Matrix * extended the operations supported by Rotation2D * rewrite in solveTriangular: - merge the Upper and Lower specializations - big optimization of the path for row-major triangular matrices
This commit is contained in:
@@ -118,6 +118,7 @@ public:
|
||||
|
||||
/** Constructs and initializes a quaternion from the angle-axis \a aa */
|
||||
explicit inline Quaternion(const AngleAxisType& aa) { *this = aa; }
|
||||
|
||||
/** Constructs and initializes a quaternion from either:
|
||||
* - a rotation matrix expression,
|
||||
* - a 4D vector expression representing quaternion coefficients.
|
||||
@@ -131,9 +132,6 @@ public:
|
||||
template<typename Derived>
|
||||
Quaternion& operator=(const MatrixBase<Derived>& m);
|
||||
|
||||
/** Automatic conversion to a rotation matrix. */
|
||||
operator Matrix3 () const { return toRotationMatrix(); }
|
||||
|
||||
/** \returns a quaternion representing an identity rotation
|
||||
* \sa MatrixBase::Identity()
|
||||
*/
|
||||
@@ -426,4 +424,29 @@ struct ei_quaternion_assign_impl<Other,4,1>
|
||||
}
|
||||
};
|
||||
|
||||
/** \geometry_module
|
||||
*
|
||||
* Constructs a 3x3 rotation matrix from the quaternion \a q
|
||||
*
|
||||
* \sa Matrix(const AngleAxis&)
|
||||
*/
|
||||
template<typename _Scalar, int _Rows, int _Cols, int _MaxRows, int _MaxCols, unsigned int _Flags>
|
||||
Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::Matrix(const Quaternion<Scalar>& q)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,3,3);
|
||||
*this = q.toRotationMatrix();
|
||||
}
|
||||
|
||||
/** \geometry_module
|
||||
*
|
||||
* Set a 3x3 rotation matrix from the quaternion \a q
|
||||
*/
|
||||
template<typename _Scalar, int _Rows, int _Cols, int _MaxRows, int _MaxCols, unsigned int _Flags>
|
||||
Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>&
|
||||
Matrix<_Scalar, _Rows, _Cols, _MaxRows, _MaxCols, _Flags>::operator=(const Quaternion<Scalar>& q)
|
||||
{
|
||||
EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(Matrix,3,3);
|
||||
return *this = q.toRotationMatrix();
|
||||
}
|
||||
|
||||
#endif // EIGEN_QUATERNION_H
|
||||
|
||||
Reference in New Issue
Block a user