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

Namespaces

namespace  helpers
 

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. This algorithm uses a dense Bunch-Kaufman factorization at every stage. More...
 
struct  StageFactor
 Per-node struct for all computations in the factorization. More...
 
struct  workrange_t
 

Typedefs

using uint = unsigned int
 

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 >
void lqrCreateSparseMatrix (const LQRProblemTpl< Scalar > &problem, const Scalar mudyn, const Scalar mueq, Eigen::SparseMatrix< Scalar > &mat, Eigen::Matrix< Scalar, -1, 1 > &rhs, bool update)
 
template<typename Scalar >
std::array< Scalar, 3 > 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 void lqrCreateSparseMatrix< context::Scalar > (const LQRProblemTpl< context::Scalar > &problem, const context::Scalar mudyn, const context::Scalar mueq, Eigen::SparseMatrix< context::Scalar > &mat, context::VectorXs &rhs, bool update)
 
template std::array< context::Scalar, 3 > 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)
 

Detailed Description

Author
Wilson Jallet

Typedef Documentation

◆ uint

using aligator::gar::uint = unsigned int

Definition at line 7 of file work.hpp.

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 110 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 22 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 29 of file riccati-impl.hpp.

◆ lqrCreateSparseMatrix()

template<typename Scalar >
void aligator::gar::lqrCreateSparseMatrix ( const LQRProblemTpl< Scalar > & problem,
const Scalar mudyn,
const Scalar mueq,
Eigen::SparseMatrix< Scalar > & mat,
Eigen::Matrix< Scalar, -1, 1 > & rhs,
bool update )

◆ lqrComputeKktError()

template<typename Scalar >
std::array< Scalar, 3 > 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 )

◆ 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.

◆ lqrNumRows()

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

Compute the number of rows in the problem matrix.

Definition at line 72 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 88 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 107 of file utils.hpp.

◆ lqrInitializeSolution()

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

Definition at line 140 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.

◆ lqrCreateSparseMatrix< context::Scalar >()

template void aligator::gar::lqrCreateSparseMatrix< context::Scalar > ( const LQRProblemTpl< context::Scalar > & problem,
const context::Scalar mudyn,
const context::Scalar mueq,
Eigen::SparseMatrix< context::Scalar > & mat,
context::VectorXs & rhs,
bool update )

◆ lqrComputeKktError< context::Scalar >()

template std::array< context::Scalar, 3 > 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 >()