35#ifndef _BLAZE_MATH_LAPACK_HEEVX_H_
36#define _BLAZE_MATH_LAPACK_HEEVX_H_
74template<
typename MT,
bool SO,
typename VT,
bool TF >
77template<
typename MT,
bool SO,
typename VT,
bool TF,
typename ST >
80template<
typename MT1,
bool SO1,
typename VT,
bool TF,
typename MT2,
bool SO2 >
84template<
typename MT1,
bool SO1,
typename VT,
bool TF,
typename MT2,
bool SO2,
typename ST >
120 char uplo,
char range, ST vl, ST vu,
124 BLAZE_INTERNAL_ASSERT( range !=
'A' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
125 BLAZE_INTERNAL_ASSERT( range !=
'V' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
126 BLAZE_INTERNAL_ASSERT( range !=
'I' || (*w).size() ==
size_t( iu-il+1 ),
"Invalid vector dimension detected" );
140 const std::unique_ptr<CT[]> work (
new CT[lwork] );
141 const std::unique_ptr<BT[]> rwork(
new BT[7*n] );
142 const std::unique_ptr<blas_int_t[]> iwork(
new blas_int_t[5*n] );
143 const std::unique_ptr<blas_int_t[]> ifail(
new blas_int_t[n] );
145 heevx(
'N', range, uplo, n, (*A).data(), lda, vl, vu, il, iu, BT(0), &m, (*w).data(),
146 nullptr, 1, work.get(), lwork, rwork.get(), iwork.get(), ifail.get(), &info );
241 const size_t N( (*A).rows() );
247 if( uplo !=
'L' && uplo !=
'U' ) {
257 return heevx_backend( *A, *w, uplo,
'A', BT(), BT(), 0, 0 );
380 const size_t N( (*A).rows() );
387 if( uplo !=
'L' && uplo !=
'U' ) {
403 return heevx_backend( *A, *w, uplo, range, vl, vu, il, iu );
432template<
typename MT1
439inline size_t heevx_backend( DenseMatrix<MT1,SO1>& A, DenseVector<VT,TF>& w,
440 DenseMatrix<MT2,SO2>& Z,
char uplo,
char range,
444 BLAZE_INTERNAL_ASSERT( range !=
'A' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
445 BLAZE_INTERNAL_ASSERT( range !=
'V' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
446 BLAZE_INTERNAL_ASSERT( range !=
'I' || (*w).size() ==
size_t( iu-il+1 ),
"Invalid vector dimension detected" );
452 using CT = ElementType_t<MT1>;
465 const std::unique_ptr<CT[]> work (
new CT[lwork] );
466 const std::unique_ptr<BT[]> rwork(
new BT[7*n] );
467 const std::unique_ptr<blas_int_t[]> iwork(
new blas_int_t[5*n] );
468 const std::unique_ptr<blas_int_t[]> ifail(
new blas_int_t[n] );
470 heevx(
'N', range, uplo, n, (*A).data(), lda, vl, vu, il, iu, BT(0), &m, (*w).data(),
471 (*Z).data(), ldz, work.get(), lwork, rwork.get(), iwork.get(), ifail.get(), &info );
551template<
typename MT1
583 const size_t N( (*A).rows() );
589 if( uplo !=
'L' && uplo !=
'U' ) {
594 resize( *Z, N, N,
false );
600 return heevx_backend( *A, *w, *Z, uplo,
'A', BT(), BT(), 0, 0 );
701template<
typename MT1
743 const size_t N( (*A).rows() );
750 if( uplo !=
'L' && uplo !=
'U' ) {
768 return heevx_backend( *A, *w, *Z, uplo, range, vl, vu, il, iu );
Constraint on the data type.
Header file for auxiliary alias declarations.
typename T::ElementType ElementType_t
Alias declaration for nested ElementType type definitions.
Definition Aliases.h:190
Header file for run time assertion macros.
Constraint on the data type.
Constraint on the data type.
Constraint on the data type.
Header file for the IsFloatingPoint type trait.
Header file for the IsRowMajorMatrix type trait.
Constraint on the data type.
Cast operators for numeric types.
Header file for the CLAPACK heevx wrapper functions.
Base class for dense matrices.
Definition DenseMatrix.h:82
Base class for N-dimensional dense vectors.
Definition DenseVector.h:77
Constraint on the data type.
Constraint on the data type.
Header file for the DenseMatrix base class.
Header file for the DenseVector base class.
#define BLAZE_CONSTRAINT_MUST_BE_BUILTIN_TYPE(T)
Constraint on the data type.
Definition Builtin.h:60
#define BLAZE_CONSTRAINT_MUST_BE_COMPLEX_TYPE(T)
Constraint on the data type.
Definition Complex.h:62
void heevx(char jobz, char range, char uplo, blas_int_t n, complex< float > *A, blas_int_t lda, float vl, float vu, blas_int_t il, blas_int_t iu, float abstol, blas_int_t *m, float *w, complex< float > *Z, blas_int_t ldz, complex< float > *work, blas_int_t lwork, float *rwork, blas_int_t *iwork, blas_int_t *ifail, blas_int_t *info)
LAPACK kernel for computing the eigenvalues of the given dense Hermitian single precision complex col...
Definition heevx.h:167
#define BLAZE_CONSTRAINT_MUST_BE_BLAS_COMPATIBLE_TYPE(T)
Constraint on the data type.
Definition BLASCompatible.h:61
#define BLAZE_CONSTRAINT_MUST_BE_CONTIGUOUS_TYPE(T)
Constraint on the data type.
Definition Contiguous.h:61
#define BLAZE_CONSTRAINT_MUST_NOT_BE_COMPUTATION_TYPE(T)
Constraint on the data type.
Definition Computation.h:81
#define BLAZE_CONSTRAINT_MUST_NOT_BE_ADAPTOR_TYPE(T)
Constraint on the data type.
Definition Adaptor.h:81
#define BLAZE_CONSTRAINT_MUST_HAVE_MUTABLE_DATA_ACCESS(T)
Constraint on the data type.
Definition MutableDataAccess.h:61
typename UnderlyingElement< T >::Type UnderlyingElement_t
Auxiliary alias declaration for the UnderlyingElement type trait.
Definition UnderlyingElement.h:119
constexpr bool IsRowMajorMatrix_v
Auxiliary variable template for the IsRowMajorMatrix type trait.
Definition IsRowMajorMatrix.h:129
int32_t blas_int_t
Signed integer type used in the BLAS/LAPACK wrapper functions.
Definition Types.h:64
#define BLAZE_THROW_LAPACK_ERROR(MESSAGE)
Macro for the emission of an exception on detection of a LAPACK error.
Definition Exception.h:146
void resize(Matrix< MT, SO > &matrix, size_t rows, size_t columns, bool preserve=true)
Changing the size of the matrix.
Definition Matrix.h:1108
bool isSquare(const Matrix< MT, SO > &matrix) noexcept
Checks if the given matrix is a square matrix.
Definition Matrix.h:1383
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition Assert.h:101
constexpr bool IsFloatingPoint_v
Auxiliary variable template for the IsFloatingPoint type trait.
Definition IsFloatingPoint.h:95
To numeric_cast(From from)
Checked conversion of values of numeric type.
Definition NumericCast.h:275
#define BLAZE_THROW_INVALID_ARGUMENT(MESSAGE)
Macro for the emission of a std::invalid_argument exception.
Definition Exception.h:235
Header file for the exception macros of the math module.
Header file for basic type definitions.