34#ifndef EIGEN_PARTIALLU_LAPACK_H
35#define EIGEN_PARTIALLU_LAPACK_H
38#include "./InternalHeaderCheck.h"
44namespace lapacke_helpers {
49template <
typename Scalar,
int StorageOrder>
50struct lapacke_partial_lu {
52 static lapack_int blocked_lu(Index rows, Index cols, Scalar* lu_data, Index luStride, lapack_int* row_transpositions,
53 lapack_int& nb_transpositions, lapack_int maxBlockSize = 256) {
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);
67 return generic_partial_lu_impl<Scalar, StorageOrder, lapack_int, Dynamic>::blocked_lu(
68 rows, cols, lu_data, luStride, row_transpositions, nb_transpositions, maxBlockSize);
70 eigen_assert(info >= 0);
73 for (
int i = 0; i < numext::mini(m, n); i++) {
75 if (ipiv[i] != i) nb_transpositions++;
77 lapack_int first_zero_pivot = info;
78 return first_zero_pivot;
88#define EIGEN_LAPACKE_PARTIAL_LU(EIGTYPE) \
89 template <int StorageOrder> \
90 struct partial_lu_impl<EIGTYPE, StorageOrder, lapack_int, Dynamic> \
91 : public lapacke_helpers::lapacke_partial_lu<EIGTYPE, StorageOrder> {};
93EIGEN_LAPACKE_PARTIAL_LU(
double)
94EIGEN_LAPACKE_PARTIAL_LU(
float)
95EIGEN_LAPACKE_PARTIAL_LU(std::complex<double>)
96EIGEN_LAPACKE_PARTIAL_LU(std::complex<float>)
98#undef EIGEN_LAPACKE_PARTIAL_LU
@ RowMajor
Definition Constants.h:321