Initializes lower diagonal matrix L and performs backward and forward substitutions using this matrix.
More...
#include <as_matrix_ecL.h>
|
void | chol_dec (double *) |
| Performs Cholesky decomposition of 3x3 matrix. More...
|
|
void | form_iQBiPB (const double *, const double *, const double, double *) |
| Forms matrix iQBiPB = 0.5 * inv(Q) + 0.5 * B * inv(P) * B. More...
|
|
void | form_iQAT (const double, const double, const double *) |
| Forms matrix iQAT = 0.5 * inv (Q) * A'. More...
|
|
void | form_AiQATiQBiPB (const problem_parameters &, const state_parameters &, double *) |
| Forms matrix AiQATiQBiPB = A * inv(Q) * A' + 0.5 * inv(Q) + 0.5 * B * inv(P) * B. More...
|
|
void | form_L_non_diag (const double *, double *) |
| Forms a 3x3 matrix L(k+1, k), which lies below the diagonal of L. More...
|
|
void | form_L_diag (const double *, double *) |
| Forms a 3x3 matrix L(k+1, k+1), which lies on the main diagonal of L. More...
|
|
Initializes lower diagonal matrix L and performs backward and forward substitutions using this matrix.
Definition at line 35 of file as_matrix_ecL.h.
◆ matrix_ecL()
AS::matrix_ecL::matrix_ecL |
( |
const int |
N | ) |
|
A constant and well structured 'upper' part of Cholesky factor, which corresponds to equality constraints is
full L | compressed L
a |
0 a | a
b 0 c 0 | b c
0 b 0 c | ===> d e
d 0 e | ===> f g
0 d 0 e | ...
0 f 0 g |
0 f 0 g |
.... |
Here a,c,e,g - lower diagonal 3x3 matrices; b,d,f - upper triangular 3x3 matrices. This matrix is reffered as ecL. It is stored as a sequence of vectors of 9 elements:
0 3 6
1 4 7
2 5 8
9 12 15 18 21 24
10 13 16 19 22 25
11 14 17 20 23 26
... ...
Definition at line 50 of file as_matrix_ecL.cpp.
◆ ~matrix_ecL()
AS::matrix_ecL::~matrix_ecL |
( |
| ) |
|
◆ chol_dec()
void AS::matrix_ecL::chol_dec |
( |
double * |
mx9 | ) |
|
|
private |
Performs Cholesky decomposition of 3x3 matrix.
- Parameters
-
[in,out] | mx9 | a pointer to matrix, the result is stored in the same place. |
- Attention
- Only the elements below the main diagonal are initialized.
Definition at line 127 of file as_matrix_ecL.cpp.
◆ form()
◆ form_AiQATiQBiPB()
Forms matrix AiQATiQBiPB = A * inv(Q) * A' + 0.5 * inv(Q) + 0.5 * B * inv(P) * B.
- Parameters
-
[in] | ppar | problem parameters. |
[in] | stp | state parameters. |
[out] | result | result |
- Attention
- Only the elements below the main diagonal are initialized.
Definition at line 202 of file as_matrix_ecL.cpp.
◆ form_iQAT()
void AS::matrix_ecL::form_iQAT |
( |
const double |
A3, |
|
|
const double |
A6, |
|
|
const double * |
i2Q |
|
) |
| |
|
private |
Forms matrix iQAT = 0.5 * inv (Q) * A'.
- Parameters
-
[in] | A3 | 4th and 7th elements of A. |
[in] | A6 | 6th element of A. |
[in] | i2Q | a vector of 3 elements, which contains diagonal elements of 0.5*inv(Q). |
Definition at line 181 of file as_matrix_ecL.cpp.
◆ form_iQBiPB()
void AS::matrix_ecL::form_iQBiPB |
( |
const double * |
B, |
|
|
const double * |
i2Q, |
|
|
const double |
i2P, |
|
|
double * |
result |
|
) |
| |
|
private |
Forms matrix iQBiPB = 0.5 * inv(Q) + 0.5 * B * inv(P) * B.
- Parameters
-
[in] | B | a vector of 3 elements. |
[in] | i2Q | a vector of 3 elements, which contains diagonal elements of 0.5 * inv(Q). |
[in] | i2P | 0.5 * inv(P) (only one number) |
[out] | result | the result |
- Attention
- Only the elements below the main diagonal are initialized.
Definition at line 158 of file as_matrix_ecL.cpp.
◆ form_L_diag()
void AS::matrix_ecL::form_L_diag |
( |
const double * |
ecLp, |
|
|
double * |
ecLc |
|
) |
| |
|
private |
Forms a 3x3 matrix L(k+1, k+1), which lies on the main diagonal of L.
- Parameters
-
[in] | ecLp | upper triangular matrix matrix lying to the left from ecLc on the same level of L |
[in] | ecLc | the result is stored here |
- Attention
- Only the elements below the main diagonal are initialized.
Definition at line 268 of file as_matrix_ecL.cpp.
◆ form_L_non_diag()
void AS::matrix_ecL::form_L_non_diag |
( |
const double * |
ecLp, |
|
|
double * |
ecLc |
|
) |
| |
|
private |
Forms a 3x3 matrix L(k+1, k), which lies below the diagonal of L.
- Parameters
-
[in] | ecLp | previous matrix lying on the diagonal of L |
[in] | ecLc | the result is stored here |
Definition at line 232 of file as_matrix_ecL.cpp.
◆ solve_backward()
void AS::matrix_ecL::solve_backward |
( |
const int |
N, |
|
|
double * |
x |
|
) |
| const |
Solve system ecL' * x = b using backward substitution.
- Parameters
-
[in] | N | number of states in the preview window |
[in,out] | x | vector "b" as input, vector "x" as output. |
Definition at line 396 of file as_matrix_ecL.cpp.
◆ solve_forward()
void AS::matrix_ecL::solve_forward |
( |
const int |
N, |
|
|
double * |
x, |
|
|
const int |
start_ind = 0 |
|
) |
| const |
Solve system ecL * x = b using forward substitution.
- Parameters
-
[in] | N | number of states in the preview window |
[in,out] | x | vector "b" as input, vector "x" as output (N * SMPC_NUM_STATE_VAR) |
[in] | start_ind | an index of a state, from which substitution should start |
- Note
- This function can perform partial forward substitution starting from a given state, and ignoring all preceding states. This is useful when it is known, that all variables in the preceding states are 0.
Definition at line 334 of file as_matrix_ecL.cpp.
◆ ecL
double* AS::matrix_ecL::ecL |
◆ ecL_diag
double** AS::matrix_ecL::ecL_diag |
◆ ecL_ndiag
double** AS::matrix_ecL::ecL_ndiag |
◆ iQAT
double* AS::matrix_ecL::iQAT |
|
private |
The documentation for this class was generated from the following files: