qpmad
Eigen-based C++ QP solver.
Loading...
Searching...
No Matches
qpmad::GivensRotation< t_Scalar > Class Template Reference

Represents Givens rotation. More...

#include <givens.h>

Public Types

enum  Type { NONTRIVIAL = 0 , COPY = 1 , SWAP = 2 }

Public Member Functions

 GivensRotation ()=default
Type computeAndApply (t_Scalar &a, t_Scalar &b, const t_Scalar eps)
void apply (t_Scalar &a, t_Scalar &b) const
template<class t_MatrixType>
void applyColumnWise (t_MatrixType &M, MatrixIndex start, MatrixIndex end, MatrixIndex column_1, MatrixIndex column_2) const
template<class t_MatrixType>
void applyRowWise (t_MatrixType &M, MatrixIndex start, MatrixIndex end, MatrixIndex row_1, MatrixIndex row_2) const

Private Member Functions

void swap (t_Scalar &a, t_Scalar &b) const
void applyNonTrivial (t_Scalar &a, t_Scalar &b) const

Private Attributes

Type type
t_Scalar cos
t_Scalar sin

Detailed Description

template<typename t_Scalar>
class qpmad::GivensRotation< t_Scalar >

Represents Givens rotation.

[ cos, sin ] [ ] [ -sin, cos ]

for a given vector (a, b) is defined with

[ cos, sin ] [ a ] [ d ] [ ] * [ ] = [ ] [ -sin, cos ] [ b ] [ 0 ]

sin^2 + cos^2 = 1

Special cases: COPY b == 0: cos = 1, sin = 0 SWAP (b != 0) && (a == 0): cos = 0, sin = 1

Definition at line 41 of file givens.h.

Member Enumeration Documentation

◆ Type

template<typename t_Scalar>
enum qpmad::GivensRotation::Type
Enumerator
NONTRIVIAL 
COPY 
SWAP 

Definition at line 44 of file givens.h.

Constructor & Destructor Documentation

◆ GivensRotation()

template<typename t_Scalar>
qpmad::GivensRotation< t_Scalar >::GivensRotation ( )
default

Member Function Documentation

◆ apply()

template<typename t_Scalar>
void qpmad::GivensRotation< t_Scalar >::apply ( t_Scalar & a,
t_Scalar & b ) const
inline

Definition at line 105 of file givens.h.

◆ applyColumnWise()

template<typename t_Scalar>
template<class t_MatrixType>
void qpmad::GivensRotation< t_Scalar >::applyColumnWise ( t_MatrixType & M,
MatrixIndex start,
MatrixIndex end,
MatrixIndex column_1,
MatrixIndex column_2 ) const
inline

Definition at line 121 of file givens.h.

◆ applyNonTrivial()

template<typename t_Scalar>
void qpmad::GivensRotation< t_Scalar >::applyNonTrivial ( t_Scalar & a,
t_Scalar & b ) const
inlineprivate

Definition at line 174 of file givens.h.

◆ applyRowWise()

template<typename t_Scalar>
template<class t_MatrixType>
void qpmad::GivensRotation< t_Scalar >::applyRowWise ( t_MatrixType & M,
MatrixIndex start,
MatrixIndex end,
MatrixIndex row_1,
MatrixIndex row_2 ) const
inline

Definition at line 145 of file givens.h.

◆ computeAndApply()

template<typename t_Scalar>
Type qpmad::GivensRotation< t_Scalar >::computeAndApply ( t_Scalar & a,
t_Scalar & b,
const t_Scalar eps )
inline

Definition at line 55 of file givens.h.

◆ swap()

template<typename t_Scalar>
void qpmad::GivensRotation< t_Scalar >::swap ( t_Scalar & a,
t_Scalar & b ) const
inlineprivate

Definition at line 169 of file givens.h.

Member Data Documentation

◆ cos

template<typename t_Scalar>
t_Scalar qpmad::GivensRotation< t_Scalar >::cos
private

Definition at line 164 of file givens.h.

◆ sin

template<typename t_Scalar>
t_Scalar qpmad::GivensRotation< t_Scalar >::sin
private

Definition at line 165 of file givens.h.

◆ type

template<typename t_Scalar>
Type qpmad::GivensRotation< t_Scalar >::type
private

Definition at line 163 of file givens.h.


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