38namespace nda::blas_lapack {
50 template <MemoryArray A>
55 requires(!std::is_same_v<A, std::remove_cvref_t<A>>)
70 return std::get<0>(std::forward<A>(a).a);
72 return std::forward<A>(a);
77 template <
Array... As>
83 return std::remove_cvref_t<A>::is_stride_order_Fortran();
84 }.template operator()<As>() and ...);
87 template <
Array... As>
93 return std::remove_cvref_t<A>::is_stride_order_C();
94 }.template operator()<As>() and ...);
107 static_assert(!(
conj and not
transpose),
"Error in nda::blas_lapack::get_op: Cannot use conjugate operation alone in BLAS operations");
126 template <MemoryArray A>
146 template <MemoryArray A>
160 template <MemoryArray A>
169 template <MemoryArray A>
183 using ptr_t =
decltype(a.data());
185 auto const batch_size = a.shape()[idx];
186 auto const stride = a.indexmap().strides()[idx];
189 for (
int i = 0;
auto &ptr : ptrs) ptr = a.data() + i++ * stride;
205 template <
typename A>
208 if (a.size() >= min_size) {
209 EXPECTS(a.indexmap().min_stride() == 1);
215 NDA_RUNTIME_ERROR <<
"Error in nda::blas_lapack::resize_or_check_work_buffer: Size mismatch: " << a.size() <<
" < " << min_size;
225 template <
typename A,
int R = -1>
234 template <
typename A,
int R = -1>
243 template <
typename A,
int R = -1>
252 template <
typename A,
int R = -1>
264 template <
typename A,
typename B,
int R = -1>
275 template <
typename A,
typename B,
int R = -1>
286 template <
typename A,
typename B,
int R = -1>
298 template <
typename A,
typename B,
int R = -1>
Provides definitions and type traits involving the different memory address spaces supported by nda.
Check if T is the same as any of the types in Us.
Check if a given type satisfies the array concept.
Check if a given type is an nda::Array of a certain rank.
Check if a given type satisfies the memory array concept.
Check if a given type is an nda::MemoryArray of a certain rank.
BLAS/LAPACK compatible array type with complex value type.
BLAS/LAPACK compatible array type that has the same value type as the reference array type and a comp...
BLAS/LAPACK compatible array type.
BLAS/LAPACK compatible array or conjugate lazy expression type that has the same value type as the re...
BLAS/LAPACK compatible array or conjugate lazy expression type.
BLAS/LAPACK compatible array type that has a compatible floating-point value type and address space w...
BLAS/LAPACK compatible array type with real value type.
BLAS/LAPACK compatible pivot array type that has a compatible address space with the reference 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.
auto transpose(A &&a)
Transpose the memory layout of an nda::MemoryArray or an nda::expr_call.
decltype(auto) conj(A &&a)
Function conj for nda::ArrayOrScalar types (lazy and coefficient-wise for nda::Array types with a com...
basic_array< ValueType, 1, C_layout, 'V', ContainerPolicy > vector
Alias template of an nda::basic_array with rank 1 and a 'V' algebra.
constexpr bool is_regular_v
Constexpr variable that is true if type A is a regular array, i.e. an nda::basic_array.
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.
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.
constexpr bool is_regular_or_view_v
Constexpr variable that is true if type A is either a regular array or a view.
typename remove_complex< get_value_t< A > >::type get_fp_t
Get the floating-point type associated with the value type of an array/view/scalar type.
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...
std::complex< double > dcomplex
Alias for std::complex<double> type.
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 is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
int get_ld(A const &a)
Get the leading dimension of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
auto batch_ptrs(A &&a)
Given a 2- or 3-dimensional array get an array of pointers to each of the submatrices/subvectors inde...
static constexpr bool has_C_layout
Constexpr variable that is true if all given nda::Array types have nda::C_layout.
int get_ncols(A const &a)
Get the number of columns of an nda::MemoryArray with rank 1 or 2 for BLAS/LAPACK calls.
void resize_or_check_work_buffer(A &a, long min_size)
Resize or check the size of a 1D array/view.
vector< get_value_t< A >, heap< mem::get_addr_space< A > > > vector_value_t
Alias for an nda::vector with the same value type and address space as the given type.
vector< get_fp_t< A >, heap< mem::get_addr_space< A > > > vector_fp_t
Alias for an nda::vector with the same address space as the given type and its value type determined ...
static constexpr bool has_F_layout
Constexpr variable that is true if all given nda::Array types have nda::F_layout.
static constexpr bool have_compatible_addr_space
Constexpr variable that is true if all given types have compatible address spaces.
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 ...
Macros used in the nda library.
Provides lazy function calls on arrays/views.
Provides some custom implementations of standard mathematical functions used for lazy,...
Defines various memory handling policies.
Provides type traits for the nda library.