25namespace nda::lapack {
46 template <MemoryMatrix A, MemoryVector IPIV>
48 int getri(A &&a, IPIV
const &ipiv) {
50 auto const [m, n] = a.shape();
52 EXPECTS(ipiv.size() == n);
55 EXPECTS(a.indexmap().min_stride() == 1);
56 EXPECTS(ipiv.indexmap().min_stride() == 1);
61 value_type tmp_lwork{};
62 f77::getri(n, a.data(),
get_ld(a), ipiv.data(), &tmp_lwork, -1, info);
63 int lwork =
static_cast<int>(std::ceil(std::real(tmp_lwork)));
67#if defined(__has_feature)
68#if __has_feature(memory_sanitizer)
72 f77::getri(n, a.data(),
get_ld(a), ipiv.data(), work.
data(), lwork, info);
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides the generic class for arrays.
ValueType const * data() const noexcept
Get a pointer to the actual data (in general this is not the beginning of the memory block for a view...
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
basic_array< ValueType, Rank, Layout, 'A', ContainerPolicy > array
Alias template of an nda::basic_array with an 'A' algebra.
std::decay_t< decltype(get_first_element(std::declval< A const >()))> get_value_t
Get the value type of an array/view or a scalar type.
int getri(A &&a, IPIV const &ipiv)
Interface to the LAPACK getri 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_blas_lapack_v
Alias for nda::is_double_or_complex_v.
Provides a C++ interface for various LAPACK routines.
int get_ld(A const &a)
Get the leading dimension of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
Macros used in the nda library.
Provides type traits for the nda library.