32namespace nda::linalg {
43 auto eigh_impl(A &&a,
char jobz) {
55 if (info != 0) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::detail::eigh_impl: syev/heev routine failed: info = " << info;
61 template <
typename A,
typename B>
62 auto eigh_impl(A &&a, B &&b,
char jobz,
int itype) {
74 if (info != 0) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::detail::eigh_impl: sygv/hegv routine failed: info = " << info;
102 template <MemoryMatrix A>
105 return detail::eigh_impl(std::forward<A>(a),
'V');
137 template <MemoryMatrix A, MemoryMatrix B>
141 return detail::eigh_impl(std::forward<A>(a), std::forward<B>(b),
'V', itype);
163 using value_t = std::conditional_t<is_complex_v<get_value_t<A>>, std::complex<double>,
double>;
166 return std::make_pair(lambda, a_copy);
189 template <Matrix A, Matrix B>
191 auto eigh(A
const &a, B
const &b,
int itype = 1) {
196 return std::make_pair(lambda, a_copy);
219 template <MemoryMatrix A>
222 return detail::eigh_impl(std::forward<A>(a),
'N');
253 template <MemoryMatrix A, MemoryMatrix B>
257 return detail::eigh_impl(std::forward<A>(a), std::forward<B>(b),
'N', itype);
277 using value_t = std::conditional_t<is_complex_v<get_value_t<A>>, std::complex<double>,
double>;
301 template <Matrix A, Matrix B>
303 auto eigvalsh(A
const &a, B
const &b,
int itype = 1) {
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides the generic class for arrays.
Check if a given type is either an arithmetic or complex type.
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
Provides a custom runtime error class and macros to assert conditions and throw exceptions.
basic_array< ValueType, Rank, Layout, 'A', ContainerPolicy > array
Alias template of an nda::basic_array with an 'A' algebra.
basic_array< ValueType, 2, Layout, 'M', ContainerPolicy > matrix
Alias template of an nda::basic_array with rank 2 and an 'M' algebra.
constexpr bool have_same_value_type_v
Constexpr variable that is true if all types in As have the same value type as A0.
static constexpr bool has_F_layout
Constexpr variable that is true if the given nda::Array type has nda::F_layout.
int sygv(A &&a, B &&b, W &&w, char jobz='V', int itype=1)
Interface to the LAPACK sygv routine.
int heev(A &&a, W &&w, char jobz='V')
Interface to the LAPACK heev routine.
int hegv(A &&a, B &&b, W &&w, char jobz='V', int itype=1)
Interface to the LAPACK hegv routine.
int syev(A &&a, W &&w, char jobz='V')
Interface to the LAPACK syev routine.
static constexpr bool have_host_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Host.
constexpr bool is_complex_v
Constexpr variable that is true if type T is a std::complex type.
constexpr bool is_blas_lapack_v
Alias for nda::is_double_or_complex_v.
Provides a generic interface to the LAPACK heev routine.
Provides a generic interface to the LAPACK hegv routine.
Provides definitions of various layout policies.
Macros used in the nda library.
Provides functions to create and manipulate matrices, i.e. arrays/view with 'M' algebra.
Provides a generic interface to the LAPACK syev routine.
Provides a generic interface to the LAPACK sygv routine.
Provides type traits for the nda library.