Stan Math Library
4.9.0
Automatic Differentiation
|
int stan::math::opencl_kernels::get_twisted_factorization | ( | const __global double_d * | l, |
const __global double_d * | d, | ||
double_d | shift, | ||
__global double_d * | l_plus, | ||
__global double_d * | u_minus, | ||
__global double_d * | s | ||
) |
Calculates shifted LDL and UDU factorizations.
Combined with twist index they form twisted factorization for calculation of an eigenvector corresponding to eigenvalue that is equal to the shift. Tha algorithm is sometimes called diferential twisted quotient-differences with shifts (dtwqds). L * D * L^T - shift * I = L+ * D+ * L+^T = U- * D- * U-^T D, D+ and D- are diagonal, L and L+ are lower unit triangular (diagonal elements are 1, all elements except diagonal and subdiagonal are 0), U- is upper unit triangular (diagonal elements are 1, all elements except diagonal and superdiagonal are 0)
l | Subdiagonal of L. | |
d | Diagonal of D. | |
shift | Shift. | |
[out] | l_plus | Subdiagonal of L+. |
[out] | u_minus | Superdiagonal of U-. |
s | Temporary array of the same size as d. |