35#ifndef _BLAZE_MATH_LAPACK_SYEVX_H_
36#define _BLAZE_MATH_LAPACK_SYEVX_H_
73template<
typename MT,
bool SO,
typename VT,
bool TF >
76template<
typename MT,
bool SO,
typename VT,
bool TF,
typename ST >
79template<
typename MT1,
bool SO1,
typename VT,
bool TF,
typename MT2,
bool SO2 >
83template<
typename MT1,
bool SO1,
typename VT,
bool TF,
typename MT2,
bool SO2,
typename ST >
119 char uplo,
char range, ST vl, ST vu,
123 BLAZE_INTERNAL_ASSERT( range !=
'A' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
124 BLAZE_INTERNAL_ASSERT( range !=
'V' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
125 BLAZE_INTERNAL_ASSERT( range !=
'I' || (*w).size() ==
size_t( iu-il+1 ),
"Invalid vector dimension detected" );
137 const std::unique_ptr<ET[]> work (
new ET[lwork] );
138 const std::unique_ptr<blas_int_t[]> iwork(
new blas_int_t[12*n] );
139 const std::unique_ptr<blas_int_t[]> ifail(
new blas_int_t[n] );
141 syevx(
'N', range, uplo, n, (*A).data(), lda, vl, vu, il, iu, ET(0), &m,
142 (*w).data(),
nullptr, 1, work.get(), lwork, iwork.get(), ifail.get(), &info );
236 const size_t N( (*A).rows() );
242 if( uplo !=
'L' && uplo !=
'U' ) {
252 return syevx_backend( *A, *w, uplo,
'A', ET(), ET(), 0, 0 );
367 if( uplo !=
'L' && uplo !=
'U' ) {
379 const size_t N( (*A).rows() );
398 return syevx_backend( *A, *w, uplo, range, vl, vu, il, iu );
427template<
typename MT1
434inline size_t syevx_backend( DenseMatrix<MT1,SO1>& A, DenseVector<VT,TF>& w,
435 DenseMatrix<MT2,SO2>& Z,
char uplo,
char range,
439 BLAZE_INTERNAL_ASSERT( range !=
'A' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
440 BLAZE_INTERNAL_ASSERT( range !=
'V' || (*w).size() == (*A).rows(),
"Invalid vector dimension detected" );
441 BLAZE_INTERNAL_ASSERT( range !=
'I' || (*w).size() ==
size_t( iu-il+1 ),
"Invalid vector dimension detected" );
447 using ET = ElementType_t<MT1>;
458 const std::unique_ptr<ET[]> work (
new ET[lwork] );
459 const std::unique_ptr<blas_int_t[]> iwork(
new blas_int_t[12*n] );
460 const std::unique_ptr<blas_int_t[]> ifail(
new blas_int_t[n] );
462 syevx(
'N', range, uplo, n, (*A).data(), lda, vl, vu, il, iu, ET(0), &m,
463 (*w).data(), (*Z).data(), ldz, work.get(), lwork, iwork.get(), ifail.get(), &info );
543template<
typename MT1
574 const size_t N( (*A).rows() );
580 if( uplo !=
'L' && uplo !=
'U' ) {
585 resize( *Z, N, N,
false );
591 return syevx_backend( *A, *w, *Z, uplo,
'A', ET(), ET(), 0, 0 );
692template<
typename MT1
726 if( uplo !=
'L' && uplo !=
'U' ) {
738 const size_t N( (*A).rows() );
759 return syevx_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 syevx 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.
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
void syevx(char jobz, char range, char uplo, blas_int_t n, 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, float *Z, blas_int_t ldz, float *work, blas_int_t lwork, blas_int_t *iwork, blas_int_t *ifail, blas_int_t *info)
LAPACK kernel for computing the eigenvalues of the given dense symmetric single precision column-majo...
Definition syevx.h:166
#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
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.