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.is_contiguous());
49 EXPECTS(m.has_positive_strides());
52 int dim = m.extent(0);
58#if defined(__has_feature)
59#if __has_feature(memory_sanitizer)
69 lapack::f77::syev(compz,
'U', dim, m.data(), dim, ev.data(), work.data(), lwork, info);
71 lapack::f77::heev(compz,
'U', dim, m.data(), dim, ev.data(), work.data(), lwork, work2.data(), info);
73 if (info) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::detail::_eigen_element_impl: Diagonalization error";
100 auto ev = detail::_eigen_element_impl(m_copy,
'V');
101 return std::pair<array<double, 1>,
typename M::regular_type>{ev, m_copy};
116 template <
typename M>
119 return detail::_eigen_element_impl(m_copy,
'N');
134 template <
typename M>
136 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.