A sparse MPC solver for walking motion generation.
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
IP::matrix_ecL Class Reference

Initializes lower diagonal matrix L and performs backward and forward substitutions using this matrix. More...

#include <ip_matrix_ecL.h>

Public Member Functions

 matrix_ecL (const int)
 
 ~matrix_ecL ()
 
void form (const problem_parameters &, const double *)
 Builds matrix L. More...
 
void solve_backward (const int, double *)
 Solve system ecL' * x = b using backward substitution. More...
 
void solve_forward (const int, double *)
 Solve system ecL * x = b using forward substitution. More...
 

Public Attributes

double * ecL
 

Private Member Functions

void chol_dec (double *)
 Performs Cholesky decomposition of a matrix. More...
 
void form_M (const double, const double, const double *, const double *)
 Forms M = R*inv(hess_phi)*R'. More...
 
void form_MAT (const double, const double)
 Forms matrix MAT = M * A'. More...
 
void form_AMATMBiPB (const double, const double, const double *, const double, double *)
 Forms matrix AMATMBiPB = A * M1 * A' + 0.5 * M2 + 0.5 * B * inv(P) * B. More...
 
void form_L_non_diag (const double *, double *)
 Forms a 6x6 matrix L(k+1, k), which lies below the diagonal of L. More...
 
void form_L_diag (const double *, const double, double *)
 Forms a 6x6 matrix L(0, 0) = chol (M + B * inv(2*P) * B). More...
 
void form_L_diag (const double *, double *)
 Forms a 6x6 matrix L(k+1, k+1), which lies on the main diagonal of L. More...
 

Private Attributes

double M [MATRIX_SIZE_6x6]
 
double MAT [MATRIX_SIZE_6x6]
 R * inv(Q) * R'. More...
 

Detailed Description

Initializes lower diagonal matrix L and performs backward and forward substitutions using this matrix.

Definition at line 42 of file ip_matrix_ecL.h.

Constructor & Destructor Documentation

◆ matrix_ecL()

IP::matrix_ecL::matrix_ecL ( const int  N)

Definition at line 26 of file ip_matrix_ecL.cpp.

◆ ~matrix_ecL()

IP::matrix_ecL::~matrix_ecL ( )

Definition at line 32 of file ip_matrix_ecL.cpp.

Member Function Documentation

◆ chol_dec()

void IP::matrix_ecL::chol_dec ( double *  mx)
private

Performs Cholesky decomposition of a matrix.

Parameters
[in,out]mxa pointer to a 6x6 matrix, the result is stored in the same place.
Attention
Only the elements below the main diagonal are used in conmputations.

Definition at line 89 of file ip_matrix_ecL.cpp.

◆ form()

void IP::matrix_ecL::form ( const problem_parameters ppar,
const double *  i2hess 
)

Builds matrix L.

Parameters
[in]pparparameters.
[in]i2hess2*N diagonal elements of inverted hessian.

Definition at line 326 of file ip_matrix_ecL.cpp.

◆ form_AMATMBiPB()

void IP::matrix_ecL::form_AMATMBiPB ( const double  A3,
const double  A6,
const double *  B,
const double  i2P,
double *  result 
)
private

Forms matrix AMATMBiPB = A * M1 * A' + 0.5 * M2 + 0.5 * B * inv(P) * B.

Parameters
[in]A34th and 7th elements of A (A is represented by two identical 3x3 matrices).
[in]A66th element of A (A is represented by two identical 3x3 matrices).
[in]Ba vector of 3 elements.
[in]i2P0.5 * inv(P) (only one number)
[in,out]resultresult
Attention
Only the elements below the main diagonal are initialized.

Definition at line 246 of file ip_matrix_ecL.cpp.

◆ form_L_diag() [1/2]

void IP::matrix_ecL::form_L_diag ( const double *  B,
const double  i2P,
double *  ecLc 
)
private

Forms a 6x6 matrix L(0, 0) = chol (M + B * inv(2*P) * B).

Parameters
[in]Ba vector of 3 elements.
[in]i2P0.5 * inv(P) (only one number)
[out]ecLcresult
Attention
Only the elements below the main diagonal are initialized.

Definition at line 209 of file ip_matrix_ecL.cpp.

◆ form_L_diag() [2/2]

void IP::matrix_ecL::form_L_diag ( const double *  p,
double *  ecLc 
)
private

Forms a 6x6 matrix L(k+1, k+1), which lies on the main diagonal of L.

Parameters
[in]pa 6x6 matrix lying to the left from ecLc on the same level of L
[in,out]ecLcAMATMBiPB as input / the result is stored here
Attention
Only the elements below the main diagonal are initialized.

Definition at line 275 of file ip_matrix_ecL.cpp.

◆ form_L_non_diag()

void IP::matrix_ecL::form_L_non_diag ( const double *  ecLp,
double *  ecLc 
)
private

Forms a 6x6 matrix L(k+1, k), which lies below the diagonal of L.

Parameters
[in]ecLpprevious matrix lying on the diagonal of L
[in]ecLcthe result is stored here

Definition at line 151 of file ip_matrix_ecL.cpp.

◆ form_M()

void IP::matrix_ecL::form_M ( const double  sinA,
const double  cosA,
const double *  i2Q,
const double *  i2hess 
)
private

Forms M = R*inv(hess_phi)*R'.

Parameters
[in]sinAsin of rotation angle.
[in]cosAcos of rotation angle.
[in]i2Qa vector of three repeating diagonal elements of inv(Q)
[in]i2hessa 2*N vector of diagonal elements of hess_phi (indicies of these elements are 1:3:N*SMPC_NUM_STATE_VAR)
Attention
Only elements lying below the main diagonal of 4x4 matrix are initialized (other elements are not unique).

Definition at line 54 of file ip_matrix_ecL.cpp.

◆ form_MAT()

void IP::matrix_ecL::form_MAT ( const double  A3,
const double  A6 
)
private

Forms matrix MAT = M * A'.

Parameters
[in]A34th and 7th elements of A.
[in]A66th element of A.

Definition at line 127 of file ip_matrix_ecL.cpp.

◆ solve_backward()

void IP::matrix_ecL::solve_backward ( const int  N,
double *  x 
)

Solve system ecL' * x = b using backward substitution.

Parameters
[in]Nnumber of states in the preview window
[in,out]xvector "b" as input, vector "x" as output.

Definition at line 435 of file ip_matrix_ecL.cpp.

◆ solve_forward()

void IP::matrix_ecL::solve_forward ( const int  N,
double *  x 
)

Solve system ecL * x = b using forward substitution.

Parameters
[in]Nnumber of states in the preview window
[in,out]xvector "b" as input, vector "x" as output (N * SMPC_NUM_STATE_VAR)

Definition at line 373 of file ip_matrix_ecL.cpp.

Member Data Documentation

◆ ecL

double* IP::matrix_ecL::ecL

Definition at line 54 of file ip_matrix_ecL.h.

◆ M

double IP::matrix_ecL::M[MATRIX_SIZE_6x6]
private

Definition at line 70 of file ip_matrix_ecL.h.

◆ MAT

double IP::matrix_ecL::MAT[MATRIX_SIZE_6x6]
private

R * inv(Q) * R'.

Definition at line 71 of file ip_matrix_ecL.h.


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