61 requires(mem::on_host<A>
and std::is_same_v<std::complex<
double>, get_value_t<A>>
and have_same_value_type_v<A, TAU>
64 static_assert(has_F_layout<A>,
"Error in nda::lapack::ungqr: C order is not supported");
65 static_assert(mem::have_host_compatible_addr_space<A, TAU>,
"Error in nda::lapack::ungqr: Only CPU is supported");
68 EXPECTS(a.indexmap().min_stride() == 1);
69 EXPECTS(tau.indexmap().min_stride() == 1);
72 using value_type = get_value_t<A>;
73 value_type bufferSize_T{};
74 auto [m, n] = a.shape();
77 lapack::f77::ungqr(m, std::min(m, n), k, a.data(), get_ld(a), tau.data(), &bufferSize_T, -1, info);
78 int bufferSize =
static_cast<
int>(std::ceil(std::real(bufferSize_T)));
81 nda::array<value_type, 1,
C_layout, heap<mem::get_addr_space<A>>> work(bufferSize);
82 lapack::f77::ungqr(m, std::min(m, n), k, a.data(), get_ld(a), tau.data(), work.data(), bufferSize, info);