33 #ifndef EIGEN_LLT_LAPACKE_H 34 #define EIGEN_LLT_LAPACKE_H 37 #include "./InternalHeaderCheck.h" 43 namespace lapacke_helpers {
48 template <UpLoType Mode>
49 struct rank_update {};
52 struct 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);
60 struct 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);
72 template <
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> {}; 113 EIGEN_LAPACKE_LLT(
double)
114 EIGEN_LAPACKE_LLT(
float)
115 EIGEN_LAPACKE_LLT(std::complex<double>)
116 EIGEN_LAPACKE_LLT(std::complex<float>)
118 #undef EIGEN_LAPACKE_LLT 124 #endif // EIGEN_LLT_LAPACKE_H Namespace containing all symbols from the Eigen library.
Definition: B01_Experimental.dox:1
Definition: Constants.h:211
EIGEN_DEFAULT_DENSE_INDEX_TYPE Index
The Index type as used for the API.
Definition: Meta.h:82
Definition: Constants.h:213