20#ifndef NDA_HAVE_DEVICE
26namespace nda::lapack {
50 template <Matrix A, MemoryArray B, MemoryVector IPIV>
53 int getrs(A
const &a, B &&b, IPIV
const &ipiv) {
54 static_assert(std::is_same_v<get_value_t<IPIV>,
int>,
"Error in nda::lapack::getrs: Pivoting array must have elements of type int");
55 static_assert(
get_rank<B> == 1 ||
get_rank<B> == 2,
"Error in nda::lapack::getrs: Right hand side must have rank 1 or 2");
56 static_assert(
has_F_layout<B>,
"Error in nda::lapack::getrs: B must have Fortran layout");
62 EXPECTS(a_mat.shape()[0] == a_mat.shape()[1]);
63 EXPECTS(b.extent(0) == a_mat.shape()[0]);
64 EXPECTS(ipiv.size() == a_mat.shape()[0]);
67 EXPECTS(a_mat.indexmap().min_stride() == 1);
68 EXPECTS(b.indexmap().min_stride() == 1);
69 EXPECTS(ipiv.indexmap().min_stride() == 1);
74#if defined(NDA_HAVE_DEVICE)
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides concepts for the nda library.
Provides various convenient aliases and helper functions for nda::basic_array and nda::basic_array_vi...
Provides GPU and non-GPU specific functionality.
constexpr bool have_same_value_type_v
Constexpr variable that is true if all types in As have the same value type as A0.
constexpr int get_rank
Constexpr variable that specifies the rank of an nda::Array or of a contiguous 1-dimensional range.
int getrs(A const &a, B &&b, IPIV const &ipiv)
Interface to the LAPACK getrs routine.
static constexpr bool have_compatible_addr_space
Constexpr variable that is true if all given types have compatible address spaces.
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
constexpr bool is_blas_lapack_v
Alias for nda::is_double_or_complex_v.
Provides a C++ interface for various LAPACK routines.
int get_ncols(A const &a)
Get the number of columns of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
int get_ld(A const &a)
Get the leading dimension of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
static constexpr bool is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
static constexpr char get_op
Variable template that determines the BLAS matrix operation tag ('N','T','C') based on the given bool...
static constexpr bool has_F_layout
Constexpr variable that is true if the given nda::Array type has nda::F_layout.
MemoryArray decltype(auto) get_array(A &&a)
Get the underlying array of a conjugate lazy expression or return the array itself in case it is an n...
Macros used in the nda library.
Provides type traits for the nda library.