Warning, file /include/eigen3/Eigen/src/Cholesky/LLT_LAPACKE.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 #ifndef EIGEN_LLT_LAPACKE_H
0034 #define EIGEN_LLT_LAPACKE_H
0035
0036 namespace Eigen {
0037
0038 namespace internal {
0039
0040 template<typename Scalar> struct lapacke_llt;
0041
0042 #define EIGEN_LAPACKE_LLT(EIGTYPE, BLASTYPE, LAPACKE_PREFIX) \
0043 template<> struct lapacke_llt<EIGTYPE> \
0044 { \
0045 template<typename MatrixType> \
0046 static inline Index potrf(MatrixType& m, char uplo) \
0047 { \
0048 lapack_int matrix_order; \
0049 lapack_int size, lda, info, StorageOrder; \
0050 EIGTYPE* a; \
0051 eigen_assert(m.rows()==m.cols()); \
0052 \
0053 size = convert_index<lapack_int>(m.rows()); \
0054 StorageOrder = MatrixType::Flags&RowMajorBit?RowMajor:ColMajor; \
0055 matrix_order = StorageOrder==RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR; \
0056 a = &(m.coeffRef(0,0)); \
0057 lda = convert_index<lapack_int>(m.outerStride()); \
0058 \
0059 info = LAPACKE_##LAPACKE_PREFIX##potrf( matrix_order, uplo, size, (BLASTYPE*)a, lda ); \
0060 info = (info==0) ? -1 : info>0 ? info-1 : size; \
0061 return info; \
0062 } \
0063 }; \
0064 template<> struct llt_inplace<EIGTYPE, Lower> \
0065 { \
0066 template<typename MatrixType> \
0067 static Index blocked(MatrixType& m) \
0068 { \
0069 return lapacke_llt<EIGTYPE>::potrf(m, 'L'); \
0070 } \
0071 template<typename MatrixType, typename VectorType> \
0072 static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
0073 { return Eigen::internal::llt_rank_update_lower(mat, vec, sigma); } \
0074 }; \
0075 template<> struct llt_inplace<EIGTYPE, Upper> \
0076 { \
0077 template<typename MatrixType> \
0078 static Index blocked(MatrixType& m) \
0079 { \
0080 return lapacke_llt<EIGTYPE>::potrf(m, 'U'); \
0081 } \
0082 template<typename MatrixType, typename VectorType> \
0083 static Index rankUpdate(MatrixType& mat, const VectorType& vec, const typename MatrixType::RealScalar& sigma) \
0084 { \
0085 Transpose<MatrixType> matt(mat); \
0086 return llt_inplace<EIGTYPE, Lower>::rankUpdate(matt, vec.conjugate(), sigma); \
0087 } \
0088 };
0089
0090 EIGEN_LAPACKE_LLT(double, double, d)
0091 EIGEN_LAPACKE_LLT(float, float, s)
0092 EIGEN_LAPACKE_LLT(dcomplex, lapack_complex_double, z)
0093 EIGEN_LAPACKE_LLT(scomplex, lapack_complex_float, c)
0094
0095 }
0096
0097 }
0098
0099 #endif