A sparse MPC solver for walking motion generation (old version).
|
Solves KKT system using Cholesky decomposition. More...
#include <chol_solve_as.h>
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. |
Solves KKT system using Cholesky decomposition.
Definition at line 33 of file chol_solve_as.h.
chol_solve_as::chol_solve_as | ( | const int | N | ) |
Constructor.
[in] | N | size of the preview window. |
Definition at line 31 of file chol_solve_as.cpp.
Definition at line 46 of file chol_solve_as.cpp.
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.
[in] | ppar | parameters. |
[in] | iHg | inverted hessian * g. |
[in] | nW | number of added constrains (without removed constraint). |
[in] | W | indicies of added constraints (without removed constraint). |
[in] | ind_exclude | index of excluded constraint. |
[in] | x | initial guess. |
[out] | dx | feasible descent direction, must be allocated. |
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'.
[in] | ppar | parameters. |
[in] | nW | number of added constrains. |
[in] | ind_exclude | index of excluded constraint. |
[in] | x | initial 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).
[in] | ppar | parameters |
[in] | ic_num | number of constraint, for example 5 if 4 are already added |
[in] | var_num | number 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 | ) |
[in] | ppar | parameters |
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.
[in] | ppar | parameters. |
[in] | iHg | inverted hessian * g. |
[in] | nW | number of added constrains. |
[in] | W | indicies of added constraints. |
[in] | x | initial guess. |
[out] | dx | feasible 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.
[in] | ppar | parameters. |
[in] | iHg | inverted hessian * g. |
[in] | x | initial guess. |
[out] | dx | feasible 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.
[in] | ppar | parameters. |
[in] | iHg | inverted hessian * g. |
[in] | nW | number of added constrains. |
[in] | W | indicies of added constraints. |
[in] | x | initial guess. |
[out] | dx | feasible 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'.
[in] | ppar | parameters. |
[in] | nW | number of added inequality constraints + 1. |
[in] | W | indexes 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.
[in] | ppar | parameters. |
[in] | iHg | inverted hessian * g. |
[in] | nW | number of added constrains. |
[in] | W | indicies of added constraints. |
[in] | x | initial guess. |
Definition at line 326 of file chol_solve_as.cpp.
matrix_E chol_solve_as::E [private] |
matrix of equality constraints
Definition at line 67 of file chol_solve_as.h.
matrix_ecL_as chol_solve_as::ecL [private] |
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] |
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.