WPILibC++ 2023.4.3
Eigen::JacobiRotation< Scalar > Class Template Reference

\jacobi_module More...

#include </home/runner/work/allwpilib/allwpilib/wpimath/src/main/native/thirdparty/eigen/include/Eigen/src/Jacobi/Jacobi.h>

Public Types

typedef NumTraits< Scalar >::Real RealScalar
 

Public Member Functions

EIGEN_DEVICE_FUNC JacobiRotation ()
 Default constructor without any initialization. More...
 
EIGEN_DEVICE_FUNC JacobiRotation (const Scalar &c, const Scalar &s)
 Construct a planar rotation from a cosine-sine pair (c, s). More...
 
EIGEN_DEVICE_FUNC Scalar & c ()
 
EIGEN_DEVICE_FUNC Scalar c () const
 
EIGEN_DEVICE_FUNC Scalar & s ()
 
EIGEN_DEVICE_FUNC Scalar s () const
 
EIGEN_DEVICE_FUNC JacobiRotation operator* (const JacobiRotation &other)
 Concatenates two planar rotation. More...
 
EIGEN_DEVICE_FUNC JacobiRotation transpose () const
 Returns the transposed transformation. More...
 
EIGEN_DEVICE_FUNC JacobiRotation adjoint () const
 Returns the adjoint transformation. More...
 
template<typename Derived >
EIGEN_DEVICE_FUNC bool makeJacobi (const MatrixBase< Derived > &, Index p, 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 \( B = \left ( \begin{array}{cc} \text{this}_{pp} & \text{this}_{pq} \\ (\text{this}_{pq})^* & \text{this}_{qq} \end{array} \right )\) yields a diagonal matrix \( A = J^* B J \). More...
 
EIGEN_DEVICE_FUNC bool makeJacobi (const RealScalar &x, const Scalar &y, const 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 \( B = \left ( \begin{array}{cc} x & y \\ \overline y & z \end{array} \right )\) yields a diagonal matrix \( A = J^* B J \). More...
 
EIGEN_DEVICE_FUNC void makeGivens (const Scalar &p, const Scalar &q, Scalar *r=0)
 Makes *this as a Givens rotation G such that applying \( G^* \) to the left of the vector \( V = \left ( \begin{array}{c} p \\ q \end{array} \right )\) yields: \( G^* V = \left ( \begin{array}{c} r \\ 0 \end{array} \right )\). More...
 

Protected Member Functions

EIGEN_DEVICE_FUNC void makeGivens (const Scalar &p, const Scalar &q, Scalar *r, internal::true_type)
 
EIGEN_DEVICE_FUNC void makeGivens (const Scalar &p, const Scalar &q, Scalar *r, internal::false_type)
 

Protected Attributes

Scalar m_c
 
Scalar m_s
 

Detailed Description

template<typename Scalar>
class Eigen::JacobiRotation< Scalar >

\jacobi_module

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 \( \theta \) defined by its cosine c and sine s as follow: \( J = \left ( \begin{array}{cc} c & \overline s \\ -s & \overline c \end{array} \right ) \)

You can apply the respective counter-clockwise rotation to a column vector v by applying its adjoint on the left: \( v = J^* v \) that translates to the following Eigen code:

v.applyOnTheLeft(J.adjoint());
See also
MatrixBase::applyOnTheLeft(), MatrixBase::applyOnTheRight()

Member Typedef Documentation

◆ RealScalar

template<typename Scalar >
typedef NumTraits<Scalar>::Real Eigen::JacobiRotation< Scalar >::RealScalar

Constructor & Destructor Documentation

◆ JacobiRotation() [1/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC Eigen::JacobiRotation< Scalar >::JacobiRotation ( )
inline

Default constructor without any initialization.

◆ JacobiRotation() [2/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC Eigen::JacobiRotation< Scalar >::JacobiRotation ( const Scalar &  c,
const Scalar &  s 
)
inline

Construct a planar rotation from a cosine-sine pair (c, s).

Member Function Documentation

◆ adjoint()

template<typename Scalar >
EIGEN_DEVICE_FUNC JacobiRotation Eigen::JacobiRotation< Scalar >::adjoint ( ) const
inline

Returns the adjoint transformation.

◆ c() [1/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC Scalar & Eigen::JacobiRotation< Scalar >::c ( )
inline

◆ c() [2/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC Scalar Eigen::JacobiRotation< Scalar >::c ( ) const
inline

◆ makeGivens() [1/3]

template<typename Scalar >
EIGEN_DEVICE_FUNC void Eigen::JacobiRotation< Scalar >::makeGivens ( const Scalar &  p,
const Scalar &  q,
Scalar *  r,
internal::false_type   
)
protected

◆ makeGivens() [2/3]

template<typename Scalar >
EIGEN_DEVICE_FUNC void Eigen::JacobiRotation< Scalar >::makeGivens ( const Scalar &  p,
const Scalar &  q,
Scalar *  r,
internal::true_type   
)
protected

◆ makeGivens() [3/3]

template<typename Scalar >
EIGEN_DEVICE_FUNC void Eigen::JacobiRotation< Scalar >::makeGivens ( const Scalar &  p,
const Scalar &  q,
Scalar *  r = 0 
)

Makes *this as a Givens rotation G such that applying \( G^* \) to the left of the vector \( V = \left ( \begin{array}{c} p \\ q \end{array} \right )\) yields: \( G^* V = \left ( \begin{array}{c} r \\ 0 \end{array} \right )\).

The value of r is returned if r 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.

See also
MatrixBase::applyOnTheLeft(), MatrixBase::applyOnTheRight()

◆ makeJacobi() [1/2]

template<typename Scalar >
template<typename Derived >
EIGEN_DEVICE_FUNC bool Eigen::JacobiRotation< Scalar >::makeJacobi ( const MatrixBase< Derived > &  m,
Index  p,
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 \( B = \left ( \begin{array}{cc} \text{this}_{pp} & \text{this}_{pq} \\ (\text{this}_{pq})^* & \text{this}_{qq} \end{array} \right )\) yields a diagonal matrix \( A = J^* B J \).

Example:

Output:

See also
JacobiRotation::makeJacobi(RealScalar, Scalar, RealScalar), MatrixBase::applyOnTheLeft(), MatrixBase::applyOnTheRight()

◆ makeJacobi() [2/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC bool Eigen::JacobiRotation< Scalar >::makeJacobi ( const RealScalar x,
const Scalar &  y,
const 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 \( B = \left ( \begin{array}{cc} x & y \\ \overline y & z \end{array} \right )\) yields a diagonal matrix \( A = J^* B J \).

See also
MatrixBase::makeJacobi(const MatrixBase<Derived>&, Index, Index), MatrixBase::applyOnTheLeft(), MatrixBase::applyOnTheRight()

◆ operator*()

template<typename Scalar >
EIGEN_DEVICE_FUNC JacobiRotation Eigen::JacobiRotation< Scalar >::operator* ( const JacobiRotation< Scalar > &  other)
inline

Concatenates two planar rotation.

◆ s() [1/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC Scalar & Eigen::JacobiRotation< Scalar >::s ( )
inline

◆ s() [2/2]

template<typename Scalar >
EIGEN_DEVICE_FUNC Scalar Eigen::JacobiRotation< Scalar >::s ( ) const
inline

◆ transpose()

template<typename Scalar >
EIGEN_DEVICE_FUNC JacobiRotation Eigen::JacobiRotation< Scalar >::transpose ( ) const
inline

Returns the transposed transformation.

Member Data Documentation

◆ m_c

template<typename Scalar >
Scalar Eigen::JacobiRotation< Scalar >::m_c
protected

◆ m_s

template<typename Scalar >
Scalar Eigen::JacobiRotation< Scalar >::m_s
protected

The documentation for this class was generated from the following file: