30namespace nda::linalg {
61 template <blas_lapack::BlasArray<2> A>
63 using layout_policy = nda::detail::layout_to_policy<typename std::remove_cvref_t<A>::layout_t>::type;
67 auto const [m, n] = a.shape();
74 if (info != 0) NDA_RUNTIME_ERROR <<
"Error in nda::linalg::svd_in_place: gesvd returned a non-zero value: info = " << info;
76 return std::make_tuple(U, s, VH);
95 auto svd(A
const &a) {
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides the generic class for arrays.
A generic multi-dimensional array.
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.
Provides a generic interface to the LAPACK/cuSOLVER gesvd routine.
basic_array< ValueType, 1, C_layout, 'V', ContainerPolicy > vector
Alias template of an nda::basic_array with rank 1 and a 'V' algebra.
basic_array< ValueType, 2, Layout, 'M', ContainerPolicy > matrix
Alias template of an nda::basic_array with rank 2 and an 'M' algebra.
auto svd(A const &a)
Compute the singular value decomposition (SVD) of a matrix.
auto svd_in_place(A &&a)
Compute the singular value decomposition (SVD) of a matrix in place.
int gesvd(A &&a, S &&s, U &&u, VH &&vh, W1 &&work=vector_value_t< A >{}, W2 &&rwork=vector_fp_t< A >{})
Interface to the LAPACK/cuSOLVER gesvd routine.
static constexpr AddressSpace get_addr_space
Variable template providing the address space for different types.
heap_basic< mem::mallocator< AdrSp > > heap
Alias template of the nda::heap_basic policy using an nda::mem::mallocator.
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 definitions of various layout policies.
Macros used in the nda library.
Defines various memory handling policies.
Provides type traits for the nda library.