20#ifndef BELFEM_LAPACKTOOLS_HPP
21#define BELFEM_LAPACKTOOLS_HPP
37#include <blaze/math/blas/Types.h>
48 template<
typename T >
56 template<
typename T >
59 template<
typename T >
62 template<
typename T >
68 template<
typename T >
71 template<
typename T >
72 struct cplx_type< std::complex< T > > {
typedef std::complex< T >
type ; };
74 template<
typename T >
86#if defined( BELFEM_MKL ) && ! defined( BELFEM_BLAZE )
104#if defined( BELFEM_MKL ) && ! defined( BELFEM_BLAZE )
105 static_assert(
sizeof( std::complex< float > ) ==
sizeof(
cplx_float_t ),
106 "sizes of std::complex< float > and MKL_Complex8 do not match" );
108 static_assert(
sizeof( std::complex< double > ) ==
sizeof(
cplx_double_t ),
109 "sizes of std::complex< double > and MKL_Complex16 do not match" );
111 static_assert(
sizeof( std::complex< float > ) == 2UL *
sizeof(
cplx_float_t ),
112 "std::complex< float > is not layout-compatible with LAPACK" );
114 static_assert(
sizeof( std::complex< double > ) == 2UL *
sizeof(
cplx_double_t ),
115 "std::complex< double > is not layout-compatible with LAPACK" );
122 static_assert(
sizeof(
int_t ) ==
sizeof( blaze::blas_int_t ),
123 "sizes of belfem::int_t and blaze::blas_int_t do not match" );
126#if defined( BELFEM_MKL ) && ( defined( MKL_ILP64 ) != defined( BELFEM_INT64 ) )
127#error "MKL_ILP64 and BELFEM_INT64 must be set together, check USE_MKL_64BIT_API"
131 static_assert(
sizeof(
int_t ) ==
sizeof( MKL_INT ),
132 "sizes of belfem::int_t and MKL_INT do not match" );
141 template<
typename T >
146 "vector length exceeds LAPACK integer range ( %lu )",
147 (
long unsigned int ) A.
length() );
149 return std::max< int_t >( 1, (
int_t ) A.
length() );
163 template<
typename T >
167#ifdef BELFEM_ARMADILLO
169 "matrix row count exceeds LAPACK integer range ( %lu )",
170 (
long unsigned int ) A.
n_rows() );
172 return std::max< int_t >( 1, (
int_t ) A.
n_rows() );
175 "matrix column stride exceeds LAPACK integer range ( %lu )",
180#error "leading_dimension() : no matrix backend selected"
193 return static_cast< int_t >( aValue );
201 return static_cast< int_t >( aValue );
209 return static_cast< int_t >( aValue.real() );
217 return static_cast< int_t >( aValue.real() );
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Dense column-major matrix.
Definition cl_BZ_Matrix.hpp:28
MatrixType & matrix_data()
Definition cl_AR_Matrix.hpp:157
size_t n_rows() const
Definition cl_AR_Matrix.hpp:205
Column vector.
Definition cl_BZ_Vector.hpp:41
size_t length() const
get the length of the vector
Definition cl_AR_Vector.hpp:257
Definition fn_gees.hpp:33
constexpr bool dependent_false
Definition lapacktools.hpp:49
float cplx_float_t
Definition lapacktools.hpp:90
int_t leading_dimension(const Vector< T > &A)
logical length of a vector operand, as passed to LAPACK as LDB; vector storage is contiguous under bo...
Definition lapacktools.hpp:143
int_t work_size(const float &aValue)
lapack reports the optimal work size in the first entry of the work array, which stays real valued fo...
Definition lapacktools.hpp:191
size_t fortran_charlen_t
Definition lapacktools.hpp:100
double cplx_double_t
Definition lapacktools.hpp:91
typename real_type< T >::type real_t
Definition lapacktools.hpp:63
typename cplx_type< T >::type cplx_t
Definition lapacktools.hpp:75
USER GUIDES:
Definition cl_Capacitor.cpp:16
int32_t int_t
Definition typedefs.hpp:51
std::complex< T > type
Definition lapacktools.hpp:72
Definition lapacktools.hpp:69
std::complex< T > type
Definition lapacktools.hpp:69
T type
Definition lapacktools.hpp:60
Definition lapacktools.hpp:57
T type
Definition lapacktools.hpp:57