Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ cholesky_decompose()

template<typename T , typename = require_floating_point_t<T>>
void stan::math::opencl::cholesky_decompose ( matrix_cl< T > &  A)
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.

Exceptions
std::domain_errorif m is not positive definite (if m has more than 0 elements)

Definition at line 43 of file cholesky_decompose.hpp.