aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
aligator::gar Namespace Reference

Classes

struct  LQRKnotTpl
 Struct describing a stage of a constrained LQ problem. More...
 
struct  LQRProblemTpl
 
struct  ProximalRiccatiKernel
 Kernel for use in Riccati-like algorithms for the proximal LQ subproblem. More...
 
class  ProximalRiccatiSolver
 A Riccati-like solver for the proximal LQ subproblem in ProxDDP. More...
 
class  RiccatiSolverBase
 
class  RiccatiSolverDense
 A stagewise-dense Riccati solver. More...
 
struct  StageFactor
 Per-node struct for all computations in the factorization. More...
 
struct  workrange_t
 

Functions

template<typename MatrixType >
MatrixType::PlainObject blockTridiagToDenseMatrix (const std::vector< MatrixType > &subdiagonal, const std::vector< MatrixType > &diagonal, const std::vector< MatrixType > &superdiagonal)
 
template<typename MatrixType , typename InputType , typename OutType , typename Scalar = typename MatrixType::Scalar>
bool blockTridiagMatMul (const std::vector< MatrixType > &Asub, const std::vector< MatrixType > &Adiag, const std::vector< MatrixType > &Asuper, const BlkMatrix< InputType, -1, 1 > &b, BlkMatrix< OutType, -1, 1 > &c, const Scalar beta)
 
template<typename MatrixType , typename RhsType , typename DecType >
bool symmetricBlockTridiagSolve (std::vector< MatrixType > &subdiagonal, std::vector< MatrixType > &diagonal, const std::vector< MatrixType > &superdiagonal, BlkMatrix< RhsType, -1, 1 > &rhs, std::vector< DecType > &facs)
 Solve a symmetric block-tridiagonal \(Ax=b\) problem by in-place factorization. The subdiagonal will be used to store factorization coefficients.
 
template<typename MatrixType , typename RhsType , typename DecType >
bool blockTridiagRefinementStep (const std::vector< MatrixType > &transposedUfacs, const std::vector< MatrixType > &superdiagonal, const std::vector< DecType > &diagonalFacs, BlkMatrix< RhsType, -1, 1 > &rhs)
 Given the decomposed matrix data, just perform the backward-forward step of the algorithm.
 
template<typename MatrixType , typename RhsType , typename DecType >
bool symmetricBlockTridiagSolveDownLooking (std::vector< MatrixType > &subdiagonal, std::vector< MatrixType > &diagonal, std::vector< MatrixType > &superdiagonal, BlkMatrix< RhsType, -1, 1 > &rhs, std::vector< DecType > &facs)
 Solve a symmetric block-tridiagonal \(Ax=b\) problem by in-place factorization. The subdiagonal will be used to store factorization coefficients. This version starts by looking down from the top-left corner of the matrix.
 
template<typename Scalar >
std::ostream & operator<< (std::ostream &oss, const LQRKnotTpl< Scalar > &self)
 
template<class T , class A >
boost::span< T > make_span_from_indices (std::vector< T, A > &vec, size_t i0, size_t i1)
 Create a boost::span object from a vector and two indices.
 
template<class T , class A >
boost::span< const T > make_span_from_indices (const std::vector< T, A > &vec, size_t i0, size_t i1)
 Create a boost::span object from a vector and two indices.
 
template<typename Scalar >
auto lqrComputeKktError (const LQRProblemTpl< Scalar > &problem, boost::span< const typename math_types< Scalar >::VectorXs > xs, boost::span< const typename math_types< Scalar >::VectorXs > us, boost::span< const typename math_types< Scalar >::VectorXs > vs, boost::span< const typename math_types< Scalar >::VectorXs > lbdas, const Scalar mudyn, const Scalar mueq, const std::optional< typename math_types< Scalar >::ConstVectorRef > &theta_, bool verbose=false)
 
template<typename Scalar >
bool lqrDenseMatrix (const LQRProblemTpl< Scalar > &problem, Scalar mudyn, Scalar mueq, typename math_types< Scalar >::MatrixXs &mat, typename math_types< Scalar >::VectorXs &rhs)
 Fill in a KKT constraint matrix and vector for the given LQ problem with the given dual-regularization parameters mudyn and mueq.
 
template<typename Scalar >
uint lqrNumRows (const LQRProblemTpl< Scalar > &problem)
 Compute the number of rows in the problem matrix.
 
template<typename Scalar >
auto lqrDenseMatrix (const LQRProblemTpl< Scalar > &problem, Scalar mudyn, Scalar mueq)
 Fill in a KKT constraint matrix and vector for the given LQ problem with the given dual-regularization parameters mudyn and mueq.
 
template<typename Scalar >
void lqrDenseSolutionToTraj (const LQRProblemTpl< Scalar > &problem, const typename math_types< Scalar >::ConstVectorRef solution, std::vector< typename math_types< Scalar >::VectorXs > &xs, std::vector< typename math_types< Scalar >::VectorXs > &us, std::vector< typename math_types< Scalar >::VectorXs > &vs, std::vector< typename math_types< Scalar >::VectorXs > &lbdas)
 Convert dense RHS solution to its trajectory [x,u,v,lambda] solution.
 
template<typename Scalar >
auto lqrInitializeSolution (const LQRProblemTpl< Scalar > &problem)
 
workrange_t get_work (uint horz, uint tid, uint num_threads)
 
template auto lqrComputeKktError< context::Scalar > (const LQRProblemTpl< context::Scalar > &, boost::span< const context::VectorXs >, boost::span< const context::VectorXs >, boost::span< const context::VectorXs >, boost::span< const context::VectorXs >, const context::Scalar, const context::Scalar, const std::optional< context::ConstVectorRef > &, bool)
 
template auto lqrDenseMatrix< context::Scalar > (const LQRProblemTpl< context::Scalar > &, context::Scalar, context::Scalar)
 

Function Documentation

◆ blockTridiagToDenseMatrix()

template<typename MatrixType >
MatrixType::PlainObject aligator::gar::blockTridiagToDenseMatrix ( const std::vector< MatrixType > & subdiagonal,
const std::vector< MatrixType > & diagonal,
const std::vector< MatrixType > & superdiagonal )

Definition at line 14 of file block-tridiagonal.hpp.

◆ blockTridiagMatMul()

template<typename MatrixType , typename InputType , typename OutType , typename Scalar = typename MatrixType::Scalar>
bool aligator::gar::blockTridiagMatMul ( const std::vector< MatrixType > & Asub,
const std::vector< MatrixType > & Adiag,
const std::vector< MatrixType > & Asuper,
const BlkMatrix< InputType, -1, 1 > & b,
BlkMatrix< OutType, -1, 1 > & c,
const Scalar beta )

Definition at line 50 of file block-tridiagonal.hpp.

◆ symmetricBlockTridiagSolve()

template<typename MatrixType , typename RhsType , typename DecType >
bool aligator::gar::symmetricBlockTridiagSolve ( std::vector< MatrixType > & subdiagonal,
std::vector< MatrixType > & diagonal,
const std::vector< MatrixType > & superdiagonal,
BlkMatrix< RhsType, -1, 1 > & rhs,
std::vector< DecType > & facs )

Solve a symmetric block-tridiagonal \(Ax=b\) problem by in-place factorization. The subdiagonal will be used to store factorization coefficients.

Definition at line 79 of file block-tridiagonal.hpp.

◆ blockTridiagRefinementStep()

template<typename MatrixType , typename RhsType , typename DecType >
bool aligator::gar::blockTridiagRefinementStep ( const std::vector< MatrixType > & transposedUfacs,
const std::vector< MatrixType > & superdiagonal,
const std::vector< DecType > & diagonalFacs,
BlkMatrix< RhsType, -1, 1 > & rhs )

Given the decomposed matrix data, just perform the backward-forward step of the algorithm.

Parameters
transposedUfacs- transposed U factors in the decomposition
superdiagonal- superdiagonal of the original matrix
diagonalFacs- diagonal factor decompositions

Definition at line 143 of file block-tridiagonal.hpp.

◆ symmetricBlockTridiagSolveDownLooking()

template<typename MatrixType , typename RhsType , typename DecType >
bool aligator::gar::symmetricBlockTridiagSolveDownLooking ( std::vector< MatrixType > & subdiagonal,
std::vector< MatrixType > & diagonal,
std::vector< MatrixType > & superdiagonal,
BlkMatrix< RhsType, -1, 1 > & rhs,
std::vector< DecType > & facs )

Solve a symmetric block-tridiagonal \(Ax=b\) problem by in-place factorization. The subdiagonal will be used to store factorization coefficients. This version starts by looking down from the top-left corner of the matrix.

Definition at line 182 of file block-tridiagonal.hpp.

◆ operator<<()

template<typename Scalar >
std::ostream & aligator::gar::operator<< ( std::ostream & oss,
const LQRKnotTpl< Scalar > & self )

Definition at line 138 of file lqr-problem.hpp.

◆ make_span_from_indices() [1/2]

template<class T , class A >
boost::span< T > aligator::gar::make_span_from_indices ( std::vector< T, A > & vec,
size_t i0,
size_t i1 )
inline

Create a boost::span object from a vector and two indices.

Definition at line 21 of file riccati-impl.hpp.

◆ make_span_from_indices() [2/2]

template<class T , class A >
boost::span< const T > aligator::gar::make_span_from_indices ( const std::vector< T, A > & vec,
size_t i0,
size_t i1 )
inline

Create a boost::span object from a vector and two indices.

Definition at line 28 of file riccati-impl.hpp.

◆ lqrComputeKktError()

template<typename Scalar >
auto aligator::gar::lqrComputeKktError ( const LQRProblemTpl< Scalar > & problem,
boost::span< const typename math_types< Scalar >::VectorXs > xs,
boost::span< const typename math_types< Scalar >::VectorXs > us,
boost::span< const typename math_types< Scalar >::VectorXs > vs,
boost::span< const typename math_types< Scalar >::VectorXs > lbdas,
const Scalar mudyn,
const Scalar mueq,
const std::optional< typename math_types< Scalar >::ConstVectorRef > & theta_,
bool verbose = false )

Definition at line 11 of file utils.hpp.

◆ lqrDenseMatrix() [1/2]

template<typename Scalar >
bool aligator::gar::lqrDenseMatrix ( const LQRProblemTpl< Scalar > & problem,
Scalar mudyn,
Scalar mueq,
typename math_types< Scalar >::MatrixXs & mat,
typename math_types< Scalar >::VectorXs & rhs )

Fill in a KKT constraint matrix and vector for the given LQ problem with the given dual-regularization parameters mudyn and mueq.

Returns
Whether the matrices were successfully allocated.

Definition at line 112 of file utils.hpp.

◆ lqrNumRows()

template<typename Scalar >
uint aligator::gar::lqrNumRows ( const LQRProblemTpl< Scalar > & problem)

Compute the number of rows in the problem matrix.

Definition at line 186 of file utils.hpp.

◆ lqrDenseMatrix() [2/2]

template<typename Scalar >
auto aligator::gar::lqrDenseMatrix ( const LQRProblemTpl< Scalar > & problem,
Scalar mudyn,
Scalar mueq )

Fill in a KKT constraint matrix and vector for the given LQ problem with the given dual-regularization parameters mudyn and mueq.

Definition at line 202 of file utils.hpp.

◆ lqrDenseSolutionToTraj()

template<typename Scalar >
void aligator::gar::lqrDenseSolutionToTraj ( const LQRProblemTpl< Scalar > & problem,
const typename math_types< Scalar >::ConstVectorRef solution,
std::vector< typename math_types< Scalar >::VectorXs > & xs,
std::vector< typename math_types< Scalar >::VectorXs > & us,
std::vector< typename math_types< Scalar >::VectorXs > & vs,
std::vector< typename math_types< Scalar >::VectorXs > & lbdas )

Convert dense RHS solution to its trajectory [x,u,v,lambda] solution.

Definition at line 221 of file utils.hpp.

◆ lqrInitializeSolution()

template<typename Scalar >
auto aligator::gar::lqrInitializeSolution ( const LQRProblemTpl< Scalar > & problem)

Definition at line 254 of file utils.hpp.

◆ get_work()

workrange_t aligator::gar::get_work ( uint horz,
uint tid,
uint num_threads )
inline

Definition at line 14 of file work.hpp.

◆ lqrComputeKktError< context::Scalar >()

template auto aligator::gar::lqrComputeKktError< context::Scalar > ( const LQRProblemTpl< context::Scalar > & ,
boost::span< const context::VectorXs > ,
boost::span< const context::VectorXs > ,
boost::span< const context::VectorXs > ,
boost::span< const context::VectorXs > ,
const context::Scalar ,
const context::Scalar ,
const std::optional< context::ConstVectorRef > & ,
bool  )

◆ lqrDenseMatrix< context::Scalar >()