qpmad
Eigen-based C++ QP solver.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
qpmad::GivensRotation< t_Scalar > Class Template Reference

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.

#include <givens.h>

Public Types

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

Public Member Functions

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
 

Member Enumeration Documentation

◆ Type

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

Definition at line 44 of file givens.h.

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 103 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 119 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 172 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 143 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 53 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 167 of file givens.h.

Member Data Documentation

◆ cos

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

Definition at line 162 of file givens.h.

◆ sin

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

Definition at line 163 of file givens.h.

◆ type

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

Definition at line 161 of file givens.h.


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