Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Performs an in-place computation of the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix.
The return value \(L\) will be a lower-triangular matrix such that the original matrix \(A\) is given by
\(A = L \times L^T\). The Cholesky decomposition is computed using an OpenCL kernel. This algorithm is recursive. The matrix is subset into a matrix of size A.rows() / 4
, and if the submatrix size is less than 50 or min_block
then the Cholesky decomposition on the OpenCL device is computed using that submatrix. If the submatrix is greater than 50 or min_block
then cholesky_decompose
is run again on a submatrix with size equal to submat.rows() / 4
. Once the Cholesky decomposition is computed, the full matrix Cholesky is created by propagating the Cholesky forward as given in the reference report below.
For a full guide to how this works see the Cholesky decomposition chapter in the reference report here.
std::domain_error | if m is not positive definite (if m has more than 0 elements) |
Definition at line 43 of file cholesky_decompose.hpp.