26namespace nda::linalg {
60 template <blas_lapack::BlasArray A, blas_lapack::BlasArrayFor<A> B>
64 EXPECTS(a.is_contiguous());
65 EXPECTS(b.is_contiguous());
69 auto constexpr algebra = []() {
76 using layout_pol = std::conditional_t<get_rank<A> == 1,
typename B::layout_policy_t::contiguous_t,
typename A::layout_policy_t::contiguous_t>;
81 auto res = return_t::zeros(
stdutil::join(a.shape(), b.shape()));
82 auto a_vec =
reshape(a, std::array{a.size()});
83 auto b_vec =
reshape(b, std::array{b.size()});
84 auto mat =
reshape(res, std::array{a.size(), b.size()});
Provides definitions and type traits involving the different memory address spaces supported by nda.
Provides utility functions for std::array.
A generic multi-dimensional 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 generic interface to the BLAS/cuBLAS ger, geru and gerc routines.
auto reshape(A &&a, std::array< Int, R > const &new_shape)
Reshape an nda::basic_array or nda::basic_array_view.
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
constexpr int get_rank
Constexpr variable that specifies the rank of an nda::Array or of a contiguous 1-dimensional range.
static constexpr bool has_C_layout
Constexpr variable that is true if all given nda::Array types have nda::C_layout.
static constexpr bool has_F_layout
Constexpr variable that is true if all given nda::Array types have nda::F_layout.
void ger(get_value_t< X > alpha, X const &x, Y const &y, A &&a)
Interface to the BLAS/cuBLAS ger and geru routine.
auto outer_product(A const &a, B const &b)
Outer product of two arrays/views.
heap_basic< mem::mallocator< AdrSp > > heap
Alias template of the nda::heap_basic policy using an nda::mem::mallocator.
constexpr std::array< T, R1+R2 > join(std::array< T, R1 > const &a1, std::array< T, R2 > const &a2)
Make a new std::array by joining two existing std::array objects.
Macros used in the nda library.
Defines various memory handling policies.
Provides type traits for the nda library.