Rotation given by a cosine-sine pair.
This class represents a Jacobi or Givens rotation. This is a 2D rotation in the plane J
of angle defined by its cosine
c
and sine s
as follow:
You can apply the respective counter-clockwise rotation to a column vector v
by applying its adjoint on the left: that translates to the following Eigen code:
v.applyOnTheLeft(J.adjoint());
Definition at line 47 of file Jacobi.h.
#include <src/Jacobi/Jacobi.h>
Public Types | |
typedef NumTraits< Scalar >::Real | RealScalar |
Public Member Functions | |
JacobiRotation () | |
Default constructor without any initialization. | |
JacobiRotation (const Scalar &c, const Scalar &s) | |
Construct a planar rotation from a cosine-sine pair (c, s ). | |
Scalar & | c () |
Scalar | c () const |
Scalar & | s () |
Scalar | s () const |
JacobiRotation | operator* (const JacobiRotation &other) |
Concatenates two planar rotation. | |
JacobiRotation | transpose () const |
Returns the transposed transformation. | |
JacobiRotation | adjoint () const |
Returns the adjoint transformation. | |
template<typename Derived > | |
bool | makeJacobi (const MatrixBase< Derived > &, typename Derived::Index p, typename Derived::Index q) |
Makes *this as a Jacobi rotation J such that applying J on both the right and left sides of the 2x2 selfadjoint matrix ![]() ![]() | |
bool | makeJacobi (RealScalar x, Scalar y, RealScalar z) |
Makes *this as a Jacobi rotation J such that applying J on both the right and left sides of the selfadjoint 2x2 matrix ![]() ![]() | |
void | makeGivens (const Scalar &p, const Scalar &q, Scalar *z=0) |
Makes *this as a Givens rotation G such that applying ![]() ![]() ![]() | |
Protected Member Functions | |
void | makeGivens (const Scalar &p, const Scalar &q, Scalar *z, internal::true_type) |
void | makeGivens (const Scalar &p, const Scalar &q, Scalar *z, internal::false_type) |
Protected Attributes | |
Scalar | m_c |
Scalar | m_s |
typedef NumTraits<Scalar>::Real JacobiRotation< Scalar >::RealScalar |
JacobiRotation< Scalar >::JacobiRotation | ( | ) | [inline] |
Default constructor without any initialization.
Definition at line 53 of file Jacobi.h.
Referenced by JacobiRotation< Scalar >::adjoint(), JacobiRotation< Scalar >::operator*(), and JacobiRotation< Scalar >::transpose().
JacobiRotation< Scalar >::JacobiRotation | ( | const Scalar & | c, | |
const Scalar & | s | |||
) | [inline] |
JacobiRotation JacobiRotation< Scalar >::adjoint | ( | ) | const [inline] |
Returns the adjoint transformation.
Definition at line 74 of file Jacobi.h.
References JacobiRotation< Scalar >::JacobiRotation(), JacobiRotation< Scalar >::m_c, and JacobiRotation< Scalar >::m_s.
Referenced by ComplexSchur< MatrixType >::reduceToTriangularForm(), internal::svd_precondition_2x2_block_to_be_real< MatrixType, QRPreconditioner, true >::run(), and RealSchur< MatrixType >::splitOffTwoRows().
Scalar JacobiRotation< Scalar >::c | ( | ) | const [inline] |
Definition at line 59 of file Jacobi.h.
References JacobiRotation< Scalar >::m_c.
Scalar& JacobiRotation< Scalar >::c | ( | ) | [inline] |
Definition at line 58 of file Jacobi.h.
References JacobiRotation< Scalar >::m_c.
Referenced by internal::apply_rotation_in_the_plane(), internal::svd_precondition_2x2_block_to_be_real< MatrixType, QRPreconditioner, true >::run(), and internal::tridiagonal_qr_step().
void JacobiRotation< Scalar >::makeGivens | ( | const Scalar & | p, | |
const Scalar & | q, | |||
Scalar * | z = 0 | |||
) |
Makes *this
as a Givens rotation G
such that applying to the left of the vector
yields:
.
The value of z is returned if z is not null (the default is null). Also note that G is built such that the cosine is always real.
Example:
Output:
This function implements the continuous Givens rotation generation algorithm found in Anderson (2000), Discontinuous Plane Rotations and the Symmetric Eigenvalue Problem. LAPACK Working Note 150, University of Tennessee, UT-CS-00-454, December 4, 2000.
Definition at line 158 of file Jacobi.h.
Referenced by ComplexSchur< MatrixType >::reduceToTriangularForm(), RealSchur< MatrixType >::splitOffTwoRows(), and internal::tridiagonal_qr_step().
void JacobiRotation< Scalar >::makeGivens | ( | const Scalar & | p, | |
const Scalar & | q, | |||
Scalar * | z, | |||
internal::true_type | ||||
) | [protected] |
Definition at line 166 of file Jacobi.h.
References abs(), abs2(), JacobiRotation< Scalar >::m_c, JacobiRotation< Scalar >::m_s, real(), and sqrt().
void JacobiRotation< Scalar >::makeGivens | ( | const Scalar & | p, | |
const Scalar & | q, | |||
Scalar * | z, | |||
internal::false_type | ||||
) | [protected] |
Definition at line 221 of file Jacobi.h.
References abs(), abs2(), JacobiRotation< Scalar >::m_c, JacobiRotation< Scalar >::m_s, sqrt(), and t().
bool JacobiRotation< Scalar >::makeJacobi | ( | RealScalar | x, | |
Scalar | y, | |||
RealScalar | z | |||
) |
Makes *this
as a Jacobi rotation J such that applying J on both the right and left sides of the selfadjoint 2x2 matrix yields a diagonal matrix
.
Definition at line 95 of file Jacobi.h.
References abs(), abs2(), JacobiRotation< Scalar >::m_c, JacobiRotation< Scalar >::m_s, and sqrt().
bool JacobiRotation< Scalar >::makeJacobi | ( | const MatrixBase< Derived > & | m, | |
typename Derived::Index | p, | |||
typename Derived::Index | q | |||
) | [inline] |
Makes *this
as a Jacobi rotation J
such that applying J on both the right and left sides of the 2x2 selfadjoint matrix yields a diagonal matrix
.
Example:
Output:
Definition at line 136 of file Jacobi.h.
References real().
Referenced by internal::real_2x2_jacobi_svd().
JacobiRotation JacobiRotation< Scalar >::operator* | ( | const JacobiRotation< Scalar > & | other | ) | [inline] |
Concatenates two planar rotation.
Definition at line 64 of file Jacobi.h.
References JacobiRotation< Scalar >::JacobiRotation(), JacobiRotation< Scalar >::m_c, and JacobiRotation< Scalar >::m_s.
Scalar& JacobiRotation< Scalar >::s | ( | ) | [inline] |
Definition at line 60 of file Jacobi.h.
References JacobiRotation< Scalar >::m_s.
Referenced by internal::apply_rotation_in_the_plane(), internal::svd_precondition_2x2_block_to_be_real< MatrixType, QRPreconditioner, true >::run(), and internal::tridiagonal_qr_step().
Scalar JacobiRotation< Scalar >::s | ( | ) | const [inline] |
Definition at line 61 of file Jacobi.h.
References JacobiRotation< Scalar >::m_s.
JacobiRotation JacobiRotation< Scalar >::transpose | ( | ) | const [inline] |
Returns the transposed transformation.
Definition at line 71 of file Jacobi.h.
References JacobiRotation< Scalar >::JacobiRotation(), JacobiRotation< Scalar >::m_c, and JacobiRotation< Scalar >::m_s.
Referenced by MatrixBase< Derived >::applyOnTheRight(), JacobiSVD< _MatrixType, QRPreconditioner >::compute(), and internal::real_2x2_jacobi_svd().
Scalar JacobiRotation< Scalar >::m_c [protected] |
Definition at line 86 of file Jacobi.h.
Referenced by JacobiRotation< Scalar >::adjoint(), JacobiRotation< Scalar >::c(), JacobiRotation< Scalar >::makeGivens(), JacobiRotation< Scalar >::makeJacobi(), JacobiRotation< Scalar >::operator*(), and JacobiRotation< Scalar >::transpose().
Scalar JacobiRotation< Scalar >::m_s [protected] |
Definition at line 86 of file Jacobi.h.
Referenced by JacobiRotation< Scalar >::adjoint(), JacobiRotation< Scalar >::makeGivens(), JacobiRotation< Scalar >::makeJacobi(), JacobiRotation< Scalar >::operator*(), JacobiRotation< Scalar >::s(), and JacobiRotation< Scalar >::transpose().
Page generated by Doxygen 1.7.1 for MRPT 0.9.4 SVN: at Mon Jan 10 23:33:19 UTC 2011 |