* 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:
Gael Guennebaud
2008-08-18 22:17:42 +00:00
parent e778ae2559
commit 95dd09bea6
9 changed files with 202 additions and 117 deletions

View File

@@ -126,6 +126,7 @@ public:
enum { Dim = 2 };
/** the scalar type of the coefficients */
typedef _Scalar Scalar;
typedef Matrix<Scalar,2,1> Vector2;
typedef Matrix<Scalar,2,2> Matrix2;
protected:
@@ -136,14 +137,34 @@ public:
/** Construct a 2D counter clock wise rotation from the angle \a a in radian. */
inline Rotation2D(Scalar a) : m_angle(a) {}
inline operator Scalar& () { return m_angle; }
inline operator Scalar () const { return m_angle; }
/** \Returns the rotation angle */
inline Scalar angle() const { return m_angle; }
/** \Returns a read-write reference to the rotation angle */
inline Scalar& angle() { return m_angle; }
/** Automatic convertion to a 2D rotation matrix.
* \sa toRotationMatrix()
*/
inline operator Matrix2() const { return toRotationMatrix(); }
/** \Returns the inverse rotation */
inline Rotation2D inverse() const { return -m_angle; }
/** Concatenates two rotations */
inline Rotation2D operator*(const Rotation2D& other) const
{ return m_angle + other.m_angle; }
/** Concatenates two rotations */
inline Rotation2D& operator*=(const Rotation2D& other)
{ return m_angle += other.m_angle; }
/** Applies the rotation to a 2D vector */
template<typename Derived>
Vector2 operator* (const MatrixBase<Derived>& vec) const
{ return toRotationMatrix() * vec; }
template<typename Derived>
Rotation2D& fromRotationMatrix(const MatrixBase<Derived>& m);
Matrix2 toRotationMatrix(void) const;