|
cyqlone
develop
Fast, parallel and vectorized solver for linear systems with optimal control structure.
|
#include <cyqlone/cyqlone-storage.hpp>
Storage for a linear-quadratic OCP with the initial states x₀ eliminated.
The matrices are combined per stage, with inputs ordered first. The first and last stage are special because of the lack of x₀ and uₙ.
Due to the elimination of x₀, there may be fewer constraints for the first stage, which is tracked by the Ju0 mask. When reconstructing the solution, the multipliers for eliminated constraints are set to zero (we assume that the initial state is feasible w.r.t. the state constraints).
Definition at line 39 of file cyqlone-storage.hpp.
Public Types | |
| using | value_type = T |
| using | matrix = batmat::matrix::Matrix<value_type, index_t> |
| using | Solution = LinearOCPStorage::Solution |
| using | KKTError = LinearOCPStorage::KKTError |
Public Member Functions | |
| void | update_impl (const LinearOCPStorage &ocp) |
| void | update (const LinearOCPStorage &ocp) |
| void | reconstruct_ineq_multipliers (std::span< const value_type > y_compressed, std::span< value_type > y) const |
| std::vector< value_type > | reconstruct_ineq_multipliers (std::span< const value_type > y_compressed) const |
| Solution | reconstruct_solution (const LinearOCPStorage &ocp, std::span< const value_type > ux_compressed, std::span< const value_type > y_compressed, std::span< const value_type > λ_compressed) const |
| KKTError | compute_kkt_error (const LinearOCPStorage &ocp, std::span< const value_type > ux_compressed, std::span< const value_type > y_compressed, std::span< const value_type > λ_compressed) const |
Static Public Member Functions | |
| static CyqloneStorage | build (const LinearOCPStorage &ocp, index_t ny_0=-1) |
| static index_t | count_constr_0 (const LinearOCPStorage &ocp, std::vector< bool > &Ju0) |
Public Attributes | |
| index_t | N_horiz |
| index_t | nx |
| index_t | nu |
| index_t | ny |
| index_t | ny_0 |
| index_t | ny_N |
| std::vector< bool > | Ju0 |
| matrix | data_H |
| matrix | data_F = [this] { return matrix{{.depth = N_horiz, .rows = nx, .cols = nu + nx}}; }() |
| matrix | data_G |
| matrix | data_G0N |
| matrix | data_rq = [this] { return matrix{{.depth = N_horiz, .rows = nu + nx, .cols = 1}}; }() |
| matrix | data_c = [this] { return matrix{{.depth = N_horiz, .rows = nx, .cols = 1}}; }() |
| matrix | data_lb = [this] { return matrix{{.depth = N_horiz - 1, .rows = ny, .cols = 1}}; }() |
| matrix | data_lb0N = [this] { return matrix{{.depth = 1, .rows = ny_0 + ny_N, .cols = 1}}; }() |
| matrix | data_ub = [this] { return matrix{{.depth = N_horiz - 1, .rows = ny, .cols = 1}}; }() |
| matrix | data_ub0N = [this] { return matrix{{.depth = 1, .rows = ny_0 + ny_N, .cols = 1}}; }() |
| std::vector< index_t > | indices_G0 = std::vector<index_t>(ny_0) |
| using cyqlone::CyqloneStorage< T >::value_type = T |
Definition at line 40 of file cyqlone-storage.hpp.
| using cyqlone::CyqloneStorage< T >::matrix = batmat::matrix::Matrix<value_type, index_t> |
Definition at line 44 of file cyqlone-storage.hpp.
| using cyqlone::CyqloneStorage< T >::Solution = LinearOCPStorage::Solution |
Definition at line 72 of file cyqlone-storage.hpp.
| using cyqlone::CyqloneStorage< T >::KKTError = LinearOCPStorage::KKTError |
Definition at line 73 of file cyqlone-storage.hpp.
| void cyqlone::CyqloneStorage< T >::update_impl | ( | const LinearOCPStorage & | ocp | ) |
Definition at line 86 of file cyqlone-storage.cpp.
| void cyqlone::CyqloneStorage< T >::update | ( | const LinearOCPStorage & | ocp | ) |
Definition at line 79 of file cyqlone-storage.cpp.
|
static |
Definition at line 148 of file cyqlone-storage.cpp.
| void cyqlone::CyqloneStorage< T >::reconstruct_ineq_multipliers | ( | std::span< const value_type > | y_compressed, |
| std::span< value_type > | y ) const |
Definition at line 18 of file cyqlone-storage.cpp.
| auto cyqlone::CyqloneStorage< T >::reconstruct_ineq_multipliers | ( | std::span< const value_type > | y_compressed | ) | const |
Definition at line 10 of file cyqlone-storage.cpp.
|
static |
Definition at line 68 of file cyqlone-storage.cpp.
| auto cyqlone::CyqloneStorage< T >::reconstruct_solution | ( | const LinearOCPStorage & | ocp, |
| std::span< const value_type > | ux_compressed, | ||
| std::span< const value_type > | y_compressed, | ||
| std::span< const value_type > | λ_compressed ) const |
Definition at line 32 of file cyqlone-storage.cpp.
| auto cyqlone::CyqloneStorage< T >::compute_kkt_error | ( | const LinearOCPStorage & | ocp, |
| std::span< const value_type > | ux_compressed, | ||
| std::span< const value_type > | y_compressed, | ||
| std::span< const value_type > | λ_compressed ) const |
Definition at line 58 of file cyqlone-storage.cpp.
| index_t cyqlone::CyqloneStorage< T >::N_horiz |
Definition at line 41 of file cyqlone-storage.hpp.
| index_t cyqlone::CyqloneStorage< T >::nx |
Definition at line 42 of file cyqlone-storage.hpp.
| index_t cyqlone::CyqloneStorage< T >::nu |
Definition at line 42 of file cyqlone-storage.hpp.
| index_t cyqlone::CyqloneStorage< T >::ny |
Definition at line 42 of file cyqlone-storage.hpp.
| index_t cyqlone::CyqloneStorage< T >::ny_0 |
Definition at line 42 of file cyqlone-storage.hpp.
| index_t cyqlone::CyqloneStorage< T >::ny_N |
Definition at line 42 of file cyqlone-storage.hpp.
| std::vector<bool> cyqlone::CyqloneStorage< T >::Ju0 |
Definition at line 43 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_H |
Definition at line 45 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_F = [this] { return matrix{{.depth = N_horiz, .rows = nx, .cols = nu + nx}}; }() |
Definition at line 48 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_G |
Definition at line 49 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_G0N |
Definition at line 52 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_rq = [this] { return matrix{{.depth = N_horiz, .rows = nu + nx, .cols = 1}}; }() |
Definition at line 55 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_c = [this] { return matrix{{.depth = N_horiz, .rows = nx, .cols = 1}}; }() |
Definition at line 56 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_lb = [this] { return matrix{{.depth = N_horiz - 1, .rows = ny, .cols = 1}}; }() |
Definition at line 57 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_lb0N = [this] { return matrix{{.depth = 1, .rows = ny_0 + ny_N, .cols = 1}}; }() |
Definition at line 58 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_ub = [this] { return matrix{{.depth = N_horiz - 1, .rows = ny, .cols = 1}}; }() |
Definition at line 59 of file cyqlone-storage.hpp.
| matrix cyqlone::CyqloneStorage< T >::data_ub0N = [this] { return matrix{{.depth = 1, .rows = ny_0 + ny_N, .cols = 1}}; }() |
Definition at line 60 of file cyqlone-storage.hpp.
| std::vector<index_t> cyqlone::CyqloneStorage< T >::indices_G0 = std::vector<index_t>(ny_0) |
Definition at line 61 of file cyqlone-storage.hpp.