63 requires(have_same_value_type_v<A, B>
and mem::have_compatible_addr_space<A, B, IPIV>
and is_blas_lapack_v<get_value_t<A>>)
64 int getrs(A
const &a, B &&b, IPIV
const &ipiv) {
65 static_assert(std::is_same_v<get_value_t<IPIV>,
int>,
"Error in nda::lapack::getrs: Pivoting array must have elements of type int");
66 EXPECTS(ipiv.size() >= std::min(a.extent(0), a.extent(1)));
69 EXPECTS(a.indexmap().min_stride() == 1);
70 EXPECTS(b.indexmap().min_stride() == 1);
71 EXPECTS(ipiv.indexmap().min_stride() == 1);
74 static constexpr bool conj_A = is_conj_array_expr<A>;
75 char op_a = get_op<conj_A, has_C_layout<A>>;
79 if constexpr (mem::have_device_compatible_addr_space<A, B, IPIV>) {
80#if defined(NDA_HAVE_DEVICE)
81 device::getrs(op_a, get_ncols(a), get_ncols(b), a.data(), get_ld(a), ipiv.data(), b.data(), get_ld(b), info);
86 f77::getrs(op_a, get_ncols(a), get_ncols(b), a.data(), get_ld(a), ipiv.data(), b.data(), get_ld(b), info);