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

Solves KKT system using Cholesky decomposition. More...

#include <as_chol_solve.h>

Public Member Functions

 chol_solve (const int)
 Constructor. More...
 
 ~chol_solve ()
 Destructor. More...
 
void solve (const AS::problem_parameters &, const double *, double *)
 Determines feasible descent direction. More...
 
void up_resolve (const AS::problem_parameters &, const vector< AS::constraint > &, const double *, double *)
 A wrapper around private functions, which update Cholesky factor and resolve the system. More...
 
double * get_lambda (const AS::problem_parameters &)
 
void down_resolve (const AS::problem_parameters &, const vector< AS::constraint > &, const int, const double *, double *)
 A wrapper around private functions, which downdate Cholesky factor and resolve the system. More...
 

Private Member Functions

void update (const AS::problem_parameters &, const AS::constraint &, const int)
 Adds a row corresponding to some inequality constraint to L, see 'pCholUpAlg'. More...
 
void update_z (const AS::problem_parameters &, const AS::constraint &, const int, const double *)
 Adjust vector 'z' after update. More...
 
void downdate (const AS::problem_parameters &, const int, const int, const double *)
 Delete a line from icL, see page 'pCholDown'. More...
 
void resolve (const AS::problem_parameters &, const vector< AS::constraint > &, const double *, double *)
 Determines feasible descent direction with respect to added inequality constraints. More...
 
void form_sa_row (const AS::problem_parameters &, const AS::constraint &, const int, double *)
 Forms row vector 's_a' (pCholUp). More...
 

Private Attributes

double * nu
 Vector of Lagrange multipliers. More...
 
AS::matrix_E E
 matrix of equality AS::constraints More...
 
AS::matrix_ecL ecL
 L for equality AS::constraints. More...
 
double ** icL
 L for inequality AS::constraints. More...
 
double * icL_mem
 All lines of icL are stored in one chunk of memory. More...
 
double * z
 Vector z. More...
 

Detailed Description

Solves KKT system using Cholesky decomposition.

Definition at line 37 of file as_chol_solve.h.

Constructor & Destructor Documentation

◆ chol_solve()

AS::chol_solve::chol_solve ( const int  N)

Constructor.

Parameters
[in]Nsize of the preview window.

Definition at line 32 of file as_chol_solve.cpp.

◆ ~chol_solve()

AS::chol_solve::~chol_solve ( )

Destructor.

Definition at line 49 of file as_chol_solve.cpp.

Member Function Documentation

◆ down_resolve()

void AS::chol_solve::down_resolve ( const AS::problem_parameters ppar,
const vector< AS::constraint > &  active_set,
const int  ind_exclude,
const double *  x,
double *  dx 
)

A wrapper around private functions, which downdate Cholesky factor and resolve the system.

Parameters
[in]pparparameters.
[in]active_seta vector of active constraints.
[in]ind_excludeindex of excluded constraint.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.
Note
Downdate of vector pz 'z' is described on the page 'pRemoveICz'.

Definition at line 391 of file as_chol_solve.cpp.

◆ downdate()

void AS::chol_solve::downdate ( const AS::problem_parameters ppar,
const int  nW,
const int  ind_exclude,
const double *  x 
)
private

Delete a line from icL, see page 'pCholDown'.

Parameters
[in]pparparameters.
[in]nWnumber of added constrains.
[in]ind_excludeindex of excluded constraint.
[in]xinitial guess.

Definition at line 466 of file as_chol_solve.cpp.

◆ form_sa_row()

void AS::chol_solve::form_sa_row ( const AS::problem_parameters ppar,
const AS::constraint c,
const int  ic_len,
double *  row 
)
private

Forms row vector 's_a' (pCholUp).

Parameters
[in]pparparameters
[in]cactivated constraint
[in]ic_lenthe length of new row in L
[out]row's_a' row

Definition at line 76 of file as_chol_solve.cpp.

◆ get_lambda()

double * AS::chol_solve::get_lambda ( const AS::problem_parameters ppar)
Returns
a pointer to the memory where current lambdas are stored.
Parameters
[in]pparparameters

Definition at line 450 of file as_chol_solve.cpp.

◆ resolve()

void AS::chol_solve::resolve ( const AS::problem_parameters ppar,
const vector< AS::constraint > &  active_set,
const double *  x,
double *  dx 
)
private

Determines feasible descent direction with respect to added inequality constraints.

Parameters
[in]pparparameters.
[in]active_seta vector of active constraints.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.

Definition at line 322 of file as_chol_solve.cpp.

◆ solve()

void AS::chol_solve::solve ( const AS::problem_parameters ppar,
const double *  x,
double *  dx 
)

Determines feasible descent direction.

Parameters
[in]pparparameters.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.

Definition at line 115 of file as_chol_solve.cpp.

◆ up_resolve()

void AS::chol_solve::up_resolve ( const AS::problem_parameters ppar,
const vector< AS::constraint > &  active_set,
const double *  x,
double *  dx 
)

A wrapper around private functions, which update Cholesky factor and resolve the system.

Parameters
[in]pparparameters.
[in]active_seta vector of active constraints.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.

Definition at line 176 of file as_chol_solve.cpp.

◆ update()

void AS::chol_solve::update ( const AS::problem_parameters ppar,
const AS::constraint c,
const int  ic_num 
)
private

Adds a row corresponding to some inequality constraint to L, see 'pCholUpAlg'.

Parameters
[in]pparparameters.
[in]cactivated constraint
[in]ic_numindex of added constraint in W

Definition at line 199 of file as_chol_solve.cpp.

◆ update_z()

void AS::chol_solve::update_z ( const AS::problem_parameters ppar,
const AS::constraint c,
const int  ic_num,
const double *  x 
)
private

Adjust vector 'z' after update.

Parameters
[in]pparparameters.
[in]cactivated constraint
[in]ic_numnumber of added constraint in the active set
[in]xinitial guess.

Definition at line 287 of file as_chol_solve.cpp.

Member Data Documentation

◆ E

AS::matrix_E AS::chol_solve::E
private

matrix of equality AS::constraints

Definition at line 68 of file as_chol_solve.h.

◆ ecL

AS::matrix_ecL AS::chol_solve::ecL
private

L for equality AS::constraints.

Definition at line 71 of file as_chol_solve.h.

◆ icL

double** AS::chol_solve::icL
private

L for inequality AS::constraints.

Definition at line 74 of file as_chol_solve.h.

◆ icL_mem

double* AS::chol_solve::icL_mem
private

All lines of icL are stored in one chunk of memory.

Definition at line 77 of file as_chol_solve.h.

◆ nu

double* AS::chol_solve::nu
private

Vector of Lagrange multipliers.

Definition at line 65 of file as_chol_solve.h.

◆ z

double* AS::chol_solve::z
private

Vector z.

Definition at line 80 of file as_chol_solve.h.


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