32namespace nda::linalg {
43 auto eigh_impl(A &&a,
char jobz) {
57 if (info != 0) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::detail::eigh_impl: syev/heev routine failed: info = " << info;
63 template <
typename A,
typename B>
64 auto eigh_impl(A &&a, B &&b,
char jobz,
int itype) {
78 if (info != 0) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::detail::eigh_impl: sygv/hegv routine failed: info = " << info;
107 template <blas_lapack::BlasArray<2> A>
110 return detail::eigh_impl(std::forward<A>(a),
'V');
144 template <blas_lapack::BlasArray<2> A, blas_lapack::BlasArrayFor<A, 2> B>
147 return detail::eigh_impl(std::forward<A>(a), std::forward<B>(b),
'V', itype);
168 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) {
195 return std::make_pair(lambda, a_copy);
219 template <blas_lapack::BlasArray<2> A>
222 return detail::eigh_impl(std::forward<A>(a),
'N');
255 template <blas_lapack::BlasArray<2> A, blas_lapack::BlasArrayFor<A, 2> B>
258 return detail::eigh_impl(std::forward<A>(a), std::forward<B>(b),
'N', itype);
298 template <Matrix A, Matrix B>
300 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.
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.
typename remove_complex< get_value_t< A > >::type get_fp_t
Get the floating-point type associated with the value type of an array/view/scalar type.
static constexpr bool has_F_layout
Constexpr variable that is true if all given nda::Array types have nda::F_layout.
auto eigh(A const &a)
Compute the eigenvalues and eigenvectors of a real symmetric or complex hermitian matrix.
auto eigh_in_place(A &&a)
Compute the eigenvalues and eigenvectors of a real symmetric or complex hermitian matrix in place.
auto eigvalsh(A const &a)
Compute the eigenvalues of a real symmetric or complex hermitian matrix.
auto eigvalsh_in_place(A &&a)
Compute the eigenvalues of a real symmetric or complex hermitian matrix in place.
int hegv(A &&a, B &&b, W &&w, char jobz='V', int itype=1, W1 &&work=vector_value_t< A >{}, W2 &&rwork=vector_fp_t< A >{})
Interface to the LAPACK hegv routine.
int syev(A &&a, W &&w, char jobz='V', W1 &&work=vector_value_t< A >{})
Interface to the LAPACK syev routine.
int sygv(A &&a, B &&b, W &&w, char jobz='V', int itype=1, W1 &&work=vector_value_t< A >{})
Interface to the LAPACK sygv routine.
int heev(A &&a, W &&w, char jobz='V', W1 &&work=vector_value_t< A >{}, W2 &&rwork=vector_fp_t< A >{})
Interface to the LAPACK heev 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
Constexpr variable that is true if type T is either of type 'float', double, std::complex<float>' or ...
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.
Contiguous layout policy with Fortran-order (column-major order).
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.