33#ifndef EIGEN_LLT_LAPACKE_H
34#define EIGEN_LLT_LAPACKE_H
37#include "./InternalHeaderCheck.h"
43namespace lapacke_helpers {
48template <UpLoType Mode>
52struct rank_update<
Lower> {
53 template <
typename MatrixType,
typename VectorType>
54 static Index run(MatrixType &mat,
const VectorType &vec,
const typename MatrixType::RealScalar &sigma) {
55 return Eigen::internal::llt_rank_update_lower(mat, vec, sigma);
60struct rank_update<
Upper> {
61 template <
typename MatrixType,
typename VectorType>
62 static Index run(MatrixType &mat,
const VectorType &vec,
const typename MatrixType::RealScalar &sigma) {
63 Transpose<MatrixType> matt(mat);
64 return Eigen::internal::llt_rank_update_lower(matt, vec.conjugate(), sigma);
72template <
typename Scalar, UpLoType Mode>
74 EIGEN_STATIC_ASSERT(((Mode ==
Lower) || (Mode ==
Upper)), MODE_MUST_BE_UPPER_OR_LOWER)
75 template <
typename MatrixType>
76 static Index blocked(MatrixType &m) {
77 eigen_assert(m.rows() == m.cols());
82 lapack_int size = to_lapack(m.rows());
83 lapack_int matrix_order = lapack_storage_of(m);
84 constexpr char uplo = Mode ==
Upper ?
'U' :
'L';
85 Scalar *a = &(m.coeffRef(0, 0));
86 lapack_int lda = to_lapack(m.outerStride());
88 lapack_int info = potrf(matrix_order, uplo, size, to_lapack(a), lda);
89 info = (info == 0) ? -1 : info > 0 ? info - 1 : size;
93 template <
typename MatrixType,
typename VectorType>
94 static Index rankUpdate(MatrixType &mat,
const VectorType &vec,
const typename MatrixType::RealScalar &sigma) {
95 return rank_update<Mode>::run(mat, vec, sigma);
107#define EIGEN_LAPACKE_LLT(EIGTYPE) \
109 struct llt_inplace<EIGTYPE, Lower> : public lapacke_helpers::lapacke_llt<EIGTYPE, Lower> {}; \
111 struct llt_inplace<EIGTYPE, Upper> : public lapacke_helpers::lapacke_llt<EIGTYPE, Upper> {};
113EIGEN_LAPACKE_LLT(
double)
114EIGEN_LAPACKE_LLT(
float)
115EIGEN_LAPACKE_LLT(std::complex<double>)
116EIGEN_LAPACKE_LLT(std::complex<float>)
118#undef EIGEN_LAPACKE_LLT
@ Lower
Definition Constants.h:211
@ Upper
Definition Constants.h:213
Namespace containing all symbols from the Eigen library.
Definition Core:137