A sparse MPC solver for walking motion generation (old version).
Public Member Functions | Private Member Functions | Private Attributes
chol_solve_as Class Reference

Solves KKT system using Cholesky decomposition. More...

#include <chol_solve_as.h>

List of all members.

Public Member Functions

 chol_solve_as (const int)
 Constructor.
 ~chol_solve_as ()
void solve (const problem_parameters &, const double *, const double *, double *)
 Determines feasible descent direction.
void up_resolve (const problem_parameters &, const double *, const int, const int *, const double *, double *)
 A wrapper around private functions, which update Cholesky factor and resolve the system.
double * get_lambda (const problem_parameters &)
void down_resolve (const problem_parameters &, const double *, const int, const int *, const int, const double *, double *)
 A wrapper around private functions, which downdate Cholesky factor and resolve the system.

Private Member Functions

void update (const problem_parameters &, const int, const int *)
 Adds a row corresponding to some inequality constraint to L, see 'Algorithm of Cholesky factor update'.
void update_z (const problem_parameters &, const double *, const int, const int *, const double *)
 Adjust vector 'z' after update.
void downdate (const problem_parameters &, const int, const int, const double *)
 Delete a line from icL, see page 'Downdate of Cholesky factor'.
void resolve (const problem_parameters &, const double *, const int, const int *, const double *, double *)
 Determines feasible descent direction with respect to added inequality constraints.
void form_sa_row (const problem_parameters &, const int, const int, double *)
 Forms row vector 's_a' (Update of Cholesky factor).

Private Attributes

double * nu
 Vector of Lagrange multipliers.
double * XiHg
matrix_E E
 matrix of equality constraints
matrix_ecL_as ecL
 L for equality constraints, see 'Cholesky factor'.
double ** icL
 L for inequality constraints, see 'Cholesky factor'.
double * icL_mem
 All lines of icL are stored in one chunk of memory.
double * z
 Vector z.

Detailed Description

Solves KKT system using Cholesky decomposition.

Definition at line 33 of file chol_solve_as.h.


Constructor & Destructor Documentation

chol_solve_as::chol_solve_as ( const int  N)

Constructor.

Parameters:
[in]Nsize of the preview window.

Definition at line 31 of file chol_solve_as.cpp.

Definition at line 46 of file chol_solve_as.cpp.


Member Function Documentation

void chol_solve_as::down_resolve ( const problem_parameters ppar,
const double *  iHg,
const int  nW,
const int *  W,
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]iHginverted hessian * g.
[in]nWnumber of added constrains (without removed constraint).
[in]Windicies of added constraints (without removed constraint).
[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 'Downdate of z'.

Definition at line 444 of file chol_solve_as.cpp.

void chol_solve_as::downdate ( const problem_parameters ppar,
const int  nW,
const int  ind_exclude,
const double *  x 
) [private]

Delete a line from icL, see page 'Downdate of Cholesky factor'.

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

Definition at line 522 of file chol_solve_as.cpp.

void chol_solve_as::form_sa_row ( const problem_parameters ppar,
const int  ic_num,
const int  var_num,
double *  row 
) [private]

Forms row vector 's_a' (Update of Cholesky factor).

Parameters:
[in]pparparameters
[in]ic_numnumber of constraint, for example 5 if 4 are already added
[in]var_numnumber of constrained variable
[out]row's_a' row

Definition at line 71 of file chol_solve_as.cpp.

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

Definition at line 506 of file chol_solve_as.cpp.

void chol_solve_as::resolve ( const problem_parameters ppar,
const double *  iHg,
const int  nW,
const int *  W,
const double *  x,
double *  dx 
) [private]

Determines feasible descent direction with respect to added inequality constraints.

Parameters:
[in]pparparameters.
[in]iHginverted hessian * g.
[in]nWnumber of added constrains.
[in]Windicies of added constraints.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.

Definition at line 369 of file chol_solve_as.cpp.

void chol_solve_as::solve ( const problem_parameters ppar,
const double *  iHg,
const double *  x,
double *  dx 
)

Determines feasible descent direction.

Parameters:
[in]pparparameters.
[in]iHginverted hessian * g.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.

Definition at line 132 of file chol_solve_as.cpp.

void chol_solve_as::up_resolve ( const problem_parameters ppar,
const double *  iHg,
const int  nW,
const int *  W,
const double *  x,
double *  dx 
)

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

Parameters:
[in]pparparameters.
[in]iHginverted hessian * g.
[in]nWnumber of added constrains.
[in]Windicies of added constraints.
[in]xinitial guess.
[out]dxfeasible descent direction, must be allocated.

Definition at line 202 of file chol_solve_as.cpp.

void chol_solve_as::update ( const problem_parameters ppar,
const int  nW,
const int *  W 
) [private]

Adds a row corresponding to some inequality constraint to L, see 'Algorithm of Cholesky factor update'.

Parameters:
[in]pparparameters.
[in]nWnumber of added inequality constraints + 1.
[in]Windexes of added inequality constraints + one index to be added.

Definition at line 224 of file chol_solve_as.cpp.

void chol_solve_as::update_z ( const problem_parameters ppar,
const double *  iHg,
const int  nW,
const int *  W,
const double *  x 
) [private]

Adjust vector 'z' after update.

Parameters:
[in]pparparameters.
[in]iHginverted hessian * g.
[in]nWnumber of added constrains.
[in]Windicies of added constraints.
[in]xinitial guess.

Definition at line 326 of file chol_solve_as.cpp.


Member Data Documentation

matrix of equality constraints

Definition at line 67 of file chol_solve_as.h.

L for equality constraints, see 'Cholesky factor'.

Definition at line 70 of file chol_solve_as.h.

double** chol_solve_as::icL [private]

L for inequality constraints, see 'Cholesky factor'.

Definition at line 73 of file chol_solve_as.h.

double* chol_solve_as::icL_mem [private]

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

Definition at line 76 of file chol_solve_as.h.

double* chol_solve_as::nu [private]

Vector of Lagrange multipliers.

Definition at line 61 of file chol_solve_as.h.

double* chol_solve_as::XiHg [private]
  • (X + problem_parameters::iHg)

Definition at line 64 of file chol_solve_as.h.

double* chol_solve_as::z [private]

Vector z.

Definition at line 79 of file chol_solve_as.h.


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