aligator
0.16.0
A versatile and efficient C++ library for real-time constrained trajectory optimization.
|
A parallel-condensing LQ solver. More...
#include <aligator/gar/parallel-solver.hpp>
Classes | |
struct | CondensedKkt |
Public Types | |
using | Scalar = _Scalar |
using | Base = RiccatiSolverBase<Scalar> |
using | Kernel = ProximalRiccatiKernel<Scalar> |
using | KnotType = LqrKnotTpl<Scalar> |
using | BlkView = BlkMatrix<VectorRef, -1, 1> |
using | allocator_type = ::aligator::polymorphic_allocator |
![]() | |
using | Scalar = _Scalar |
using | LqrKnot = LqrKnotTpl<Scalar> |
Public Member Functions | |
ALIGATOR_DYNAMIC_TYPEDEFS_WITH_ROW_TYPES (Scalar) | |
ParallelRiccatiSolver (LqrProblemTpl< Scalar > &problem, const uint num_threads) | |
bool | backward (const Scalar mueq) override |
void | collapseFeedback () override |
void | assembleCondensedSystem (const Scalar mudyn) |
Create the sparse representation of the reduced KKT system. | |
bool | forward (VectorOfVectors &xs, VectorOfVectors &us, VectorOfVectors &vs, VectorOfVectors &lbdas, const std::optional< ConstVectorRef > &=std::nullopt) const override |
void | cycleAppend (const KnotType &knot) override |
Cycle the solver data, given the specs from a given new knot. | |
VectorRef | getFeedforward (size_t i) override |
RowMatrixRef | getFeedback (size_t i) override |
allocator_type | get_allocator () const |
uint | getNumThreads () const noexcept |
Number of parallel divisions in the problem: \(J+1\) in the math. | |
void | initializeTridiagSystem () |
Initialize the buffers for the block-tridiagonal system. | |
![]() | |
ALIGATOR_DYNAMIC_TYPEDEFS_WITH_ROW_TYPES (Scalar) | |
virtual bool | forward (std::vector< VectorXs > &xs, std::vector< VectorXs > &us, std::vector< VectorXs > &vs, std::vector< VectorXs > &lbdas, const std::optional< ConstVectorRef > &theta_=std::nullopt) const =0 |
virtual | ~RiccatiSolverBase ()=default |
Public Attributes | |
std::pmr::vector< StageFactor< Scalar > > | datas |
CondensedKkt | condensedKktSystem |
Block-sparse condensed KKT system. | |
ArenaMatrix< VectorXs > | condensedKktRhs |
Contains the right-hand side and solution of the condensed KKT system. | |
ArenaMatrix< VectorXs > | condensedKktSolution |
ArenaMatrix< VectorXs > | condensedErr |
Scalar | condensedThreshold = 1e-10 |
Tolerance on condensed KKT system. | |
uint | maxRefinementSteps = 5u |
Max number of refinement steps (condensed solver) | |
Protected Member Functions | |
void | initialize () |
Protected Attributes | |
uint | numThreads |
LqrProblemTpl< Scalar > * | problem_ |
std::vector< long > | rhsDims_ |
A parallel-condensing LQ solver.
This solver condenses the problem into a reduced saddle-point problem in a subset of the states and costates, corresponding to the time indices where the problem was split up. These splitting variables are used to exploit the problem's partially-separable structure: each "leg" is then condensed into its value function with respect to both its initial state and last costate (linking to the next leg). The saddle-point is cast into a linear system which is solved by dense LDL factorization. This allows parallel resolution of a (long) linear subproblem on multiple CPU cores.
Definition at line 26 of file parallel-solver.hpp.
using aligator::gar::ParallelRiccatiSolver< _Scalar >::Scalar = _Scalar |
Definition at line 28 of file parallel-solver.hpp.
using aligator::gar::ParallelRiccatiSolver< _Scalar >::Base = RiccatiSolverBase<Scalar> |
Definition at line 30 of file parallel-solver.hpp.
using aligator::gar::ParallelRiccatiSolver< _Scalar >::Kernel = ProximalRiccatiKernel<Scalar> |
Definition at line 31 of file parallel-solver.hpp.
using aligator::gar::ParallelRiccatiSolver< _Scalar >::KnotType = LqrKnotTpl<Scalar> |
Definition at line 32 of file parallel-solver.hpp.
using aligator::gar::ParallelRiccatiSolver< _Scalar >::BlkView = BlkMatrix<VectorRef, -1, 1> |
Definition at line 33 of file parallel-solver.hpp.
using aligator::gar::ParallelRiccatiSolver< _Scalar >::allocator_type = ::aligator::polymorphic_allocator |
Definition at line 34 of file parallel-solver.hpp.
|
explicit |
aligator::gar::ParallelRiccatiSolver< _Scalar >::ALIGATOR_DYNAMIC_TYPEDEFS_WITH_ROW_TYPES | ( | Scalar | ) |
|
overridevirtual |
Implements aligator::gar::RiccatiSolverBase< _Scalar >.
|
inlineoverridevirtual |
For applicable solvers, updates the first feedback gain in-place to correspond to the first Riccati gain.
Reimplemented from aligator::gar::RiccatiSolverBase< _Scalar >.
Definition at line 41 of file parallel-solver.hpp.
void aligator::gar::ParallelRiccatiSolver< _Scalar >::assembleCondensedSystem | ( | const Scalar | mudyn | ) |
Create the sparse representation of the reduced KKT system.
|
override |
|
overridevirtual |
Cycle the solver data, given the specs from a given new knot.
Implements aligator::gar::RiccatiSolverBase< _Scalar >.
|
inlineoverridevirtual |
Implements aligator::gar::RiccatiSolverBase< _Scalar >.
Definition at line 80 of file parallel-solver.hpp.
|
inlineoverridevirtual |
Implements aligator::gar::RiccatiSolverBase< _Scalar >.
Definition at line 81 of file parallel-solver.hpp.
|
inline |
Definition at line 83 of file parallel-solver.hpp.
|
inlinenoexcept |
Number of parallel divisions in the problem: \(J+1\) in the math.
Definition at line 97 of file parallel-solver.hpp.
void aligator::gar::ParallelRiccatiSolver< _Scalar >::initializeTridiagSystem | ( | ) |
Initialize the buffers for the block-tridiagonal system.
|
protected |
std::pmr::vector<StageFactor<Scalar> > aligator::gar::ParallelRiccatiSolver< _Scalar >::datas |
Definition at line 85 of file parallel-solver.hpp.
CondensedKkt aligator::gar::ParallelRiccatiSolver< _Scalar >::condensedKktSystem |
Block-sparse condensed KKT system.
Definition at line 88 of file parallel-solver.hpp.
ArenaMatrix<VectorXs> aligator::gar::ParallelRiccatiSolver< _Scalar >::condensedKktRhs |
Contains the right-hand side and solution of the condensed KKT system.
Definition at line 90 of file parallel-solver.hpp.
ArenaMatrix<VectorXs> aligator::gar::ParallelRiccatiSolver< _Scalar >::condensedKktSolution |
Definition at line 90 of file parallel-solver.hpp.
ArenaMatrix<VectorXs> aligator::gar::ParallelRiccatiSolver< _Scalar >::condensedErr |
Definition at line 90 of file parallel-solver.hpp.
Scalar aligator::gar::ParallelRiccatiSolver< _Scalar >::condensedThreshold = 1e-10 |
Tolerance on condensed KKT system.
Definition at line 92 of file parallel-solver.hpp.
uint aligator::gar::ParallelRiccatiSolver< _Scalar >::maxRefinementSteps = 5u |
Max number of refinement steps (condensed solver)
Definition at line 94 of file parallel-solver.hpp.
|
protected |
Definition at line 103 of file parallel-solver.hpp.
|
protected |
Definition at line 104 of file parallel-solver.hpp.
|
protected |
Definition at line 105 of file parallel-solver.hpp.