Add template to specify QR permutation index type, Fix ColPivHouseholderQR Lapacke bindings

This commit is contained in:
Charles Schlosser
2023-01-11 15:57:28 +00:00
parent 9463fc95f4
commit be7791e097
10 changed files with 309 additions and 252 deletions

View File

@@ -70,6 +70,7 @@ namespace lapacke_helpers {
template<typename Scalar, UpLoType Mode>
struct lapacke_llt {
EIGEN_STATIC_ASSERT(((Mode == Lower) || (Mode == Upper)),MODE_MUST_BE_UPPER_OR_LOWER)
template<typename MatrixType>
static Index blocked(MatrixType& m)
{
@@ -80,10 +81,11 @@ namespace lapacke_helpers {
/* Set up parameters for ?potrf */
lapack_int size = to_lapack(m.rows());
lapack_int matrix_order = lapack_storage_of(m);
constexpr char uplo = Mode == Upper ? 'U' : 'L';
Scalar* a = &(m.coeffRef(0,0));
lapack_int lda = to_lapack(m.outerStride());
lapack_int info = potrf(matrix_order, translate_mode<Mode>, size, to_lapack(a), lda );
lapack_int info = potrf(matrix_order, uplo, size, to_lapack(a), lda );
info = (info==0) ? -1 : info>0 ? info-1 : size;
return info;
}