36namespace nda::linalg {
42 auto _eigen_element_impl(M &&m,
char compz) {
43 using value_type =
typename std::decay_t<M>::value_type;
46 EXPECTS((not m.empty()));
48 EXPECTS(m.indexmap().is_contiguous());
51 int dim = m.extent(0);
57#if defined(__has_feature)
58#if __has_feature(memory_sanitizer)
68 lapack::f77::syev(compz,
'U', dim, m.data(), dim, ev.data(), work.data(), lwork, info);
70 lapack::f77::heev(compz,
'U', dim, m.data(), dim, ev.data(), work.data(), lwork, work2.data(), info);
72 if (info) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::detail::_eigen_element_impl: Diagonalization error";
99 auto ev = detail::_eigen_element_impl(m_copy,
'V');
100 return std::pair<array<double, 1>,
typename M::regular_type>{ev, m_copy};
115 template <
typename M>
118 return detail::_eigen_element_impl(m_copy,
'N');
133 template <
typename M>
135 return detail::_eigen_element_impl(m,
'N');
Provides the generic class for arrays.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
Provides functions to compute the determinant and inverse of a matrix.
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 is_complex_v
Constexpr variable that is true if type T is a std::complex type.
Provides a C++ interface for various LAPACK routines.
Provides definitions of various layout policies.
Macros used in the nda library.
Provides type traits for the nda library.