jrl::qp::decomposition Namespace Reference

Functions

JRLQP_DLLAPI bool blockArrowLLT (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &side, bool up=false)
 
JRLQP_DLLAPI void blockArrowLSolve (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &side, bool up, MatrixRef M, int start=0, int end=-1)
 
JRLQP_DLLAPI void blockArrowLTransposeSolve (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &side, bool up, MatrixRef M, int start=0, int end=-1)
 
JRLQP_DLLAPI bool triBlockDiagLLT (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &subDiag)
 
JRLQP_DLLAPI void triBlockDiagLSolve (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &subDiag, MatrixRef M, int start=0)
 
JRLQP_DLLAPI void triBlockDiagLTransposeSolve (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &subDiag, MatrixRef M, int end=-1)
 
template<bool Up>
bool blockArrowLLT_ (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &side)
 
template<bool Up>
void blockArrowLSolve_ (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &side, MatrixRef M, int start, int end)
 
template<bool Up>
void blockArrowLTransposeSolve_ (const std::vector< MatrixRef > &diag, const std::vector< MatrixRef > &side, MatrixRef M, int start, int end)
 

Function Documentation

◆ blockArrowLLT()

bool jrl::qp::decomposition::blockArrowLLT ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  side,
bool  up = false 
)

Cholesky decomposition of a matrix of the form (arrow-like)

\( \begin{bmatrix} D_1 & S_1^T & S_2^T & \cdots \\ S_1 & D_2 & & \\ S_2 & & D_3 & \\ \vdots & & & \ddots \\ \end{bmatrix}\) (up = true) or \( \begin{bmatrix} D_1 & & & S_1^T \\ &\ddots & & \vdots \\ & & D_{b-1} & S_{b-1}^T \\ S_1 &\cdots & S_{b-1} & Db \\ \end{bmatrix}\) (up = false)

Parameters
diagblocks \( D_i \) on the diagonal. Only the lower triangular part is actually used.
sideblocks \( S_i \).
upWhether the arrow is poiting up or down.

If up = false, the decomposition \( M = L L^T\) is performed. If up = true, the decomposition \( P^T M P = L L^T \) is performed, where

\( \begin{bmatrix} 0 &\cdots & 0 & I \\ I & & & 0 \\ &\ddots & & \vdots \\ & & I & 0 \\ \end{bmatrix}\) is such that \( P^T M P = \begin{bmatrix} D_2 & & & S_1 \\ &\ddots & & \vdots \\ & & D_b & S_{b-1} \\ S_1^T &\cdots & S_{b-1}^T & D1 \\ \end{bmatrix} \)

Then, \( L \) is such that

\( L = \begin{bmatrix} L_1 & & & \\ & L_2 & & \\ & &\ddots & \\ B_1 & B_2 &\cdots & L_b \\ \end{bmatrix}\) (up = false) or \( L = \begin{bmatrix} L_2 & & & \\ &\ddots & & \\ & & L_b & \\ B_1 &\cdots & B_{b-1} & L_1 \\ \end{bmatrix}\) (up = true)

and upon return \( D_i \) contains \( L_i \), and \( S_i \) contains \( B_i \) if up = false or \( B_i^T \) if up = true. Only the lower triangular part of \( D_i \) is used to store \( L_i \). Its upper part remains whatever was there originally.

◆ blockArrowLLT_()

template<bool Up>
bool jrl::qp::decomposition::blockArrowLLT_ ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  side 
)

◆ blockArrowLSolve()

void jrl::qp::decomposition::blockArrowLSolve ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  side,
bool  up,
MatrixRef  M,
int  start = 0,
int  end = -1 
)

Solve in place the system P L X = M where L is the triangular factor obtained from blockArrowLLT and P is a permutation depending on up.

Parameters
diagblocks on the diagonal of L. Only the lower triangular part is actually used.
sidenon zero blocks under the diagonal.
Mright hand side of the equation (matrix or vector). Contains the solution upon return.
startFirst row of M that is not 0. Useful for optimizing computations.
endFirst row of the terminal 0 block in M. If end < 0, M has no terminal 0 block. Useful for optimizing computations.

◆ blockArrowLSolve_()

template<bool Up>
void jrl::qp::decomposition::blockArrowLSolve_ ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  side,
MatrixRef  M,
int  start,
int  end 
)

◆ blockArrowLTransposeSolve()

void jrl::qp::decomposition::blockArrowLTransposeSolve ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  side,
bool  up,
MatrixRef  M,
int  start = 0,
int  end = -1 
)

Solve in place the system L^T P^T X = M where L is the triangular factor obtained from blockArrowLLT and P is a permutation depending on up.

Parameters
diagblocks on the diagonal of L. Only the lower triangular part is actually used.
sidenon zero blocks under the diagonal.
Mright hand side of the equation (matrix or vector). Contains the solution upon return.
startFirst row of M that is not 0. Useful for optimizing computations.
endFirst row of the terminal 0 block in M. If end < 0, M has no terminal 0 block. Useful for optimizing computations.

◆ blockArrowLTransposeSolve_()

template<bool Up>
void jrl::qp::decomposition::blockArrowLTransposeSolve_ ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  side,
MatrixRef  M,
int  start,
int  end 
)

◆ triBlockDiagLLT()

bool jrl::qp::decomposition::triBlockDiagLLT ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  subDiag 
)

Cholesky decomposition of a matrix of the form

\( \begin{bmatrix} D_1 & S_1^T & & & \\ S_1 & D_2 & S_2^T & & \\ & S_2 & D_3 & S_3^T & \\ & &\ddots &\ddots &\ddots \\ \end{bmatrix}\)

Parameters
diagblocks \( D_i \) on the diagonal. Only the lower triangular part is actually used.
subDiagblocks \( S_i \) under the diagonal.

The decomposition is done in place: the Cholesky factor is

\( \begin{bmatrix} L_1 & & & \\ B_1 & L_2 & & \\ & B_2 & L_3 & \\ & &\ddots &\ddots \\ \end{bmatrix}\)

and upon return \( D_i \) contains \( L_i \) and \( S_i \) contains \( B_i \). Only the lower triangular part of \( D_i \) is used to store \( L_i \). Its upper part remains whatever was there originally.

◆ triBlockDiagLSolve()

void jrl::qp::decomposition::triBlockDiagLSolve ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  subDiag,
MatrixRef  M,
int  start = 0 
)

Solve in place the system L X = M where L is the triangular factor obtained from triBlockDiagLLT.

Parameters
diagblocks on the diagonal of L. Only the lower triangular part is actually used.
subDiagblocks under the diagonal.
Mright hand side of the equation (matrix or vector). Contains the solution upon return.
startFirst row of M that is not 0. Useful for optimizing computations.

◆ triBlockDiagLTransposeSolve()

void jrl::qp::decomposition::triBlockDiagLTransposeSolve ( const std::vector< MatrixRef > &  diag,
const std::vector< MatrixRef > &  subDiag,
MatrixRef  M,
int  end = -1 
)

Solve in place the system L^T X = M where L is the triangular factor obtained from triBlockDiagLLT.

Parameters
diagblocks on the diagonal of L. Only the lower triangular part is actually used.
subDiagblocks under the diagonal.
Mright hand side of the equation (matrix or vector). Contains the solution upon return.
endWriting M = [N 0]^T, end is the index of the first row of the terminal 0 block. If end<0 (default value), M has no terminal 0 block.