33#ifndef EIGEN_PARTIALLU_LAPACK_H
34#define EIGEN_PARTIALLU_LAPACK_H
37#include "./InternalHeaderCheck.h"
43namespace lapacke_helpers {
48template <
typename Scalar,
int StorageOrder>
49struct lapacke_partial_lu {
51 static lapack_int blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, lapack_int* row_transpositions,
52 lapack_int& nb_transpositions, lapack_int maxBlockSize = 256) {
53 EIGEN_UNUSED_VARIABLE(maxBlockSize);
55 lapack_int matrix_order = StorageOrder ==
RowMajor ? LAPACK_ROW_MAJOR : LAPACK_COL_MAJOR;
56 lapack_int lda = to_lapack(luStride);
58 lapack_int* ipiv = row_transpositions;
59 lapack_int m = to_lapack(rows);
60 lapack_int n = to_lapack(cols);
61 nb_transpositions = 0;
63 lapack_int info = getrf(matrix_order, m, n, to_lapack(a), lda, ipiv);
64 eigen_assert(info >= 0);
66 for (
int i = 0; i < m; i++) {
68 if (ipiv[i] != i) nb_transpositions++;
70 lapack_int first_zero_pivot = info;
71 return first_zero_pivot;
81#define EIGEN_LAPACKE_PARTIAL_LU(EIGTYPE) \
82 template <int StorageOrder> \
83 struct partial_lu_impl<EIGTYPE, StorageOrder, lapack_int, Dynamic> \
84 : public lapacke_helpers::lapacke_partial_lu<EIGTYPE, StorageOrder> {};
86EIGEN_LAPACKE_PARTIAL_LU(
double)
87EIGEN_LAPACKE_PARTIAL_LU(
float)
88EIGEN_LAPACKE_PARTIAL_LU(std::complex<double>)
89EIGEN_LAPACKE_PARTIAL_LU(std::complex<float>)
91#undef EIGEN_LAPACKE_PARTIAL_LU
@ RowMajor
Definition Constants.h:320
Namespace containing all symbols from the Eigen library.
Definition Core:137