From fd679da681642029d5c2431bd12fc7e30962963b Mon Sep 17 00:00:00 2001 From: Wentzell Date: Thu, 26 Sep 2024 15:26:27 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20github.io=20from=20@=20TRIQS/n?= =?UTF-8?q?da@02ada43fbfcdff1e0d27a238c140f97f1506eb5e=20=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/unstable/accessors_8hpp_source.html | 3 +- docs/unstable/address__space_8hpp_source.html | 37 +- docs/unstable/algorithms_8hpp.html | 21 + docs/unstable/algorithms_8hpp.js | 4 + docs/unstable/algorithms_8hpp_source.html | 468 ++++++++------ docs/unstable/allocators_8hpp_source.html | 35 +- docs/unstable/arithmetic_8hpp_source.html | 7 +- docs/unstable/array_8hpp.html | 8 +- docs/unstable/array_8hpp.js | 2 +- docs/unstable/array_8hpp_source.html | 612 +++++++++--------- docs/unstable/array__adapter_8hpp_source.html | 3 +- docs/unstable/auto__assign_8hpp_source.html | 3 +- .../auto__assign__subscript_8hpp_source.html | 3 +- docs/unstable/basic__array_8hpp_source.html | 19 +- .../basic__array__view_8hpp_source.html | 15 +- .../basic__functions_8hpp_source.html | 9 +- docs/unstable/blas_2dot_8hpp_source.html | 3 +- ...interface_2cxx__interface_8cpp_source.html | 3 +- ...interface_2cxx__interface_8hpp_source.html | 3 +- .../bound__check__worker_8hpp_source.html | 5 +- docs/unstable/broadcast_8hpp_source.html | 3 +- docs/unstable/cblas__f77_8h_source.html | 1 + ...blas__mangling__with__flags_8h_source.html | 1 + docs/unstable/clef_2clef_8hpp_source.html | 1 + docs/unstable/clef_8hpp_source.html | 33 +- docs/unstable/concepts_8hpp_source.html | 17 +- docs/unstable/cross__product_8hpp_source.html | 3 +- .../cublas__interface_8cpp_source.html | 3 +- .../cublas__interface_8hpp_source.html | 3 +- .../cusolver__interface_8cpp_source.html | 3 +- .../cusolver__interface_8hpp_source.html | 3 +- docs/unstable/declarations_8hpp_source.html | 21 +- .../det__and__inverse_8hpp_source.html | 5 +- docs/unstable/device_8hpp_source.html | 41 +- docs/unstable/doxygen_crawl.html | 12 +- docs/unstable/eigenelements_8hpp_source.html | 3 +- docs/unstable/eval_8hpp_source.html | 3 +- docs/unstable/exceptions_8hpp_source.html | 3 +- docs/unstable/expression_8hpp_source.html | 3 +- docs/unstable/for__each_8hpp_source.html | 39 +- docs/unstable/function_8hpp_source.html | 3 +- docs/unstable/gather_8hpp_source.html | 5 +- docs/unstable/gelss_8hpp_source.html | 3 +- docs/unstable/gelss__worker_8hpp_source.html | 3 +- docs/unstable/gemm_8hpp_source.html | 3 +- docs/unstable/gemm__batch_8hpp_source.html | 9 +- docs/unstable/gemv_8hpp_source.html | 3 +- docs/unstable/geqp3_8hpp_source.html | 5 +- docs/unstable/ger_8hpp_source.html | 3 +- docs/unstable/gesvd_8hpp_source.html | 5 +- docs/unstable/getrf_8hpp_source.html | 3 +- docs/unstable/getri_8hpp_source.html | 3 +- docs/unstable/getrs_8hpp_source.html | 3 +- docs/unstable/group__av__algs.html | 242 ++++++- docs/unstable/group__av__math.html | 2 +- docs/unstable/group__indices_8hpp_source.html | 35 +- docs/unstable/group__utils__std.html | 53 +- docs/unstable/gtest__tools_8hpp_source.html | 7 +- docs/unstable/gtsv_8hpp_source.html | 3 +- docs/unstable/h5_8hpp_source.html | 21 +- docs/unstable/handle_8hpp_source.html | 37 +- docs/unstable/idx__map_8hpp_source.html | 3 +- docs/unstable/index.html | 6 +- docs/unstable/io_8hpp_source.html | 35 +- docs/unstable/iterators_8hpp_source.html | 35 +- ...interface_2cxx__interface_8cpp_source.html | 3 +- ...interface_2cxx__interface_8hpp_source.html | 5 +- docs/unstable/lapack_8h_source.html | 1 + docs/unstable/lapacke__config_8h_source.html | 1 + .../unstable/lapacke__mangling_8h_source.html | 1 + .../layout_2policies_8hpp_source.html | 35 +- .../layout__transforms_8hpp_source.html | 39 +- docs/unstable/linalg_2dot_8hpp_source.html | 7 +- docs/unstable/literals_8hpp_source.html | 35 +- docs/unstable/macros_8hpp_source.html | 1 + docs/unstable/make__lazy_8hpp_source.html | 3 +- docs/unstable/malloc_8hpp_source.html | 39 +- docs/unstable/map_8hpp_source.html | 3 +- .../mapped__functions_8hpp_source.html | 11 +- .../mapped__functions_8hxx_source.html | 39 +- docs/unstable/math_8hpp_source.html | 35 +- docs/unstable/matmul_8hpp_source.html | 5 +- .../matrix__functions_8hpp_source.html | 7 +- docs/unstable/mem_2policies_8hpp_source.html | 39 +- docs/unstable/memcpy_8hpp_source.html | 41 +- docs/unstable/memset_8hpp_source.html | 39 +- docs/unstable/norm_8hpp_source.html | 5 +- docs/unstable/operation_8hpp_source.html | 3 +- docs/unstable/orgqr_8hpp_source.html | 5 +- docs/unstable/permutation_8hpp_source.html | 5 +- docs/unstable/placeholder_8hpp_source.html | 3 +- docs/unstable/print_8hpp_source.html | 3 +- docs/unstable/range_8hpp_source.html | 3 +- docs/unstable/reduce_8hpp_source.html | 7 +- docs/unstable/scal_8hpp_source.html | 3 +- docs/unstable/scatter_8hpp_source.html | 3 +- docs/unstable/search/all_13.js | 2 +- docs/unstable/search/all_c.js | 63 +- docs/unstable/search/functions_7.js | 23 +- docs/unstable/search/functions_d.js | 2 +- docs/unstable/slice__static_8hpp_source.html | 37 +- .../stdutil_2concepts_8hpp_source.html | 1 + docs/unstable/sum_8hpp_source.html | 35 +- docs/unstable/sym__grp_8hpp_source.html | 3 +- docs/unstable/tools_8hpp_source.html | 5 +- docs/unstable/traits_8hpp_source.html | 3 +- docs/unstable/ungqr_8hpp_source.html | 5 +- docs/unstable/utils_8hpp_source.html | 3 +- docs/unstable/vector_8hpp_source.html | 35 +- 109 files changed, 1537 insertions(+), 1103 deletions(-) diff --git a/docs/unstable/accessors_8hpp_source.html b/docs/unstable/accessors_8hpp_source.html index 83bb4aed3..10c8d52b6 100644 --- a/docs/unstable/accessors_8hpp_source.html +++ b/docs/unstable/accessors_8hpp_source.html @@ -138,7 +138,7 @@
25
26#include <cstddef>
27
-
28namespace nda {
+
28namespace nda {
29
30 /**
31 * @addtogroup av_utils
@@ -309,6 +309,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
layout_prop_e
Compile-time guarantees of the memory layout of an array/view.
Definition traits.hpp:222
static constexpr do_not_initialize_t do_not_initialize
Instance of nda::mem::do_not_initialize_t.
Definition handle.hpp:69
static constexpr init_zero_t init_zero
Instance of nda::mem::init_zero_t.
Definition handle.hpp:75
diff --git a/docs/unstable/address__space_8hpp_source.html b/docs/unstable/address__space_8hpp_source.html index c6364b314..7f4ec1750 100644 --- a/docs/unstable/address__space_8hpp_source.html +++ b/docs/unstable/address__space_8hpp_source.html @@ -140,7 +140,7 @@
27
28#include <algorithm>
29
-
30namespace nda {
+
30namespace nda {
31
32 /// @cond
33 // Forward declarations
@@ -154,7 +154,7 @@
41
42} // namespace nda
43
-
44namespace nda::mem {
+
44namespace nda::mem {
45
46 /**
47 * @addtogroup mem_addrspcs
@@ -493,6 +493,7 @@
idx_map(std::array< long, R > const &)
Construct a new map with a shape of a different rank.
Definition idx_map.hpp:435
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -583,25 +584,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/algorithms_8hpp.html b/docs/unstable/algorithms_8hpp.html index ef122e7a5..4ea2877cb 100644 --- a/docs/unstable/algorithms_8hpp.html +++ b/docs/unstable/algorithms_8hpp.html @@ -115,13 +115,18 @@
#include "./concepts.hpp"
#include "./layout/for_each.hpp"
+#include "./layout/range.hpp"
+#include "./macros.hpp"
+#include "./map.hpp"
#include "./traits.hpp"
#include <algorithm>
+#include <array>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <type_traits>
#include <utility>
+#include <vector>

Detailed Description

Provides various algorithms to be used with nda::Array objects.

@@ -152,6 +157,22 @@ double nda::frobenius_norm (A const &a)  Calculate the Frobenius norm of a 2-dimensional array.
  +template<Array A, Array B>
+requires (nda::get_rank<A> == nda::get_rank<B>) +constexpr auto nda::hadamard (A &&a, B &&b) + Hadamard product of two nda::Array objects.
+  +constexpr auto nda::hadamard (nda::Scalar auto a, nda::Scalar auto b) + Hadamard product of two arithmetic types.
+  +template<typename T , typename U , size_t R> +constexpr auto nda::hadamard (std::array< T, R > const &a, std::array< U, R > const &b) + Hadamard product of two std::array objects.
+  +template<typename T , typename U > +constexpr auto nda::hadamard (std::vector< T > const &a, std::vector< U > const &b) + Hadamard product of two std::vector objects.
+  template<Array A> auto nda::max_element (A const &a)  Find the maximum element of an array.
diff --git a/docs/unstable/algorithms_8hpp.js b/docs/unstable/algorithms_8hpp.js index 6b3c74e0a..ead66ccab 100644 --- a/docs/unstable/algorithms_8hpp.js +++ b/docs/unstable/algorithms_8hpp.js @@ -5,6 +5,10 @@ var algorithms_8hpp = [ "fold", "algorithms_8hpp.html#ga66519bf80315973770c266a4d10eb054", null ], [ "fold", "algorithms_8hpp.html#ga1ede47af1aafba0c08346ce98c767b7e", null ], [ "frobenius_norm", "algorithms_8hpp.html#gab90a57511cc6f90cad3207acd73be60b", null ], + [ "hadamard", "algorithms_8hpp.html#ga9ee51842bd47f09b28d6d36cdf289b62", null ], + [ "hadamard", "algorithms_8hpp.html#gac201e48555bdb773ad45706882e787b5", null ], + [ "hadamard", "algorithms_8hpp.html#gad8886854a020e7b28b63a96d6087485d", null ], + [ "hadamard", "algorithms_8hpp.html#ga3aec2e627c396aaeb87141efa7a49bc4", null ], [ "max_element", "algorithms_8hpp.html#ga0d54b733a7c15c15846de86a79d53025", null ], [ "min_element", "algorithms_8hpp.html#ga8dcf3b8eb2cf5460c47e825b4ec38534", null ], [ "product", "algorithms_8hpp.html#ga20fe5de812c1b0b5fa6964e50649c2fa", null ], diff --git a/docs/unstable/algorithms_8hpp_source.html b/docs/unstable/algorithms_8hpp_source.html index 04973ff10..eba35a202 100644 --- a/docs/unstable/algorithms_8hpp_source.html +++ b/docs/unstable/algorithms_8hpp_source.html @@ -136,212 +136,288 @@
23
24#include "./concepts.hpp"
25#include "./layout/for_each.hpp"
-
26#include "./traits.hpp"
-
27
-
28#include <algorithm>
-
29#include <cmath>
-
30#include <cstdlib>
-
31#include <functional>
-
32#include <type_traits>
-
33#include <utility>
-
34
-
35namespace nda {
-
36
-
37 /**
-
38 * @addtogroup av_algs
-
39 * @{
-
40 */
+
26#include "./layout/range.hpp"
+
27#include "./macros.hpp"
+
28#include "./map.hpp"
+
29#include "./traits.hpp"
+
30
+
31#include <algorithm>
+
32#include <array>
+
33#include <cmath>
+
34#include <cstdlib>
+
35#include <functional>
+
36#include <type_traits>
+
37#include <utility>
+
38#include <vector>
+
39
+
40namespace nda {
41
-
42 // FIXME : CHECK ORDER of the LOOP !
-
43 /**
-
44 * @brief Perform a fold operation on the given nda::Array object.
-
45 *
-
46 * @details It calculates the following (where r is an initial value);
-
47 *
-
48 * @code{.cpp}
-
49 * auto res = f(...f(f(f(r, a(0,...,0)), a(0,...,1)), a(0,...,2)), ...);
-
50 * @endcode
-
51 *
-
52 * @note The array is always traversed in C-order.
-
53 *
-
54 * @tparam A nda::Array type.
-
55 * @tparam F Callable type.
-
56 * @tparam R Type of the initial value.
-
57 * @param f Callable object taking two arguments compatible with the initial value and the array value type.
-
58 * @param a nda::Array object.
-
59 * @param r Initial value.
-
60 * @return Result of the fold operation.
-
61 */
-
62 template <Array A, typename F, typename R>
-
-
63 auto fold(F f, A const &a, R r) {
-
64 // cast the initial value to the return type of f to avoid narrowing
-
65 decltype(f(r, get_value_t<A>{})) r2 = r;
-
66 nda::for_each(a.shape(), [&a, &r2, &f](auto &&...args) { r2 = f(r2, a(args...)); });
-
67 return r2;
-
68 }
+
42 /**
+
43 * @addtogroup av_algs
+
44 * @{
+
45 */
+
46
+
47 // FIXME : CHECK ORDER of the LOOP !
+
48 /**
+
49 * @brief Perform a fold operation on the given nda::Array object.
+
50 *
+
51 * @details It calculates the following (where r is an initial value);
+
52 *
+
53 * @code{.cpp}
+
54 * auto res = f(...f(f(f(r, a(0,...,0)), a(0,...,1)), a(0,...,2)), ...);
+
55 * @endcode
+
56 *
+
57 * @note The array is always traversed in C-order.
+
58 *
+
59 * @tparam A nda::Array type.
+
60 * @tparam F Callable type.
+
61 * @tparam R Type of the initial value.
+
62 * @param f Callable object taking two arguments compatible with the initial value and the array value type.
+
63 * @param a nda::Array object.
+
64 * @param r Initial value.
+
65 * @return Result of the fold operation.
+
66 */
+
67 template <Array A, typename F, typename R>
+
+
68 auto fold(F f, A const &a, R r) {
+
69 // cast the initial value to the return type of f to avoid narrowing
+
70 decltype(f(r, get_value_t<A>{})) r2 = r;
+
71 nda::for_each(a.shape(), [&a, &r2, &f](auto &&...args) { r2 = f(r2, a(args...)); });
+
72 return r2;
+
73 }
-
69
-
70 /// The same as nda::fold, except that the initial value is a default constructed value type of the array.
-
71 template <Array A, typename F>
-
-
72 auto fold(F f, A const &a) {
-
73 return fold(std::move(f), a, get_value_t<A>{});
-
74 }
+
74
+
75 /// The same as nda::fold, except that the initial value is a default constructed value type of the array.
+
76 template <Array A, typename F>
+
+
77 auto fold(F f, A const &a) {
+
78 return fold(std::move(f), a, get_value_t<A>{});
+
79 }
-
75
-
76 /**
-
77 * @brief Does any of the elements of the array evaluate to true?
-
78 *
-
79 * @details The given nda::Array object can also be some lazy expression that evaluates to a boolean. For example:
-
80 *
-
81 * @code{.cpp}
-
82 * auto A = nda::array<double, 2>::rand(2, 3);
-
83 * auto greater05 = nda::map([](auto x) { return x > 0.5; })(A);
-
84 * auto res = nda::any(greater05);
-
85 * @endcode
-
86 *
-
87 * @tparam A nda::Array type.
-
88 * @param a nda::Array object.
-
89 * @return True if at least one element of the array evaluates to true, false otherwise.
-
90 */
-
91 template <Array A>
-
-
92 bool any(A const &a) {
-
93 static_assert(std::is_same_v<get_value_t<A>, bool>, "Error in nda::any: Value type of the array must be bool");
-
94 return fold([](bool r, auto const &x) -> bool { return r or bool(x); }, a, false);
-
95 }
+
80
+
81 /**
+
82 * @brief Does any of the elements of the array evaluate to true?
+
83 *
+
84 * @details The given nda::Array object can also be some lazy expression that evaluates to a boolean. For example:
+
85 *
+
86 * @code{.cpp}
+
87 * auto A = nda::array<double, 2>::rand(2, 3);
+
88 * auto greater05 = nda::map([](auto x) { return x > 0.5; })(A);
+
89 * auto res = nda::any(greater05);
+
90 * @endcode
+
91 *
+
92 * @tparam A nda::Array type.
+
93 * @param a nda::Array object.
+
94 * @return True if at least one element of the array evaluates to true, false otherwise.
+
95 */
+
96 template <Array A>
+
+
97 bool any(A const &a) {
+
98 static_assert(std::is_same_v<get_value_t<A>, bool>, "Error in nda::any: Value type of the array must be bool");
+
99 return fold([](bool r, auto const &x) -> bool { return r or bool(x); }, a, false);
+
100 }
-
96
-
97 /**
-
98 * @brief Do all elements of the array evaluate to true?
-
99 *
-
100 * @details The given nda::Array object can also be some lazy expression that evaluates to a boolean. For example:
-
101 *
-
102 * @code{.cpp}
-
103 * auto A = nda::array<double, 2>::rand(2, 3);
-
104 * auto greater0 = nda::map([](auto x) { return x > 0.0; })(A);
-
105 * auto res = nda::all(greater0);
-
106 * @endcode
-
107 *
-
108 * @tparam A nda::Array type.
-
109 * @param a nda::Array object.
-
110 * @return True if all elements of the array evaluate to true, false otherwise.
-
111 */
-
112 template <Array A>
-
-
113 bool all(A const &a) {
-
114 static_assert(std::is_same_v<get_value_t<A>, bool>, "Error in nda::all: Value type of the array must be bool");
-
115 return fold([](bool r, auto const &x) -> bool { return r and bool(x); }, a, true);
-
116 }
+
101
+
102 /**
+
103 * @brief Do all elements of the array evaluate to true?
+
104 *
+
105 * @details The given nda::Array object can also be some lazy expression that evaluates to a boolean. For example:
+
106 *
+
107 * @code{.cpp}
+
108 * auto A = nda::array<double, 2>::rand(2, 3);
+
109 * auto greater0 = nda::map([](auto x) { return x > 0.0; })(A);
+
110 * auto res = nda::all(greater0);
+
111 * @endcode
+
112 *
+
113 * @tparam A nda::Array type.
+
114 * @param a nda::Array object.
+
115 * @return True if all elements of the array evaluate to true, false otherwise.
+
116 */
+
117 template <Array A>
+
+
118 bool all(A const &a) {
+
119 static_assert(std::is_same_v<get_value_t<A>, bool>, "Error in nda::all: Value type of the array must be bool");
+
120 return fold([](bool r, auto const &x) -> bool { return r and bool(x); }, a, true);
+
121 }
-
117
-
118 /**
-
119 * @brief Find the maximum element of an array.
-
120 *
-
121 * @details It uses nda::fold and `std::max`.
-
122 *
-
123 * @tparam A nda::Array type.
-
124 * @param a nda::Array object.
-
125 * @return Maximum element of the array.
-
126 */
-
127 template <Array A>
-
-
128 auto max_element(A const &a) {
-
129 return fold(
-
130 [](auto const &x, auto const &y) {
-
131 using std::max;
-
132 return max(x, y);
-
133 },
-
134 a, get_first_element(a));
-
135 }
+
122
+
123 /**
+
124 * @brief Find the maximum element of an array.
+
125 *
+
126 * @details It uses nda::fold and `std::max`.
+
127 *
+
128 * @tparam A nda::Array type.
+
129 * @param a nda::Array object.
+
130 * @return Maximum element of the array.
+
131 */
+
132 template <Array A>
+
+
133 auto max_element(A const &a) {
+
134 return fold(
+
135 [](auto const &x, auto const &y) {
+
136 using std::max;
+
137 return max(x, y);
+
138 },
+
139 a, get_first_element(a));
+
140 }
-
136
-
137 /**
-
138 * @brief Find the minimum element of an array.
-
139 *
-
140 * @details It uses nda::fold and `std::min`.
-
141 *
-
142 * @tparam A nda::Array type.
-
143 * @param a nda::Array object.
-
144 * @return Minimum element of the array.
-
145 */
-
146 template <Array A>
-
-
147 auto min_element(A const &a) {
-
148 return fold(
-
149 [](auto const &x, auto const &y) {
-
150 using std::min;
-
151 return min(x, y);
-
152 },
-
153 a, get_first_element(a));
-
154 }
+
141
+
142 /**
+
143 * @brief Find the minimum element of an array.
+
144 *
+
145 * @details It uses nda::fold and `std::min`.
+
146 *
+
147 * @tparam A nda::Array type.
+
148 * @param a nda::Array object.
+
149 * @return Minimum element of the array.
+
150 */
+
151 template <Array A>
+
+
152 auto min_element(A const &a) {
+
153 return fold(
+
154 [](auto const &x, auto const &y) {
+
155 using std::min;
+
156 return min(x, y);
+
157 },
+
158 a, get_first_element(a));
+
159 }
-
155
-
156 /**
-
157 * @ingroup av_math
-
158 * @brief Calculate the Frobenius norm of a 2-dimensional array.
-
159 *
-
160 * @tparam A nda::ArrayOfRank<2> type.
-
161 * @param a Array object.
-
162 * @return Frobenius norm of the array/matrix.
-
163 */
-
164 template <ArrayOfRank<2> A>
-
-
165 double frobenius_norm(A const &a) {
-
166 return std::sqrt(fold(
-
167 [](double r, auto const &x) -> double {
-
168 auto ab = std::abs(x);
-
169 return r + ab * ab;
-
170 },
-
171 a, double(0)));
-
172 }
+
160
+
161 /**
+
162 * @ingroup av_math
+
163 * @brief Calculate the Frobenius norm of a 2-dimensional array.
+
164 *
+
165 * @tparam A nda::ArrayOfRank<2> type.
+
166 * @param a Array object.
+
167 * @return Frobenius norm of the array/matrix.
+
168 */
+
169 template <ArrayOfRank<2> A>
+
+
170 double frobenius_norm(A const &a) {
+
171 return std::sqrt(fold(
+
172 [](double r, auto const &x) -> double {
+
173 auto ab = std::abs(x);
+
174 return r + ab * ab;
+
175 },
+
176 a, double(0)));
+
177 }
-
173
-
174 /**
-
175 * @brief Sum all the elements of an nda::Array object.
-
176 *
-
177 * @tparam A nda::Array type.
-
178 * @param a nda::Array object.
-
179 * @return Sum of all elements.
-
180 */
-
181 template <Array A>
-
-
182 auto sum(A const &a)
-
183 requires(nda::is_scalar_v<get_value_t<A>>)
-
184 {
-
185 return fold(std::plus<>{}, a);
-
186 }
+
178
+
179 /**
+
180 * @brief Sum all the elements of an nda::Array object.
+
181 *
+
182 * @tparam A nda::Array type.
+
183 * @param a nda::Array object.
+
184 * @return Sum of all elements.
+
185 */
+
186 template <Array A>
+
+
187 auto sum(A const &a)
+
188 requires(nda::is_scalar_v<get_value_t<A>>)
+
189 {
+
190 return fold(std::plus<>{}, a);
+
191 }
-
187
-
188 /**
-
189 * @brief Multiply all the elements of an nda::Array object.
-
190 *
-
191 * @tparam A nda::Array type.
-
192 * @param a nda::Array object.
-
193 * @return Product of all elements.
-
194 */
-
195 template <Array A>
-
-
196 auto product(A const &a)
-
197 requires(nda::is_scalar_v<get_value_t<A>>)
-
198 {
-
199 return fold(std::multiplies<>{}, a, get_value_t<A>{1});
-
200 }
+
192
+
193 /**
+
194 * @brief Multiply all the elements of an nda::Array object.
+
195 *
+
196 * @tparam A nda::Array type.
+
197 * @param a nda::Array object.
+
198 * @return Product of all elements.
+
199 */
+
200 template <Array A>
+
+
201 auto product(A const &a)
+
202 requires(nda::is_scalar_v<get_value_t<A>>)
+
203 {
+
204 return fold(std::multiplies<>{}, a, get_value_t<A>{1});
+
205 }
-
201
-
202 /** @} */
-
203
-
204} // namespace nda
-
auto max_element(A const &a)
Find the maximum element of an array.
-
auto fold(F f, A const &a, R r)
Perform a fold operation on the given nda::Array object.
-
auto product(A const &a)
Multiply all the elements of an nda::Array object.
-
auto fold(F f, A const &a)
The same as nda::fold, except that the initial value is a default constructed value type of the array...
-
bool any(A const &a)
Does any of the elements of the array evaluate to true?
-
auto min_element(A const &a)
Find the minimum element of an array.
-
auto sum(A const &a)
Sum all the elements of an nda::Array object.
-
bool all(A const &a)
Do all elements of the array evaluate to true?
-
double frobenius_norm(A const &a)
Calculate the Frobenius norm of a 2-dimensional array.
+
206
+
207 /**
+
208 * @brief Hadamard product of two nda::Array objects.
+
209 *
+
210 * @tparam A nda::Array type.
+
211 * @tparam B nda::Array type.
+
212 * @param a nda::Array object.
+
213 * @param b nda::Array object.
+
214 * @return A lazy nda::expr_call object representing the elementwise product of the two input objects.
+
215 */
+
216 template <Array A, Array B>
+
217 requires(nda::get_rank<A> == nda::get_rank<B>)
+
+
218 [[nodiscard]] constexpr auto hadamard(A &&a, B &&b) {
+
219 return nda::map([](auto const &x, auto const &y) { return x * y; })(std::forward<A>(a), std::forward<B>(b));
+
220 }
+
+
221
+
222 /**
+
223 * @brief Hadamard product of two std::array objects.
+
224 *
+
225 * @tparam T Value type of the first array.
+
226 * @tparam U Value type of the second array.
+
227 * @tparam R Size of the arrays.
+
228 * @param a std::array object.
+
229 * @param b std::array object.
+
230 * @return std::array containing the elementwise product of the two input arrays.
+
231 */
+
232 template <typename T, typename U, size_t R>
+
+
233 [[nodiscard]] constexpr auto hadamard(std::array<T, R> const &a, std::array<U, R> const &b) {
+
234 return a * b;
+
235 }
+
+
236
+
237 /**
+
238 * @brief Hadamard product of two std::vector objects.
+
239 *
+
240 * @tparam T Value type of the first input vector.
+
241 * @tparam U Value type of the second input vector.
+
242 * @param a std::vector object.
+
243 * @param b std::vector object.
+
244 * @return std::vector containing the elementwise product of the two input vectors.
+
245 */
+
246 template <typename T, typename U>
+
+
247 [[nodiscard]] constexpr auto hadamard(std::vector<T> const &a, std::vector<U> const &b) {
+
248 using TU = decltype(std::declval<T>() * std::declval<U>());
+
249 EXPECTS(a.size() == b.size());
+
250
+
251 std::vector<TU> c(a.size());
+
252 for (auto i : range(c.size())) c[i] = a[i] * b[i];
+
253 return c;
+
254 }
+
+
255
+
256 /**
+
257 * @brief Hadamard product of two arithmetic types.
+
258 *
+
259 * @tparam T nda::Scalar type of the first input.
+
260 * @tparam U nda::Scalar type of the second input.
+
261 * @param a First input.
+
262 * @param b Second input.
+
263 * @return Product of the two inputs.
+
264 */
+
265 constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b) { return a * b; }
+
266
+
267 /** @} */
+
268
+
269} // namespace nda
+
auto max_element(A const &a)
Find the maximum element of an array.
+
auto fold(F f, A const &a, R r)
Perform a fold operation on the given nda::Array object.
+
auto product(A const &a)
Multiply all the elements of an nda::Array object.
+
constexpr auto hadamard(std::vector< T > const &a, std::vector< U > const &b)
Hadamard product of two std::vector objects.
+
auto fold(F f, A const &a)
The same as nda::fold, except that the initial value is a default constructed value type of the array...
+
bool any(A const &a)
Does any of the elements of the array evaluate to true?
+
auto min_element(A const &a)
Find the minimum element of an array.
+
auto sum(A const &a)
Sum all the elements of an nda::Array object.
+
constexpr auto hadamard(A &&a, B &&b)
Hadamard product of two nda::Array objects.
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
+
bool all(A const &a)
Do all elements of the array evaluate to true?
+
constexpr auto hadamard(std::array< T, R > const &a, std::array< U, R > const &b)
Hadamard product of two std::array objects.
+
double frobenius_norm(A const &a)
Calculate the Frobenius norm of a 2-dimensional array.
+
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/allocators_8hpp_source.html b/docs/unstable/allocators_8hpp_source.html index 25138a5ec..f9e813b19 100644 --- a/docs/unstable/allocators_8hpp_source.html +++ b/docs/unstable/allocators_8hpp_source.html @@ -160,7 +160,7 @@
47#endif
48#endif
49
-
50namespace nda::mem {
+
50namespace nda::mem {
51
52 /**
53 * @addtogroup mem_allocators
@@ -1066,6 +1066,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -1156,25 +1157,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/arithmetic_8hpp_source.html b/docs/unstable/arithmetic_8hpp_source.html index 9cce8b043..056e60990 100644 --- a/docs/unstable/arithmetic_8hpp_source.html +++ b/docs/unstable/arithmetic_8hpp_source.html @@ -150,7 +150,7 @@
37#include "./exceptions.hpp"
38#endif // NDA_ENFORCE_BOUNDCHECK
39
-
40namespace nda {
+
40namespace nda {
41
42 /**
43 * @addtogroup av_ops
@@ -236,10 +236,10 @@
118
119 // FIXME : we should use is_scalar_for_v but the trait needs work to accommodate scalar L or R
120 /// Constexpr variable that is true if the left hand side operand is a scalar.
-
121 static constexpr bool l_is_scalar = nda::is_scalar_v<L>;
+
121 static constexpr bool l_is_scalar = nda::is_scalar_v<L>;
122
123 /// Constexpr variable that is true if the right hand side operand is a scalar.
-
124 static constexpr bool r_is_scalar = nda::is_scalar_v<R>;
+
124 static constexpr bool r_is_scalar = nda::is_scalar_v<R>;
125
126 /// Constexpr variable specifying the algebra of one of the non-scalar operands.
127 static constexpr char algebra = (l_is_scalar ? get_algebra<R> : get_algebra<L>);
@@ -706,6 +706,7 @@
551 /** @} */
552
553} // namespace nda
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
Array auto operator-(L &&l, R &&r)
Subtraction operator for two nda::Array types.
Array auto operator+(L &&l, R &&r)
Addition operator for two nda::Array types.
Array auto operator/(L &&l, R &&r)
Division operator for two nda::Array types.
diff --git a/docs/unstable/array_8hpp.html b/docs/unstable/array_8hpp.html index bd1354a03..4b4be08e2 100644 --- a/docs/unstable/array_8hpp.html +++ b/docs/unstable/array_8hpp.html @@ -165,10 +165,10 @@ constexpr std::array< T, R - N > nda::stdutil::mpop (std::array< T, R > const &a)  Make a new std::array by popping the last N elements of an existing std::array.
  -template<typename T , size_t R> -constexpr std::array< T, R > std::operator* (std::array< T, R > const &lhs, std::array< T, R > const &rhs) - Multiply two std::array objects element-wise.
-  +template<typename T , typename U , size_t R> +constexpr auto std::operator* (std::array< T, R > const &lhs, std::array< U, R > const &rhs) + Multiply two std::array objects element-wise.
+  template<typename T , size_t R> constexpr std::array< T, R > std::operator* (T s, std::array< T, R > const &a)  Multiply a scalar and a std::array element-wise.
diff --git a/docs/unstable/array_8hpp.js b/docs/unstable/array_8hpp.js index 1034d4265..8996c682f 100644 --- a/docs/unstable/array_8hpp.js +++ b/docs/unstable/array_8hpp.js @@ -9,7 +9,7 @@ var array_8hpp = [ "make_initialized_array", "array_8hpp.html#gab8d45097fed36893d99fadfab415d285", null ], [ "make_std_array", "array_8hpp.html#gad77dab4683ef83a8c21219693f2f440d", null ], [ "mpop", "array_8hpp.html#gaedd4bb9fe174afa880deb1d5ff1bfe32", null ], - [ "operator*", "array_8hpp.html#ga150bf6446a518f7929c3b77eb01831e3", null ], + [ "operator*", "array_8hpp.html#ga123c9c27f42fa662b906d6312f2ac57c", null ], [ "operator*", "array_8hpp.html#ga811f3de76af8953ea07be27bd75cd1fa", null ], [ "operator+", "array_8hpp.html#ga4402967146599c40ebbb648249c4a5f6", null ], [ "operator-", "array_8hpp.html#ga5878c65b7c74eaa1ab54848dd0883d27", null ], diff --git a/docs/unstable/array_8hpp_source.html b/docs/unstable/array_8hpp_source.html index 130f1df92..d59778172 100644 --- a/docs/unstable/array_8hpp_source.html +++ b/docs/unstable/array_8hpp_source.html @@ -226,311 +226,314 @@
105 /**
106 * @brief Multiply two std::array objects element-wise.
107 *
-
108 * @tparam T Value type of the arrays.
-
109 * @tparam R Size of the arrays.
-
110 * @param lhs Left hand side std::array operand.
-
111 * @param rhs Right hand side std::array operand.
-
112 * @return std::array containing the element-wise product.
-
113 */
-
114 template <typename T, size_t R>
-
-
115 constexpr std::array<T, R> operator*(std::array<T, R> const &lhs, std::array<T, R> const &rhs) {
-
116 std::array<T, R> res;
-
117 for (int i = 0; i < R; ++i) res[i] = lhs[i] * rhs[i];
-
118 return res;
-
119 }
+
108 * @tparam T Value type of the first array.
+
109 * @tparam U Value type of the second array.
+
110 * @tparam R Size of the arrays.
+
111 * @param lhs Left hand side std::array operand.
+
112 * @param rhs Right hand side std::array operand.
+
113 * @return std::array containing the element-wise product.
+
114 */
+
115 template <typename T, typename U, size_t R>
+
+
116 constexpr auto operator*(std::array<T, R> const &lhs, std::array<U, R> const &rhs) {
+
117 using TU = decltype(std::declval<T>() * std::declval<U>());
+
118
+
119 std::array<TU, R> res;
+
120 for (int i = 0; i < R; ++i) res[i] = lhs[i] * rhs[i];
+
121 return res;
+
122 }
-
120
-
121 /**
-
122 * @brief Negate a std::array element-wise (unary minus).
-
123 *
-
124 * @tparam T Value type of the array.
-
125 * @tparam R Size of the array.
-
126 * @param a std::array operand.
-
127 * @return std::array containing the element-wise negation.
-
128 */
-
129 template <typename T, size_t R>
-
-
130 constexpr std::array<T, R> operator-(std::array<T, R> const &a) {
-
131 std::array<T, R> res;
-
132 for (int i = 0; i < R; ++i) res[i] = -a[i];
-
133 return res;
-
134 }
+
123
+
124 /**
+
125 * @brief Negate a std::array element-wise (unary minus).
+
126 *
+
127 * @tparam T Value type of the array.
+
128 * @tparam R Size of the array.
+
129 * @param a std::array operand.
+
130 * @return std::array containing the element-wise negation.
+
131 */
+
132 template <typename T, size_t R>
+
+
133 constexpr std::array<T, R> operator-(std::array<T, R> const &a) {
+
134 std::array<T, R> res;
+
135 for (int i = 0; i < R; ++i) res[i] = -a[i];
+
136 return res;
+
137 }
-
135
-
136 /**
-
137 * @brief Multiply a scalar and a std::array element-wise.
-
138 *
-
139 * @tparam T Value type of the array/scalar.
-
140 * @tparam R Size of the array.
-
141 * @param s Scalar value.
-
142 * @param a std::array operand.
-
143 * @return std::array containing the product of each element with the scalar.
-
144 */
-
145 template <typename T, size_t R>
-
-
146 constexpr std::array<T, R> operator*(T s, std::array<T, R> const &a) {
-
147 std::array<T, R> res;
-
148 for (int i = 0; i < R; ++i) res[i] = s * a[i];
-
149 return res;
-
150 }
+
138
+
139 /**
+
140 * @brief Multiply a scalar and a std::array element-wise.
+
141 *
+
142 * @tparam T Value type of the array/scalar.
+
143 * @tparam R Size of the array.
+
144 * @param s Scalar value.
+
145 * @param a std::array operand.
+
146 * @return std::array containing the product of each element with the scalar.
+
147 */
+
148 template <typename T, size_t R>
+
+
149 constexpr std::array<T, R> operator*(T s, std::array<T, R> const &a) {
+
150 std::array<T, R> res;
+
151 for (int i = 0; i < R; ++i) res[i] = s * a[i];
+
152 return res;
+
153 }
-
151
-
152} // namespace std
-
153
-
154namespace nda::stdutil {
-
155
-
156 /**
-
157 * @brief Create a new std::array object initialized with a specific value.
-
158 *
-
159 * @tparam R Size of the array.
-
160 * @tparam T Value type of the array.
-
161 * @param v Value to initialize the std::array with.
-
162 * @return std::array initialized with the constant value.
-
163 */
-
164 template <size_t R, typename T>
-
-
165 constexpr std::array<T, R> make_initialized_array(T v) {
-
166 return [&v]<size_t... Is>(std::index_sequence<Is...>) {
-
167 return std::array<T, R>{((void)Is, v)...}; // NOLINT (always v, just a trick to have the pack)
-
168 }(std::make_index_sequence<R>{});
-
169 }
+
154
+
155} // namespace std
+
156
+
157namespace nda::stdutil {
+
158
+
159 /**
+
160 * @brief Create a new std::array object initialized with a specific value.
+
161 *
+
162 * @tparam R Size of the array.
+
163 * @tparam T Value type of the array.
+
164 * @param v Value to initialize the std::array with.
+
165 * @return std::array initialized with the constant value.
+
166 */
+
167 template <size_t R, typename T>
+
+
168 constexpr std::array<T, R> make_initialized_array(T v) {
+
169 return [&v]<size_t... Is>(std::index_sequence<Is...>) {
+
170 return std::array<T, R>{((void)Is, v)...}; // NOLINT (always v, just a trick to have the pack)
+
171 }(std::make_index_sequence<R>{});
+
172 }
-
170
-
171 /**
-
172 * @brief Convert a std::array with value type `U` to a std::array with value type `T`.
-
173 *
-
174 * @tparam T Value type of the target array.
-
175 * @tparam U Value type of the input array.
-
176 * @tparam R Size of the input array.
-
177 * @param a Input std::array.
-
178 * @return std::array with the same values as the input array and value type `T`.
-
179 */
-
180 template <typename T, typename U, size_t R>
-
-
181 constexpr std::array<T, R> make_std_array(std::array<U, R> const &a) {
-
182 static_assert(std::is_constructible_v<T, U>, "Error in nda::stdutil::make_std_array: T must be constructible from U");
-
183 std::array<T, R> result = make_initialized_array<R>(T{});
-
184 for (int u = 0; u < R; ++u) result[u] = a[u];
-
185 return result;
-
186 }
+
173
+
174 /**
+
175 * @brief Convert a std::array with value type `U` to a std::array with value type `T`.
+
176 *
+
177 * @tparam T Value type of the target array.
+
178 * @tparam U Value type of the input array.
+
179 * @tparam R Size of the input array.
+
180 * @param a Input std::array.
+
181 * @return std::array with the same values as the input array and value type `T`.
+
182 */
+
183 template <typename T, typename U, size_t R>
+
+
184 constexpr std::array<T, R> make_std_array(std::array<U, R> const &a) {
+
185 static_assert(std::is_constructible_v<T, U>, "Error in nda::stdutil::make_std_array: T must be constructible from U");
+
186 std::array<T, R> result = make_initialized_array<R>(T{});
+
187 for (int u = 0; u < R; ++u) result[u] = a[u];
+
188 return result;
+
189 }
-
187
-
188 /**
-
189 * @brief Convert a std::array to a std::vector.
-
190 *
-
191 * @tparam T Value type of the input array.
-
192 * @tparam R Size of the input array.
-
193 * @param a Input std::array.
-
194 * @return std::vector of the same size and with the same values as the input array.
-
195 */
-
196 template <typename T, size_t R>
-
-
197 constexpr std::vector<T> to_vector(std::array<T, R> const &a) {
-
198 std::vector<T> V(R);
-
199 for (int i = 0; i < R; ++i) V[i] = a[i];
-
200 return V;
-
201 }
+
190
+
191 /**
+
192 * @brief Convert a std::array to a std::vector.
+
193 *
+
194 * @tparam T Value type of the input array.
+
195 * @tparam R Size of the input array.
+
196 * @param a Input std::array.
+
197 * @return std::vector of the same size and with the same values as the input array.
+
198 */
+
199 template <typename T, size_t R>
+
+
200 constexpr std::vector<T> to_vector(std::array<T, R> const &a) {
+
201 std::vector<T> V(R);
+
202 for (int i = 0; i < R; ++i) V[i] = a[i];
+
203 return V;
+
204 }
-
202
-
203 /**
-
204 * @brief Make a new std::array by appending one element at the end to an existing std::array.
-
205 *
-
206 * @tparam T Value type of the input array.
-
207 * @tparam R Size of the input array.
-
208 * @tparam U Type of the element to append (must be convertible to `T`).
-
209 * @param a Input std::array.
-
210 * @param x Element to append.
-
211 * @return A copy of the input array with the additional element appended at the end.
-
212 */
-
213 template <typename T, auto R, typename U>
-
-
214 constexpr std::array<T, R + 1> append(std::array<T, R> const &a, U const &x) {
-
215 std::array<T, R + 1> res;
-
216 for (int i = 0; i < R; ++i) res[i] = a[i];
-
217 res[R] = x;
-
218 return res;
-
219 }
+
205
+
206 /**
+
207 * @brief Make a new std::array by appending one element at the end to an existing std::array.
+
208 *
+
209 * @tparam T Value type of the input array.
+
210 * @tparam R Size of the input array.
+
211 * @tparam U Type of the element to append (must be convertible to `T`).
+
212 * @param a Input std::array.
+
213 * @param x Element to append.
+
214 * @return A copy of the input array with the additional element appended at the end.
+
215 */
+
216 template <typename T, auto R, typename U>
+
+
217 constexpr std::array<T, R + 1> append(std::array<T, R> const &a, U const &x) {
+
218 std::array<T, R + 1> res;
+
219 for (int i = 0; i < R; ++i) res[i] = a[i];
+
220 res[R] = x;
+
221 return res;
+
222 }
-
220
-
221 /**
-
222 * @brief Make a new std::array by prepending one element at the front to an existing std::array.
-
223 *
-
224 * @tparam T Value type of the input array.
-
225 * @tparam U Type of the element to prepend (must be convertible to `T`).
-
226 * @tparam R Size of the input array.
-
227 * @param a Input std::array.
-
228 * @param x Element to prepend.
-
229 * @return A copy of the input array with the additional element prepended at the front.
-
230 */
-
231 template <typename T, typename U, size_t R>
-
-
232 constexpr std::array<T, R + 1> front_append(std::array<T, R> const &a, U const &x) {
-
233 std::array<T, R + 1> res;
-
234 res[0] = x;
-
235 for (int i = 0; i < R; ++i) res[i + 1] = a[i];
-
236 return res;
-
237 }
+
223
+
224 /**
+
225 * @brief Make a new std::array by prepending one element at the front to an existing std::array.
+
226 *
+
227 * @tparam T Value type of the input array.
+
228 * @tparam U Type of the element to prepend (must be convertible to `T`).
+
229 * @tparam R Size of the input array.
+
230 * @param a Input std::array.
+
231 * @param x Element to prepend.
+
232 * @return A copy of the input array with the additional element prepended at the front.
+
233 */
+
234 template <typename T, typename U, size_t R>
+
+
235 constexpr std::array<T, R + 1> front_append(std::array<T, R> const &a, U const &x) {
+
236 std::array<T, R + 1> res;
+
237 res[0] = x;
+
238 for (int i = 0; i < R; ++i) res[i + 1] = a[i];
+
239 return res;
+
240 }
-
238
-
239 /**
-
240 * @brief Make a new std::array by popping the last `N` elements of an existing std::array.
-
241 *
-
242 * @tparam N Number of elements to pop.
-
243 * @tparam T Value type of the input array.
-
244 * @tparam R Size of the input array.
-
245 * @param a Input std::array.
-
246 * @return A copy of the input array with the last `N` elements removed.
-
247 */
-
248 template <int N, typename T, size_t R>
-
-
249 constexpr std::array<T, R - N> mpop(std::array<T, R> const &a) {
-
250 std::array<T, R - N> res;
-
251 for (int i = 0; i < R - N; ++i) res[i] = a[i];
-
252 return res;
-
253 }
+
241
+
242 /**
+
243 * @brief Make a new std::array by popping the last `N` elements of an existing std::array.
+
244 *
+
245 * @tparam N Number of elements to pop.
+
246 * @tparam T Value type of the input array.
+
247 * @tparam R Size of the input array.
+
248 * @param a Input std::array.
+
249 * @return A copy of the input array with the last `N` elements removed.
+
250 */
+
251 template <int N, typename T, size_t R>
+
+
252 constexpr std::array<T, R - N> mpop(std::array<T, R> const &a) {
+
253 std::array<T, R - N> res;
+
254 for (int i = 0; i < R - N; ++i) res[i] = a[i];
+
255 return res;
+
256 }
-
254
-
255 /**
-
256 * @brief Make a new std::array by popping the last element of an existing std::array.
-
257 *
-
258 * @tparam T Value type of the input array.
-
259 * @tparam R Size of the input array.
-
260 * @param a Input std::array.
-
261 * @return A copy of the input array with the last element removed.
-
262 */
-
263 template <typename T, size_t R>
-
-
264 constexpr std::array<T, R - 1> pop(std::array<T, R> const &a) {
-
265 return mpop<1>(a);
-
266 }
+
257
+
258 /**
+
259 * @brief Make a new std::array by popping the last element of an existing std::array.
+
260 *
+
261 * @tparam T Value type of the input array.
+
262 * @tparam R Size of the input array.
+
263 * @param a Input std::array.
+
264 * @return A copy of the input array with the last element removed.
+
265 */
+
266 template <typename T, size_t R>
+
+
267 constexpr std::array<T, R - 1> pop(std::array<T, R> const &a) {
+
268 return mpop<1>(a);
+
269 }
-
267
-
268 /**
-
269 * @brief Make a new std::array by popping the first `N` elements of an existing std::array.
-
270 *
-
271 * @tparam N Number of elements to pop.
-
272 * @tparam T Value type of the input array.
-
273 * @tparam R Size of the input array.
-
274 * @param a Input array.
-
275 * @return A copy of the input array with the first `N` elements removed.
-
276 */
-
277 template <int N, typename T, size_t R>
-
-
278 constexpr std::array<T, R - N> front_mpop(std::array<T, R> const &a) {
-
279 std::array<T, R - N> res;
-
280 for (int i = N; i < R; ++i) res[i - N] = a[i];
-
281 return res;
-
282 }
+
270
+
271 /**
+
272 * @brief Make a new std::array by popping the first `N` elements of an existing std::array.
+
273 *
+
274 * @tparam N Number of elements to pop.
+
275 * @tparam T Value type of the input array.
+
276 * @tparam R Size of the input array.
+
277 * @param a Input array.
+
278 * @return A copy of the input array with the first `N` elements removed.
+
279 */
+
280 template <int N, typename T, size_t R>
+
+
281 constexpr std::array<T, R - N> front_mpop(std::array<T, R> const &a) {
+
282 std::array<T, R - N> res;
+
283 for (int i = N; i < R; ++i) res[i - N] = a[i];
+
284 return res;
+
285 }
-
283
-
284 /**
-
285 * @brief Make a new std::array by popping the first element of an existing std::array.
-
286 *
-
287 * @tparam T Value type of the input array.
-
288 * @tparam R Size of the input array.
-
289 * @param a Input std::array.
-
290 * @return A copy of the input array with the first element removed.
-
291 */
-
292 template <typename T, size_t R>
-
-
293 constexpr std::array<T, R - 1> front_pop(std::array<T, R> const &a) {
-
294 return front_mpop<1>(a);
-
295 }
+
286
+
287 /**
+
288 * @brief Make a new std::array by popping the first element of an existing std::array.
+
289 *
+
290 * @tparam T Value type of the input array.
+
291 * @tparam R Size of the input array.
+
292 * @param a Input std::array.
+
293 * @return A copy of the input array with the first element removed.
+
294 */
+
295 template <typename T, size_t R>
+
+
296 constexpr std::array<T, R - 1> front_pop(std::array<T, R> const &a) {
+
297 return front_mpop<1>(a);
+
298 }
-
296
-
297 /**
-
298 * @brief Make a new std::array by joining two existing std::array objects.
-
299 *
-
300 * @tparam T Value type of the arrays.
-
301 * @tparam R1 Size of the input array #1.
-
302 * @tparam R2 Size of the input array #2.
-
303 * @param a1 Input std::array #1.
-
304 * @param a2 Input std::array #2.
-
305 * @return Array of size `R1 + R2` containing the elements of the first array followed by
-
306 * the elements of the second array.
-
307 */
-
308 template <typename T, size_t R1, size_t R2>
-
-
309 constexpr std::array<T, R1 + R2> join(std::array<T, R1> const &a1, std::array<T, R2> const &a2) {
-
310 std::array<T, R1 + R2> res;
-
311 for (int i = 0; i < R1; ++i) res[i] = a1[i];
-
312 for (int i = 0; i < R2; ++i) res[R1 + i] = a2[i];
-
313 return res;
-
314 }
+
299
+
300 /**
+
301 * @brief Make a new std::array by joining two existing std::array objects.
+
302 *
+
303 * @tparam T Value type of the arrays.
+
304 * @tparam R1 Size of the input array #1.
+
305 * @tparam R2 Size of the input array #2.
+
306 * @param a1 Input std::array #1.
+
307 * @param a2 Input std::array #2.
+
308 * @return Array of size `R1 + R2` containing the elements of the first array followed by
+
309 * the elements of the second array.
+
310 */
+
311 template <typename T, size_t R1, size_t R2>
+
+
312 constexpr std::array<T, R1 + R2> join(std::array<T, R1> const &a1, std::array<T, R2> const &a2) {
+
313 std::array<T, R1 + R2> res;
+
314 for (int i = 0; i < R1; ++i) res[i] = a1[i];
+
315 for (int i = 0; i < R2; ++i) res[R1 + i] = a2[i];
+
316 return res;
+
317 }
-
315
-
316 /**
-
317 * @brief Calculate the sum of all elements in a std::array.
-
318 *
-
319 * @tparam T Value type of the array.
-
320 * @tparam R Size of the array.
-
321 * @param a Input std::array.
-
322 * @return Sum of all the elements of the input array. If its size is zero, return a default
-
323 * constructed object of type `T`.
-
324 */
-
325 template <typename T, size_t R>
-
-
326 constexpr auto sum(std::array<T, R> const &a) {
-
327 if constexpr (R == 0)
-
328 return T{};
-
329 else {
-
330 auto res = a[0];
-
331 for (int i = 1; i < R; ++i) res += a[i];
-
332 return res;
-
333 }
-
334 }
+
318
+
319 /**
+
320 * @brief Calculate the sum of all elements in a std::array.
+
321 *
+
322 * @tparam T Value type of the array.
+
323 * @tparam R Size of the array.
+
324 * @param a Input std::array.
+
325 * @return Sum of all the elements of the input array. If its size is zero, return a default
+
326 * constructed object of type `T`.
+
327 */
+
328 template <typename T, size_t R>
+
+
329 constexpr auto sum(std::array<T, R> const &a) {
+
330 if constexpr (R == 0)
+
331 return T{};
+
332 else {
+
333 auto res = a[0];
+
334 for (int i = 1; i < R; ++i) res += a[i];
+
335 return res;
+
336 }
+
337 }
-
335
-
336 /**
-
337 * @brief Calculate the product of all elements in a std::array.
-
338 *
-
339 * @tparam T Value type of the array.
-
340 * @tparam R Size of the array.
-
341 * @param a Input std::array.
-
342 * @return Product of all elements in the input array.
-
343 */
-
344 template <typename T, size_t R>
-
-
345 constexpr auto product(std::array<T, R> const &a) {
-
346 static_assert(R > 0, "Error in nda::stdutil::product: Only defined for R > 0");
-
347 auto res = a[0];
-
348 for (int i = 1; i < R; ++i) res *= a[i];
-
349 return res;
-
350 }
+
338
+
339 /**
+
340 * @brief Calculate the product of all elements in a std::array.
+
341 *
+
342 * @tparam T Value type of the array.
+
343 * @tparam R Size of the array.
+
344 * @param a Input std::array.
+
345 * @return Product of all elements in the input array.
+
346 */
+
347 template <typename T, size_t R>
+
+
348 constexpr auto product(std::array<T, R> const &a) {
+
349 static_assert(R > 0, "Error in nda::stdutil::product: Only defined for R > 0");
+
350 auto res = a[0];
+
351 for (int i = 1; i < R; ++i) res *= a[i];
+
352 return res;
+
353 }
-
351
-
352 /**
-
353 * @brief Calculate the dot product of two std::array objects.
-
354 *
-
355 * @warning This function simply calculates the sum of the element-wise products of the two arrays. For arrays with
-
356 * complex numbers, this might not be what you expect from a dot product.
+
354
+
355 /**
+
356 * @brief Calculate the dot product of two std::array objects.
357 *
-
358 * @tparam T Value type of input array #1.
-
359 * @tparam U Value type of input array #2.
-
360 * @tparam R Size of the input arrays.
-
361 * @param a1 Input array #1.
-
362 * @param a2 Input array #2.
-
363 * @return Sum of the element-wise products of the two arrays.
-
364 */
-
365 template <typename T, typename U, size_t R>
-
-
366 constexpr auto dot_product(std::array<T, R> const &a1, std::array<U, R> const &a2) {
-
367 if constexpr (R == 0)
-
368 return T{};
-
369 else {
-
370 auto res = a1[0] * a2[0];
-
371 for (int i = 1; i < R; ++i) res += a1[i] * a2[i];
-
372 return res;
-
373 }
-
374 }
+
358 * @warning This function simply calculates the sum of the element-wise products of the two arrays. For arrays with
+
359 * complex numbers, this might not be what you expect from a dot product.
+
360 *
+
361 * @tparam T Value type of input array #1.
+
362 * @tparam U Value type of input array #2.
+
363 * @tparam R Size of the input arrays.
+
364 * @param a1 Input array #1.
+
365 * @param a2 Input array #2.
+
366 * @return Sum of the element-wise products of the two arrays.
+
367 */
+
368 template <typename T, typename U, size_t R>
+
+
369 constexpr auto dot_product(std::array<T, R> const &a1, std::array<U, R> const &a2) {
+
370 if constexpr (R == 0)
+
371 return T{};
+
372 else {
+
373 auto res = a1[0] * a2[0];
+
374 for (int i = 1; i < R; ++i) res += a1[i] * a2[i];
+
375 return res;
+
376 }
+
377 }
-
375
-
376 /** @} */
-
377
-
378} // namespace nda::stdutil
-
379
-
380#endif // STDUTILS_ARRAY_H
+
378
+
379 /** @} */
+
380
+
381} // namespace nda::stdutil
+
382
+
383#endif // STDUTILS_ARRAY_H
void swap(nda::basic_array_view< V1, R1, LP1, A1, AP1, OP1 > &a, nda::basic_array_view< V2, R2, LP2, A2, AP2, OP2 > &b)=delete
std::swap is deleted for nda::basic_array_view.
Iterator for nda::basic_array and nda::basic_array_view types.
A generic view of a multi-dimensional array.
@@ -704,6 +707,7 @@
idx_map(std::array< long, R > const &)
Construct a new map with a shape of a different rank.
Definition idx_map.hpp:435
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -782,25 +786,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/array__adapter_8hpp_source.html b/docs/unstable/array__adapter_8hpp_source.html index 49b437d19..ed3abf698 100644 --- a/docs/unstable/array__adapter_8hpp_source.html +++ b/docs/unstable/array__adapter_8hpp_source.html @@ -140,7 +140,7 @@
27#include <array>
28#include <type_traits>
29
-
30namespace nda {
+
30namespace nda {
31
32 /**
33 * @addtogroup av_utils
@@ -224,6 +224,7 @@
auto operator()(long i0, Ints... is) const
Function call operator simply forwards the arguments to the callable object.
long size() const
Get the total size of the adapter.
auto const & shape() const
Get shape of the adapter.
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
constexpr char get_algebra< array_adapter< R, F > >
Specialization of nda::get_algebra for nda::array_adapter.
diff --git a/docs/unstable/auto__assign_8hpp_source.html b/docs/unstable/auto__assign_8hpp_source.html index 9096e2bd8..2189d92b9 100644 --- a/docs/unstable/auto__assign_8hpp_source.html +++ b/docs/unstable/auto__assign_8hpp_source.html @@ -144,7 +144,7 @@
31#include <tuple>
32#include <utility>
33
-
34namespace nda::clef {
+
34namespace nda::clef {
35
36 /**
37 * @addtogroup clef_autoassign
@@ -387,6 +387,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/auto__assign__subscript_8hpp_source.html b/docs/unstable/auto__assign__subscript_8hpp_source.html index 62a49f17f..65210efd3 100644 --- a/docs/unstable/auto__assign__subscript_8hpp_source.html +++ b/docs/unstable/auto__assign__subscript_8hpp_source.html @@ -144,7 +144,7 @@
31#include <tuple>
32#include <utility>
33
-
34namespace nda::clef {
+
34namespace nda::clef {
35
36 /**
37 * @addtogroup clef_autoassign
@@ -391,6 +391,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/basic__array_8hpp_source.html b/docs/unstable/basic__array_8hpp_source.html index ffa74cfc9..348695ab4 100644 --- a/docs/unstable/basic__array_8hpp_source.html +++ b/docs/unstable/basic__array_8hpp_source.html @@ -168,7 +168,7 @@
55#include <iostream>
56#endif // NDA_ENFORCE_BOUNDCHECK
57
-
58namespace nda {
+
58namespace nda {
59
60 /**
61 * @ingroup arrays_views
@@ -424,10 +424,10 @@
297 if constexpr (std::is_same_v<ValueType, get_value_t<A>>)
298 assign_from_ndarray(a);
299 else
-
300 assign_from_ndarray(nda::map([](auto const &val) { return ValueType(val); })(a));
+
300 assign_from_ndarray(nda::map([](auto const &val) { return ValueType(val); })(a));
301 } else {
302 // general value types may not be default constructible -> use placement new
-
303 nda::for_each(lay.lengths(), [&](auto const &...is) { new (sto.data() + lay(is...)) ValueType{a(is...)}; });
+
303 nda::for_each(lay.lengths(), [&](auto const &...is) { new (sto.data() + lay(is...)) ValueType{a(is...)}; });
304 }
305 }
@@ -571,7 +571,7 @@
429 template <std::integral Int = long>
430 static basic_array ones(std::array<Int, Rank> const &shape)
-
431 requires(nda::is_scalar_v<ValueType>)
+
431 requires(nda::is_scalar_v<ValueType>)
432 {
433 auto res = basic_array{stdutil::make_std_array<long>(shape)};
434 res() = ValueType{1};
@@ -608,13 +608,13 @@
462 template <std::integral Int = long>
463 static basic_array rand(std::array<Int, Rank> const &shape)
-
464 requires(std::is_floating_point_v<ValueType> or nda::is_complex_v<ValueType>)
+
464 requires(std::is_floating_point_v<ValueType> or nda::is_complex_v<ValueType>)
465 {
466 using namespace std::complex_literals;
467 auto static gen = std::mt19937(std::random_device{}());
468 auto static dist = std::uniform_real_distribution<>(0.0, 1.0);
469 auto res = basic_array{shape};
-
470 if constexpr (nda::is_complex_v<ValueType>)
+
470 if constexpr (nda::is_complex_v<ValueType>)
471 for (auto &x : res) x = dist(gen) + 1i * dist(gen);
472 else
473 for (auto &x : res) x = dist(gen);
@@ -1109,8 +1109,8 @@
927 return Iterator{indexmap().lengths(), indexmap().strides(), sto.data(), at_end};
928 } else {
929 // general case (we need to permute the shape and the strides according to the stride order of the layout)
-
930 return Iterator{nda::permutations::apply(layout_t::stride_order, indexmap().lengths()),
-
931 nda::permutations::apply(layout_t::stride_order, indexmap().strides()), sto.data(), at_end};
+
930 return Iterator{nda::permutations::apply(layout_t::stride_order, indexmap().lengths()),
+
931 nda::permutations::apply(layout_t::stride_order, indexmap().strides()), sto.data(), at_end};
932 }
933 } else {
934 // 1-dimensional iterator
@@ -1296,7 +1296,7 @@
1104 if constexpr (mem::on_device<self_t> || mem::on_device<RHS>) {
1105 NDA_RUNTIME_ERROR << "Error in assign_from_ndarray: Fallback to elementwise assignment not implemented for arrays/views on the GPU";
1106 }
-
1107 nda::for_each(shape(), [this, &rhs](auto const &...args) { (*this)(args...) = rhs(args...); });
+
1107 nda::for_each(shape(), [this, &rhs](auto const &...args) { (*this)(args...) = rhs(args...); });
1108}
1109
1110// Implementation to fill a view/array with a constant scalar value.
@@ -1424,6 +1424,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
layout_prop_e
Compile-time guarantees of the memory layout of an array/view.
Definition traits.hpp:222
static constexpr do_not_initialize_t do_not_initialize
Instance of nda::mem::do_not_initialize_t.
Definition handle.hpp:69
static constexpr init_zero_t init_zero
Instance of nda::mem::init_zero_t.
Definition handle.hpp:75
diff --git a/docs/unstable/basic__array__view_8hpp_source.html b/docs/unstable/basic__array__view_8hpp_source.html index 19a01b200..6fee13449 100644 --- a/docs/unstable/basic__array__view_8hpp_source.html +++ b/docs/unstable/basic__array__view_8hpp_source.html @@ -174,11 +174,11 @@
61 */
62 template <typename V1, int R1, typename LP1, char A1, typename AP1, typename OP1, typename V2, int R2, typename LP2, char A2, typename AP2,
63 typename OP2>
-
64 void swap(nda::basic_array_view<V1, R1, LP1, A1, AP1, OP1> &a, nda::basic_array_view<V2, R2, LP2, A2, AP2, OP2> &b) = delete;
+
64 void swap(nda::basic_array_view<V1, R1, LP1, A1, AP1, OP1> &a, nda::basic_array_view<V2, R2, LP2, A2, AP2, OP2> &b) = delete;
65
66} // namespace std
67
-
68namespace nda {
+
68namespace nda {
69
70 /**
71 * @ingroup arrays_views
@@ -893,8 +893,8 @@
741 return Iterator{indexmap().lengths(), indexmap().strides(), sto.data(), at_end};
742 } else {
743 // general case (we need to permute the shape and the strides according to the stride order of the layout)
-
744 return Iterator{nda::permutations::apply(layout_t::stride_order, indexmap().lengths()),
-
745 nda::permutations::apply(layout_t::stride_order, indexmap().strides()), sto.data(), at_end};
+
744 return Iterator{nda::permutations::apply(layout_t::stride_order, indexmap().lengths()),
+
745 nda::permutations::apply(layout_t::stride_order, indexmap().strides()), sto.data(), at_end};
746 }
747 } else {
748 // 1-dimensional iterator
@@ -1080,7 +1080,7 @@
918 if constexpr (mem::on_device<self_t> || mem::on_device<RHS>) {
919 NDA_RUNTIME_ERROR << "Error in assign_from_ndarray: Fallback to elementwise assignment not implemented for arrays/views on the GPU";
920 }
-
921 nda::for_each(shape(), [this, &rhs](auto const &...args) { (*this)(args...) = rhs(args...); });
+
921 nda::for_each(shape(), [this, &rhs](auto const &...args) { (*this)(args...) = rhs(args...); });
922}
923
924// Implementation to fill a view/array with a constant scalar value.
@@ -1134,12 +1134,12 @@
971
972 template <typename V, size_t R>
973 basic_array_view(std::array<V, R> &a)
-
974 -> basic_array_view<V, 1, nda::basic_layout<nda::static_extents(R), nda::C_stride_order<1>, nda::layout_prop_e::contiguous>, 'V',
+
974 -> basic_array_view<V, 1, nda::basic_layout<nda::static_extents(R), nda::C_stride_order<1>, nda::layout_prop_e::contiguous>, 'V',
976
977 template <typename V, size_t R>
978 basic_array_view(std::array<V, R> const &a)
-
979 -> basic_array_view<const V, 1, nda::basic_layout<nda::static_extents(R), nda::C_stride_order<1>, nda::layout_prop_e::contiguous>, 'V',
+
979 -> basic_array_view<const V, 1, nda::basic_layout<nda::static_extents(R), nda::C_stride_order<1>, nda::layout_prop_e::contiguous>, 'V',
981
982 template <std::ranges::contiguous_range R>
@@ -1280,6 +1280,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
constexpr uint64_t static_extents(int i0, Is... is)
Encode the given shape into a single integer using the nda::encode function.
layout_prop_e
Compile-time guarantees of the memory layout of an array/view.
Definition traits.hpp:222
static constexpr do_not_initialize_t do_not_initialize
Instance of nda::mem::do_not_initialize_t.
Definition handle.hpp:69
diff --git a/docs/unstable/basic__functions_8hpp_source.html b/docs/unstable/basic__functions_8hpp_source.html index b87423b0d..c7f4299be 100644 --- a/docs/unstable/basic__functions_8hpp_source.html +++ b/docs/unstable/basic__functions_8hpp_source.html @@ -151,7 +151,7 @@
38#include <type_traits>
39#include <utility>
40
-
41namespace nda {
+
41namespace nda {
42
43 /**
44 * @addtogroup av_factories
@@ -215,7 +215,7 @@
98 template <typename T, std::integral Int, auto Rank>
99 auto ones(std::array<Int, Rank> const &shape)
-
100 requires(nda::is_scalar_v<T>)
+
100 requires(nda::is_scalar_v<T>)
101 {
102 if constexpr (Rank == 0)
103 return T{1};
@@ -645,7 +645,7 @@
485#endif
486 if (lhs.shape() != rhs.shape()) return false;
487 bool r = true;
-
488 nda::for_each(lhs.shape(), [&](auto &&...x) { r &= (lhs(x...) == rhs(x...)); });
+
488 nda::for_each(lhs.shape(), [&](auto &&...x) { r &= (lhs(x...) == rhs(x...)); });
489 return r;
490 }
@@ -696,7 +696,7 @@
531 template <Array A, typename F>
532 void clef_auto_assign(A &&a, F &&f) { // NOLINT (Should we forward the references?)
-
533 nda::for_each(a.shape(), [&a, &f](auto &&...x) {
+
533 nda::for_each(a.shape(), [&a, &f](auto &&...x) {
534 if constexpr (clef::is_function<std::decay_t<decltype(f(x...))>>) {
535 clef_auto_assign(a(x...), f(x...));
536 } else {
@@ -936,6 +936,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/blas_2dot_8hpp_source.html b/docs/unstable/blas_2dot_8hpp_source.html index 638002307..3692d623d 100644 --- a/docs/unstable/blas_2dot_8hpp_source.html +++ b/docs/unstable/blas_2dot_8hpp_source.html @@ -147,7 +147,7 @@
34
35#include <complex>
36
-
37namespace nda::blas {
+
37namespace nda::blas {
38
39 /**
40 * @addtogroup linalg_blas
@@ -323,6 +323,7 @@
202 /** @} */
203
204} // namespace nda::blas
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto dot_generic(X const &x, Y const &y)
Generic implementation of nda::blas::dot for types not supported by BLAS/LAPACK.
Definition dot.hpp:176
auto dotc(X const &x, Y const &y)
Interface to the BLAS dotc routine.
Definition dot.hpp:103
auto dotc_generic(X const &x, Y const &y)
Generic implementation of nda::blas::dotc for types not supported by BLAS/LAPACK.
Definition dot.hpp:194
diff --git a/docs/unstable/blas_2interface_2cxx__interface_8cpp_source.html b/docs/unstable/blas_2interface_2cxx__interface_8cpp_source.html index b300464fa..b8cf259af 100644 --- a/docs/unstable/blas_2interface_2cxx__interface_8cpp_source.html +++ b/docs/unstable/blas_2interface_2cxx__interface_8cpp_source.html @@ -178,7 +178,7 @@
65nda_complex_double F77_zdotc(FINT, const double *, FINT, const double *, FINT);
66}
67
-
68namespace nda::blas::f77 {
+
68namespace nda::blas::f77 {
69
70 inline auto *blacplx(dcomplex *c) { return reinterpret_cast<double *>(c); } // NOLINT
71 inline auto *blacplx(dcomplex const *c) { return reinterpret_cast<const double *>(c); } // NOLINT
@@ -331,6 +331,7 @@
#define F77_daxpy
Definition cblas_f77.h:109
#define F77_zgeru
Definition cblas_f77.h:172
#define F77_GLOBAL(lcname, UCNAME)
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
diff --git a/docs/unstable/blas_2interface_2cxx__interface_8hpp_source.html b/docs/unstable/blas_2interface_2cxx__interface_8hpp_source.html index 05281af37..868e5484b 100644 --- a/docs/unstable/blas_2interface_2cxx__interface_8hpp_source.html +++ b/docs/unstable/blas_2interface_2cxx__interface_8hpp_source.html @@ -140,7 +140,7 @@
27#include "./cublas_interface.hpp"
28#endif
29
-
30namespace nda::blas::f77 {
+
30namespace nda::blas::f77 {
31
32 void axpy(int N, double alpha, const double *x, int incx, double *Y, int incy);
33 void axpy(int N, dcomplex alpha, const dcomplex *x, int incx, dcomplex *Y, int incy);
@@ -335,6 +335,7 @@
#define F77_stbmv
Definition cblas_f77.h:181
#define F77_zsyrk
Definition cblas_f77.h:239
#define F77_GLOBAL(lcname, UCNAME)
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
diff --git a/docs/unstable/bound__check__worker_8hpp_source.html b/docs/unstable/bound__check__worker_8hpp_source.html index d1c61e1ad..74b3debcf 100644 --- a/docs/unstable/bound__check__worker_8hpp_source.html +++ b/docs/unstable/bound__check__worker_8hpp_source.html @@ -142,7 +142,7 @@
29#include <stdexcept>
30#include <sstream>
31
-
32namespace nda::detail {
+
32namespace nda::detail {
33
34 // Check the bounds when accessing single elements or slices of an array/view.
35 struct bound_check_worker {
@@ -201,7 +201,7 @@
88
89} // namespace nda::detail
90
-
91namespace nda {
+
91namespace nda {
92
93 /**
94 * @ingroup layout_utils
@@ -239,6 +239,7 @@
125
126} // namespace nda
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void assert_in_bounds(int rank, long const *lengths, Args const &...args)
Check if the given indices/arguments are within the bounds of an array/view.
Mimics Python's ... syntax.
Definition range.hpp:49
diff --git a/docs/unstable/broadcast_8hpp_source.html b/docs/unstable/broadcast_8hpp_source.html index eb107bc4a..ae23200f0 100644 --- a/docs/unstable/broadcast_8hpp_source.html +++ b/docs/unstable/broadcast_8hpp_source.html @@ -141,7 +141,7 @@
28
29#include <mpi/mpi.hpp>
30
-
31namespace nda {
+
31namespace nda {
32
33 /**
34 * @ingroup av_mpi
@@ -184,6 +184,7 @@
70
71} // namespace nda
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void mpi_broadcast(A &a, mpi::communicator comm={}, int root=0)
Implementation of an MPI broadcast for nda::basic_array or nda::basic_array_view types.
Definition broadcast.hpp:61
diff --git a/docs/unstable/cblas__f77_8h_source.html b/docs/unstable/cblas__f77_8h_source.html index dcbb32ecd..d04006c8f 100644 --- a/docs/unstable/cblas__f77_8h_source.html +++ b/docs/unstable/cblas__f77_8h_source.html @@ -708,6 +708,7 @@
#define F77_stbmv
Definition cblas_f77.h:181
#define F77_zsyrk
Definition cblas_f77.h:239
#define F77_GLOBAL(lcname, UCNAME)
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
diff --git a/docs/unstable/cblas__mangling__with__flags_8h_source.html b/docs/unstable/cblas__mangling__with__flags_8h_source.html index 904e65ff7..38d05133c 100644 --- a/docs/unstable/cblas__mangling__with__flags_8h_source.html +++ b/docs/unstable/cblas__mangling__with__flags_8h_source.html @@ -277,6 +277,7 @@
#define F77_stbmv
Definition cblas_f77.h:181
#define F77_zsyrk
Definition cblas_f77.h:239
#define F77_GLOBAL(lcname, UCNAME)
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
diff --git a/docs/unstable/clef_2clef_8hpp_source.html b/docs/unstable/clef_2clef_8hpp_source.html index 025a19086..ff77c502b 100644 --- a/docs/unstable/clef_2clef_8hpp_source.html +++ b/docs/unstable/clef_2clef_8hpp_source.html @@ -276,6 +276,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/clef_8hpp_source.html b/docs/unstable/clef_8hpp_source.html index 71ae345af..1e8410448 100644 --- a/docs/unstable/clef_8hpp_source.html +++ b/docs/unstable/clef_8hpp_source.html @@ -391,6 +391,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -493,25 +494,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/concepts_8hpp_source.html b/docs/unstable/concepts_8hpp_source.html index 226812d90..42ee38bd4 100644 --- a/docs/unstable/concepts_8hpp_source.html +++ b/docs/unstable/concepts_8hpp_source.html @@ -142,7 +142,7 @@
29#include <type_traits>
30#include <utility>
31
-
32namespace nda {
+
32namespace nda {
33
34 /**
35 * @addtogroup utils_concepts
@@ -162,12 +162,12 @@
49 * @tparam A Type to check.
50 * @tparam R Number of long arguments.
51 */
-
52 template <typename A, int R>
+
52 template <typename A, int R>
-
53 concept CallableWithLongs = requires(A const &a) {
+
53 concept CallableWithLongs = requires(A const &a) {
54 // if decltype is not present, the concept will fail to compile for an A for which the a(Is...) is not well formed
-
55 []<auto... Is>(std::index_sequence<Is...>, auto const &aa) -> decltype(aa(long(Is)...)) {return aa(long(Is)...);}
-
56 (std::make_index_sequence<R>{}, a);
+
55 []<auto... Is>(std::index_sequence<Is...>, auto const &aa) -> decltype(aa(long(Is)...)) {return aa(long(Is)...);}
+
57 };
58 // clang-format on
@@ -231,14 +231,14 @@
116 * @tparam S Type to check.
117 */
118 template <typename S>
-
119 concept Scalar = nda::is_scalar_v<S>;
+
119 concept Scalar = nda::is_scalar_v<S>;
120
121 /**
122 * @brief Check if a given type is either a double or complex type.
123 * @tparam S Type to check.
124 */
125 template <typename S>
-
126 concept DoubleOrComplex = nda::is_double_or_complex_v<S>;
+
126 concept DoubleOrComplex = nda::is_double_or_complex_v<S>;
127
128 /**
129 * @brief Check if a given type is an instantiation of some other template type.
@@ -249,7 +249,7 @@
134 * @tparam TMPLT Template template type to check against.
135 */
136 template <typename T, template <typename...> class TMPLT>
-
137 concept InstantiationOf = nda::is_instantiation_of_v<TMPLT, T>;
+
137 concept InstantiationOf = nda::is_instantiation_of_v<TMPLT, T>;
138
139 /** @} */
140
@@ -470,6 +470,7 @@
343} // namespace nda
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int get_ld(A const &a)
Get the leading dimension in LAPACK jargon of an nda::MemoryMatrix.
Definition tools.hpp:109
static constexpr bool has_C_layout
Constexpr variable that is true if the given nda::Array type has a C memory layout.
Definition tools.hpp:76
static constexpr bool is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
Definition tools.hpp:52
diff --git a/docs/unstable/cross__product_8hpp_source.html b/docs/unstable/cross__product_8hpp_source.html index 6a0015a24..b19238476 100644 --- a/docs/unstable/cross__product_8hpp_source.html +++ b/docs/unstable/cross__product_8hpp_source.html @@ -138,7 +138,7 @@
25#include "../macros.hpp"
26#include "../traits.hpp"
27
-
28namespace nda::linalg {
+
28namespace nda::linalg {
29
30 /**
31 * @ingroup linalg_tools
@@ -163,6 +163,7 @@
49
50} // namespace nda::linalg
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto cross_product(V const &x, V const &y)
Compute the cross product of two 3-dimensional vectors.
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/cublas__interface_8cpp_source.html b/docs/unstable/cublas__interface_8cpp_source.html index 720d4f299..d03588ad5 100644 --- a/docs/unstable/cublas__interface_8cpp_source.html +++ b/docs/unstable/cublas__interface_8cpp_source.html @@ -141,7 +141,7 @@
28#include "magma_v2.h"
29#endif
30
-
31namespace nda::blas::device {
+
31namespace nda::blas::device {
32
33 // Local function to get unique CuBlas handle.
34 inline cublasHandle_t &get_handle() {
@@ -309,6 +309,7 @@
196} // namespace nda::blas::device
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define AS_STRING(...)
Definition macros.hpp:31
diff --git a/docs/unstable/cublas__interface_8hpp_source.html b/docs/unstable/cublas__interface_8hpp_source.html index 2d6d8a779..96c741318 100644 --- a/docs/unstable/cublas__interface_8hpp_source.html +++ b/docs/unstable/cublas__interface_8hpp_source.html @@ -140,7 +140,7 @@
27#include "../../exceptions.hpp"
28#endif // NDA_HAVE_MAGMA
29
-
30namespace nda::blas::device {
+
30namespace nda::blas::device {
31
32 void axpy(int N, double alpha, const double *x, int incx, double *Y, int incy);
33 void axpy(int N, dcomplex alpha, const dcomplex *x, int incx, dcomplex *Y, int incy);
@@ -197,6 +197,7 @@
84} // namespace nda::blas::device
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define AS_STRING(...)
Definition macros.hpp:31
diff --git a/docs/unstable/cusolver__interface_8cpp_source.html b/docs/unstable/cusolver__interface_8cpp_source.html index ebd659f26..4182a2059 100644 --- a/docs/unstable/cusolver__interface_8cpp_source.html +++ b/docs/unstable/cusolver__interface_8cpp_source.html @@ -146,7 +146,7 @@
33
34#include <string>
35
-
36namespace nda::lapack::device {
+
36namespace nda::lapack::device {
37
38 // Local function to get unique CuSolver handle.
39 inline cusolverDnHandle_t &get_handle() {
@@ -229,6 +229,7 @@
116} // namespace nda::lapack::device
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define AS_STRING(...)
Definition macros.hpp:31
diff --git a/docs/unstable/cusolver__interface_8hpp_source.html b/docs/unstable/cusolver__interface_8hpp_source.html index c31ec5b53..c96bae98d 100644 --- a/docs/unstable/cusolver__interface_8hpp_source.html +++ b/docs/unstable/cusolver__interface_8hpp_source.html @@ -136,7 +136,7 @@
23
24#include "../../blas/tools.hpp"
25
-
26namespace nda::lapack::device {
+
26namespace nda::lapack::device {
27
28 void gesvd(char JOBU, char JOBVT, int M, int N, double *A, int LDA, double *S, double *U, int LDU, double *VT, int LDVT, double *WORK, int LWORK,
29 double *RWORK, int &INFO);
@@ -155,6 +155,7 @@
42} // namespace nda::lapack::device
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define AS_STRING(...)
Definition macros.hpp:31
diff --git a/docs/unstable/declarations_8hpp_source.html b/docs/unstable/declarations_8hpp_source.html index 6242dc08e..a56cecaa4 100644 --- a/docs/unstable/declarations_8hpp_source.html +++ b/docs/unstable/declarations_8hpp_source.html @@ -149,7 +149,7 @@
36#include <stdexcept>
37#include <type_traits>
38
-
39namespace nda {
+
39namespace nda {
40
41 /// @cond
42 // Forward declarations.
@@ -160,8 +160,8 @@
47 class basic_array;
48
49 template <typename ValueType, int Rank, typename Layout, char Algebra = 'A',
-
50 typename AccessorPolicy = nda::default_accessor, //, nda::no_alias_accessor, //,
-
51 typename OwningPolicy = nda::borrowed<>>
+
50 typename AccessorPolicy = nda::default_accessor, //, nda::no_alias_accessor, //,
+
51 typename OwningPolicy = nda::borrowed<>>
52 class basic_array_view;
53
54 template <char OP, Array A>
@@ -314,9 +314,9 @@
199 */
200 template <typename ValueType, int N0, int... Ns>
201 using stack_array =
-
202 nda::basic_array<ValueType, 1 + sizeof...(Ns),
-
203 nda::basic_layout<nda::static_extents(N0, Ns...), nda::C_stride_order<1 + sizeof...(Ns)>, nda::layout_prop_e::contiguous>, 'A',
-
204 nda::stack<N0 *(Ns *... * 1)>>;
+
202 nda::basic_array<ValueType, 1 + sizeof...(Ns),
+
203 nda::basic_layout<nda::static_extents(N0, Ns...), nda::C_stride_order<1 + sizeof...(Ns)>, nda::layout_prop_e::contiguous>, 'A',
+
204 nda::stack<N0 *(Ns *... * 1)>>;
205
206 /**
207 * @brief Alias template of an nda::basic_array with rank 2, static extents, contiguous C layout, 'M' algebra and
@@ -328,8 +328,8 @@
213 */
214 template <typename ValueType, int N, int M>
215 using stack_matrix =
-
216 nda::basic_array<ValueType, 2, nda::basic_layout<nda::static_extents(N, M), nda::C_stride_order<2>, nda::layout_prop_e::contiguous>, 'M',
-
217 nda::stack<static_cast<size_t>(N *M)>>;
+
216 nda::basic_array<ValueType, 2, nda::basic_layout<nda::static_extents(N, M), nda::C_stride_order<2>, nda::layout_prop_e::contiguous>, 'M',
+
217 nda::stack<static_cast<size_t>(N *M)>>;
218
219 /**
220 * @brief Alias template of an nda::basic_array with rank 1, static extents, contiguous C layout, 'V' algebra and
@@ -340,8 +340,8 @@
225 */
226 template <typename ValueType, int N>
227 using stack_vector =
-
228 nda::basic_array<ValueType, 1, nda::basic_layout<nda::static_extents(N), nda::C_stride_order<1>, nda::layout_prop_e::contiguous>, 'V',
-
229 nda::stack<N>>;
+
228 nda::basic_array<ValueType, 1, nda::basic_layout<nda::static_extents(N), nda::C_stride_order<1>, nda::layout_prop_e::contiguous>, 'V',
+
229 nda::stack<N>>;
230
231 /**
232 * @brief Similar to nda::array except the memory is stored on the device.
@@ -663,6 +663,7 @@
Layout that specifies how to map multi-dimensional indices to a linear/flat index.
Definition idx_map.hpp:103
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/det__and__inverse_8hpp_source.html b/docs/unstable/det__and__inverse_8hpp_source.html index 32e37a535..1a64d4283 100644 --- a/docs/unstable/det__and__inverse_8hpp_source.html +++ b/docs/unstable/det__and__inverse_8hpp_source.html @@ -152,7 +152,7 @@
39#include <type_traits>
40#include <utility>
41
-
42namespace nda {
+
42namespace nda {
43
44 /**
45 * @addtogroup linalg_tools
@@ -438,7 +438,7 @@
307
308} // namespace nda
309
-
310namespace nda::clef {
+
310namespace nda::clef {
311
312 /**
313 * @ingroup linalg_tools
@@ -449,6 +449,7 @@
318} // namespace nda::clef
A generic multi-dimensional array.
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define CLEF_MAKE_FNT_LAZY(name)
Macro to make any function lazy, i.e. accept lazy arguments and return a function call expression nod...
auto determinant_in_place(M &m)
Compute the determinant of a square matrix/view.
void inverse3_in_place(M &&m)
Compute the inverse of a 3-by-3 matrix.
diff --git a/docs/unstable/device_8hpp_source.html b/docs/unstable/device_8hpp_source.html index 1351c1469..766feffd8 100644 --- a/docs/unstable/device_8hpp_source.html +++ b/docs/unstable/device_8hpp_source.html @@ -145,7 +145,7 @@
32#include <string>
33#endif // NDA_HAVE_CUDA
34
-
35namespace nda {
+
35namespace nda {
36
37 /**
38 * @addtogroup mem_utils
@@ -166,10 +166,10 @@
51#ifdef NDA_HAVE_CUDA
52
53 /// Constexpr variable that is true if the project is configured with GPU support.
-
54 static constexpr bool have_device = true;
+
54 static constexpr bool have_device = true;
55
56 /// Constexpr variable that is true if the project is configured with CUDA support.
-
57 static constexpr bool have_cuda = true;
+
57 static constexpr bool have_cuda = true;
58
59 /**
60 * @brief Check if a CUDA function call was successful and throw an exception if not.
@@ -177,12 +177,12 @@
62 * @param success Return value of a CUDA function call.
63 * @param message An optional message to include in the exception.
64 */
-
65 inline void device_error_check(cudaError_t success, std::string message = "") {
-
66 if (success != cudaSuccess) {
-
67 NDA_RUNTIME_ERROR << "Cuda runtime error: " << std::to_string(success) << "\n"
-
68 << " message: " << message << "\n"
-
69 << " cudaGetErrorName: " << std::string(cudaGetErrorName(success)) << "\n"
-
70 << " cudaGetErrorString: " << std::string(cudaGetErrorString(success)) << "\n";
+
65 inline void device_error_check(cudaError_t success, std::string message = "") {
+
66 if (success != cudaSuccess) {
+
67 NDA_RUNTIME_ERROR << "Cuda runtime error: " << std::to_string(success) << "\n"
+
68 << " message: " << message << "\n"
+
69 << " cudaGetErrorName: " << std::string(cudaGetErrorName(success)) << "\n"
+
70 << " cudaGetErrorString: " << std::string(cudaGetErrorString(success)) << "\n";
71 }
72 }
73
@@ -198,12 +198,12 @@
83 * @param op Character to be mapped to a `cublasOperation_t`.
84 * @return The corresponding `cublasOperation_t`.
85 */
-
86 inline cublasOperation_t get_cublas_op(char op) {
-
87 switch (op) {
-
88 case 'N': return CUBLAS_OP_N;
-
89 case 'T': return CUBLAS_OP_T;
-
90 case 'C': return CUBLAS_OP_C;
-
91 default: std::terminate(); return {};
+
86 inline cublasOperation_t get_cublas_op(char op) {
+
87 switch (op) {
+
88 case 'N': return CUBLAS_OP_N;
+
89 case 'T': return CUBLAS_OP_T;
+
90 case 'C': return CUBLAS_OP_C;
+
91 default: std::terminate(); return {};
92 }
93 }
94
@@ -213,7 +213,7 @@
98 * @param c `std::complex<double>` object.
99 * @return Equivalent `cuDoubleComplex` object.
100 */
-
101 inline auto cucplx(std::complex<double> c) { return cuDoubleComplex{c.real(), c.imag()}; }
+
101 inline auto cucplx(std::complex<double> c) { return cuDoubleComplex{c.real(), c.imag()}; }
102
103 /**
104 * @brief Reinterpret a pointer to a `std::complex<double>` as a pointer to a `cuDoubleComplex`.
@@ -221,7 +221,7 @@
106 * @param c Pointer to a `std::complex<double>`.
107 * @return Pointer to a `cuDoubleComplex` at the same address.
108 */
-
109 inline auto *cucplx(std::complex<double> *c) { return reinterpret_cast<cuDoubleComplex *>(c); } // NOLINT
+
109 inline auto *cucplx(std::complex<double> *c) { return reinterpret_cast<cuDoubleComplex *>(c); } // NOLINT
110
111 /**
112 * @brief Reinterpret a pointer to a `const std::complex<double>` as a pointer to a `const cuDoubleComplex`.
@@ -229,7 +229,7 @@
114 * @param c Pointer to a `const std::complex<double>`.
115 * @return Pointer to a `const cuDoubleComplex` at the same address.
116 */
-
117 inline auto *cucplx(std::complex<double> const *c) { return reinterpret_cast<const cuDoubleComplex *>(c); } // NOLINT
+
117 inline auto *cucplx(std::complex<double> const *c) { return reinterpret_cast<const cuDoubleComplex *>(c); } // NOLINT
118
119 /**
120 * @brief Reinterpret a pointer to a pointer to a `std::complex<double>` as a pointer to a pointer to a
@@ -238,7 +238,7 @@
123 * @param c Pointer to a pointer to a `std::complex<double>`.
124 * @return Pointer to a pointer to a `cuDoubleComplex` at the same address.
125 */
-
126 inline auto **cucplx(std::complex<double> **c) { return reinterpret_cast<cuDoubleComplex **>(c); } // NOLINT
+
126 inline auto **cucplx(std::complex<double> **c) { return reinterpret_cast<cuDoubleComplex **>(c); } // NOLINT
127
128 /**
129 * @brief Reinterpret a pointer to a pointer to a `const std::complex<double>` as a pointer to a pointer to a
@@ -247,7 +247,7 @@
132 * @param c Pointer to a pointer to a `const std::complex<double>`.
133 * @return Pointer to a pointer to a `const cuDoubleComplex` at the same address.
134 */
-
135 inline auto **cucplx(std::complex<double> const **c) { return reinterpret_cast<const cuDoubleComplex **>(c); } // NOLINT
+
135 inline auto **cucplx(std::complex<double> const **c) { return reinterpret_cast<const cuDoubleComplex **>(c); } // NOLINT
136
137#else
138
@@ -272,6 +272,7 @@
runtime_error(runtime_error const &err) noexcept
Copy constructor to copy the contents of the error message accumulator.
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
double abs2(std::complex< double > z)
Get the squared absolute value of a std::complex<double>.
bool isnan(std::complex< double > const &z)
Check if a std::complex<double> is NaN.
double abs2(double x)
Get the squared absolute value of a double.
diff --git a/docs/unstable/doxygen_crawl.html b/docs/unstable/doxygen_crawl.html index 4d72fc648..5064043e1 100644 --- a/docs/unstable/doxygen_crawl.html +++ b/docs/unstable/doxygen_crawl.html @@ -507,12 +507,16 @@ + + + + @@ -529,7 +533,7 @@ - + @@ -1114,11 +1118,15 @@ + + + + @@ -1526,7 +1534,7 @@ - + diff --git a/docs/unstable/eigenelements_8hpp_source.html b/docs/unstable/eigenelements_8hpp_source.html index 14dbe2add..2621c4f9d 100644 --- a/docs/unstable/eigenelements_8hpp_source.html +++ b/docs/unstable/eigenelements_8hpp_source.html @@ -146,7 +146,7 @@
33#include <type_traits>
34#include <utility>
35
-
36namespace nda::linalg {
+
36namespace nda::linalg {
37
38 namespace detail {
39
@@ -260,6 +260,7 @@
141} // namespace nda::linalg
ValueType * data() noexcept
Get a pointer to the actual data (in general this is not the beginning of thr memory block for a view...
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto eigenvalues(M const &m)
Find the eigenvalues of a symmetric (real) or hermitian (complex) matrix/view.
auto eigenelements(M const &m)
Find the eigenvalues and eigenvectors of a symmetric (real) or hermitian (complex) matrix/view.
auto eigenvalues_in_place(M &m)
Find the eigenvalues of a symmetric (real) or hermitian (complex) matrix/view.
diff --git a/docs/unstable/eval_8hpp_source.html b/docs/unstable/eval_8hpp_source.html index 6bfcfc3fd..0f27ab945 100644 --- a/docs/unstable/eval_8hpp_source.html +++ b/docs/unstable/eval_8hpp_source.html @@ -145,7 +145,7 @@
32#include <type_traits>
33#include <utility>
34
-
35namespace nda::clef {
+
35namespace nda::clef {
36
37 /**
38 * @addtogroup clef_eval
@@ -463,6 +463,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/exceptions_8hpp_source.html b/docs/unstable/exceptions_8hpp_source.html index 1cba6ea60..41245af3e 100644 --- a/docs/unstable/exceptions_8hpp_source.html +++ b/docs/unstable/exceptions_8hpp_source.html @@ -150,7 +150,7 @@
37#define NDA_ASSERT2(X, ...)
38 if (!(X)) NDA_RUNTIME_ERROR << AS_STRING(X) << "\n" << __VA_ARGS__;
39
-
40namespace nda {
+
40namespace nda {
41
42 /**
43 * @ingroup utils_std
@@ -228,6 +228,7 @@
runtime_error(runtime_error const &err) noexcept
Copy constructor to copy the contents of the error message accumulator.
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
double abs2(std::complex< double > z)
Get the squared absolute value of a std::complex<double>.
bool isnan(std::complex< double > const &z)
Check if a std::complex<double> is NaN.
double abs2(double x)
Get the squared absolute value of a double.
diff --git a/docs/unstable/expression_8hpp_source.html b/docs/unstable/expression_8hpp_source.html index df7c7b9a6..aeda8827c 100644 --- a/docs/unstable/expression_8hpp_source.html +++ b/docs/unstable/expression_8hpp_source.html @@ -139,7 +139,7 @@
26#include <tuple>
27#include <utility>
28
-
29namespace nda::clef {
+
29namespace nda::clef {
30
31 namespace tags {
32
@@ -402,6 +402,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/for__each_8hpp_source.html b/docs/unstable/for__each_8hpp_source.html index bce3b9ea6..95ab233f6 100644 --- a/docs/unstable/for__each_8hpp_source.html +++ b/docs/unstable/for__each_8hpp_source.html @@ -144,7 +144,7 @@
31#include <cstdint>
32#include <utility>
33
-
34namespace nda {
+
34namespace nda {
35
36 /**
37 * @addtogroup layout_utils
@@ -220,7 +220,7 @@
107 template <uint64_t StaticExtents, uint64_t StrideOrder, typename F, auto R, std::integral Int = long>
108 FORCEINLINE void for_each_static(std::array<Int, R> const &shape, F &&f) { // NOLINT (we do not want to forward here)
-
109 auto idxs = nda::stdutil::make_initialized_array<R>(0l);
+
109 auto idxs = nda::stdutil::make_initialized_array<R>(0l);
110 detail::for_each_static_impl<0, StaticExtents, StrideOrder>(shape, idxs, f);
111 }
@@ -243,7 +243,7 @@
128 template <typename F, auto R, std::integral Int = long>
129 FORCEINLINE void for_each(std::array<Int, R> const &shape, F &&f) { // NOLINT (we do not want to forward here)
-
130 auto idxs = nda::stdutil::make_initialized_array<R>(0l);
+
130 auto idxs = nda::stdutil::make_initialized_array<R>(0l);
131 detail::for_each_static_impl<0, 0, 0>(shape, idxs, f);
132 }
@@ -502,6 +502,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -604,25 +605,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/function_8hpp_source.html b/docs/unstable/function_8hpp_source.html index 3827c5323..aa766de31 100644 --- a/docs/unstable/function_8hpp_source.html +++ b/docs/unstable/function_8hpp_source.html @@ -143,7 +143,7 @@
30#include <type_traits>
31#include <utility>
32
-
33namespace nda::clef {
+
33namespace nda::clef {
34
35 /**
36 * @addtogroup clef_expr
@@ -414,6 +414,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/gather_8hpp_source.html b/docs/unstable/gather_8hpp_source.html index fcfacd394..1e5fefea7 100644 --- a/docs/unstable/gather_8hpp_source.html +++ b/docs/unstable/gather_8hpp_source.html @@ -228,7 +228,7 @@
111
112 // get target shape and resize or check the target array
113 auto dims = shape();
-
114 if (all || (comm.rank() == root)) nda::resize_or_check_if_view(target, dims);
+
114 if (all || (comm.rank() == root)) nda::resize_or_check_if_view(target, dims);
115
116 // gather receive counts and memory displacements
117 auto recvcounts = std::vector<int>(comm.size());
@@ -253,7 +253,7 @@
135};
136
-
137namespace nda {
+
137namespace nda {
138
139 /**
140 * @ingroup av_mpi
@@ -296,6 +296,7 @@
175
176} // namespace nda
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
ArrayInitializer< std::remove_reference_t< A > > auto mpi_gather(A &&a, mpi::communicator comm={}, int root=0, bool all=false)
Implementation of an MPI gather for nda::basic_array or nda::basic_array_view types.
Definition gather.hpp:168
const int root
MPI root process.
Definition gather.hpp:64
auto shape() const
Compute the shape of the target array.
Definition gather.hpp:80
diff --git a/docs/unstable/gelss_8hpp_source.html b/docs/unstable/gelss_8hpp_source.html index 0f4704c5c..afe8ab137 100644 --- a/docs/unstable/gelss_8hpp_source.html +++ b/docs/unstable/gelss_8hpp_source.html @@ -147,7 +147,7 @@
34#include <cmath>
35#include <complex>
36
-
37namespace nda::lapack {
+
37namespace nda::lapack {
38
39 /**
40 * @ingroup linalg_lapack
@@ -225,6 +225,7 @@
110} // namespace nda::lapack
ValueType * data() noexcept
Get a pointer to the actual data (in general this is not the beginning of thr memory block for a view...
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int gelss(A &&a, B &&b, S &&s, double rcond, int &rank)
Interface to the LAPACK gelss routine.
Definition gelss.hpp:76
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/gelss__worker_8hpp_source.html b/docs/unstable/gelss__worker_8hpp_source.html index 17e49a7b6..086a8291d 100644 --- a/docs/unstable/gelss__worker_8hpp_source.html +++ b/docs/unstable/gelss__worker_8hpp_source.html @@ -154,7 +154,7 @@
41#include <utility>
42#include <vector>
43
-
44namespace nda::lapack {
+
44namespace nda::lapack {
45
46 /**
47 * @addtogroup linalg_lapack
@@ -381,6 +381,7 @@
std::pair< matrix< T >, double > operator()(matrix_const_view< T > B, std::optional< long >={}) const
Solve the least-square problem for a given right hand side matrix .
#define NDA_RUNTIME_ERROR
#define NDA_ASSERT2(X,...)
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
matrix< get_value_t< A > > vstack(A const &a, B const &b)
Stack two 2-dimensional arrays/views vertically.
decltype(auto) conj(A &&a)
Lazy, coefficient-wise complex conjugate function for nda::Array types.
Array auto operator+(L &&l, R &&r)
Addition operator for two nda::Array types.
diff --git a/docs/unstable/gemm_8hpp_source.html b/docs/unstable/gemm_8hpp_source.html index 3c9f80fc6..fadafc69b 100644 --- a/docs/unstable/gemm_8hpp_source.html +++ b/docs/unstable/gemm_8hpp_source.html @@ -149,7 +149,7 @@
36#include <tuple>
37#include <utility>
38
-
39namespace nda::blas {
+
39namespace nda::blas {
40
41 /**
42 * @addtogroup linalg_blas
@@ -265,6 +265,7 @@
148 /** @} */
149
150} // namespace nda::blas
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void gemm_generic(typename A::value_type alpha, A const &a, B const &b, typename A::value_type beta, C &&c)
Generic nda::blas::gemm implementation for types not supported by BLAS/LAPACK.
Definition gemm.hpp:59
void gemm(get_value_t< A > alpha, A const &a, B const &b, get_value_t< A > beta, C &&c)
Interface to the BLAS gemm routine.
Definition gemm.hpp:101
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
diff --git a/docs/unstable/gemm__batch_8hpp_source.html b/docs/unstable/gemm__batch_8hpp_source.html index cbc1980bc..dc94e5b8e 100644 --- a/docs/unstable/gemm__batch_8hpp_source.html +++ b/docs/unstable/gemm__batch_8hpp_source.html @@ -153,7 +153,7 @@
40#include <type_traits>
41#include <vector>
42
-
43namespace nda::blas {
+
43namespace nda::blas {
44
45 /**
46 * @addtogroup linalg_blas
@@ -224,7 +224,7 @@
110 [&v, &to_mat](auto &z) { return (VBATCH or z.shape() == v[0].shape()) and to_mat(z).indexmap().min_stride() == 1; }));
111 using value_t = get_value_t<typename V::value_type>;
112 using ptr_t = std::conditional_t<std::is_const_v<V>, value_t const *, value_t *>;
-
113 auto v_ptrs = nda::vector<ptr_t, heap<vec_adr_spc>>(v.size());
+
113 auto v_ptrs = nda::vector<ptr_t, heap<vec_adr_spc>>(v.size());
114 std::transform(v.begin(), v.end(), v_ptrs.begin(), [&to_mat](auto &z) { return to_mat(z).data(); });
115 return v_ptrs;
116 };
@@ -241,7 +241,7 @@
127 // matrices have different sizes
128 if constexpr (VBATCH) {
129 // create vectors of size 'batch_count + 1' as required by Magma
-
130 nda::vector<int, heap<vec_adr_spc>> vm(batch_count + 1), vk(batch_count + 1), vn(batch_count + 1), vlda(batch_count + 1),
+
130 nda::vector<int, heap<vec_adr_spc>> vm(batch_count + 1), vk(batch_count + 1), vn(batch_count + 1), vlda(batch_count + 1),
131 vldb(batch_count + 1), vldc(batch_count + 1);
132
133 for (auto i : range(batch_count)) {
@@ -357,7 +357,7 @@
239 "Error in nda::blas::gemm_batch_strided: Incompatible memory address spaces");
240
241 // runtime checks
-
242 auto _ = nda::range::all;
+
242 auto _ = nda::range::all;
243 auto a0 = arr_a(0, _, _);
244 auto b0 = arr_b(0, _, _);
245 auto c0 = c(0, _, _);
@@ -398,6 +398,7 @@
279 /** @} */
280
281} // namespace nda::blas
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void gemm_batch_strided(get_value_t< A > alpha, A const &a, B const &b, get_value_t< A > beta, C &&c)
Implements a strided batched version of nda::blas::gemm taking 3-dimensional arrays as arguments.
void gemm_vbatch(get_value_t< A > alpha, std::vector< A > const &va, std::vector< B > const &vb, get_value_t< A > beta, std::vector< C > &vc)
Wrapper of nda::blas::gemm_batch that allows variable sized matrices.
void gemm_batch(get_value_t< A > alpha, std::vector< A > const &va, std::vector< B > const &vb, get_value_t< A > beta, std::vector< C > &vc)
Implements a batched version of nda::blas::gemm taking vectors of matrices as arguments.
diff --git a/docs/unstable/gemv_8hpp_source.html b/docs/unstable/gemv_8hpp_source.html index 75758a40b..c63ed999c 100644 --- a/docs/unstable/gemv_8hpp_source.html +++ b/docs/unstable/gemv_8hpp_source.html @@ -147,7 +147,7 @@
34
35#include <tuple>
36
-
37namespace nda::blas {
+
37namespace nda::blas {
38
39 /**
40 * @addtogroup linalg_blas
@@ -244,6 +244,7 @@
127 /** @} */
128
129} // namespace nda::blas
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void gemv_generic(get_value_t< A > alpha, A const &a, X const &x, get_value_t< A > beta, Y &&y)
Generic nda::blas::gemv implementation for types not supported by BLAS/LAPACK.
Definition gemv.hpp:57
void gemv(get_value_t< A > alpha, A const &a, X const &x, get_value_t< A > beta, Y &&y)
Interface to the BLAS gemv routine.
Definition gemv.hpp:89
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
diff --git a/docs/unstable/geqp3_8hpp_source.html b/docs/unstable/geqp3_8hpp_source.html index e87ca68c7..40eb49c7e 100644 --- a/docs/unstable/geqp3_8hpp_source.html +++ b/docs/unstable/geqp3_8hpp_source.html @@ -148,7 +148,7 @@
35#include <complex>
36#include <type_traits>
37
-
38namespace nda::lapack {
+
38namespace nda::lapack {
39
40 /**
41 * @ingroup linalg_lapack
@@ -200,7 +200,7 @@
86 int bufferSize = static_cast<int>(std::ceil(std::real(bufferSize_T)));
87
88 // allocate work buffer and perform actual library call
-
89 nda::array<value_type, 1> work(bufferSize);
+
89 nda::array<value_type, 1> work(bufferSize);
90 lapack::f77::geqp3(m, n, a.data(), get_ld(a), jpvt.data(), tau.data(), work.data(), bufferSize, rwork.data(), info);
91 jpvt -= 1; // Shift to 0-based indexing
92
@@ -212,6 +212,7 @@
97} // namespace nda::lapack
ValueType * data() noexcept
Get a pointer to the actual data (in general this is not the beginning of thr memory block for a view...
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int geqp3(A &&a, JPVT &&jpvt, TAU &&tau)
Interface to the LAPACK geqp3 routine.
Definition geqp3.hpp:67
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/ger_8hpp_source.html b/docs/unstable/ger_8hpp_source.html index 31ad247d9..21b597af4 100644 --- a/docs/unstable/ger_8hpp_source.html +++ b/docs/unstable/ger_8hpp_source.html @@ -151,7 +151,7 @@
38
39#include <array>
40
-
41namespace nda::blas {
+
41namespace nda::blas {
42
43 /**
44 * @addtogroup linalg_blas
@@ -247,6 +247,7 @@
130
131} // namespace nda::blas
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto outer_product(A const &a, B const &b)
Calculate the outer product of two contiguous arrays/views/scalars.
Definition ger.hpp:111
void ger(get_value_t< X > alpha, X const &x, Y const &y, M &&m)
Interface to the BLAS ger routine.
Definition ger.hpp:68
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
diff --git a/docs/unstable/gesvd_8hpp_source.html b/docs/unstable/gesvd_8hpp_source.html index cf3d2e622..2f4590dad 100644 --- a/docs/unstable/gesvd_8hpp_source.html +++ b/docs/unstable/gesvd_8hpp_source.html @@ -153,7 +153,7 @@
40#include <complex>
41#include <utility>
42
-
43namespace nda::lapack {
+
43namespace nda::lapack {
44
45 /**
46 * @ingroup linalg_lapack
@@ -221,7 +221,7 @@
107 int bufferSize = static_cast<int>(std::ceil(std::real(bufferSize_T)));
108
109 // allocate work buffer and perform actual library call
-
110 nda::array<value_type, 1, C_layout, heap<mem::get_addr_space<A>>> work(bufferSize);
+
110 nda::array<value_type, 1, C_layout, heap<mem::get_addr_space<A>>> work(bufferSize);
111 gesvd_call('A', 'A', a.extent(0), a.extent(1), a.data(), get_ld(a), s.data(), u.data(), get_ld(u), vt.data(), get_ld(vt), work.data(), bufferSize,
112 rwork.data(), info);
113
@@ -232,6 +232,7 @@
117
118} // namespace nda::lapack
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int gesvd(A &&a, S &&s, U &&u, VT &&vt)
Interface to the LAPACK gesvd routine.
Definition gesvd.hpp:75
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/getrf_8hpp_source.html b/docs/unstable/getrf_8hpp_source.html index 625114ba1..5f7c6282a 100644 --- a/docs/unstable/getrf_8hpp_source.html +++ b/docs/unstable/getrf_8hpp_source.html @@ -143,7 +143,7 @@
30#include <algorithm>
31#include <type_traits>
32
-
33namespace nda::lapack {
+
33namespace nda::lapack {
34
35 /**
36 * @ingroup linalg_lapack
@@ -204,6 +204,7 @@
90
91} // namespace nda::lapack
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int getrf(A &&a, IPIV &&ipiv)
Interface to the LAPACK getrf routine.
Definition getrf.hpp:62
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/getri_8hpp_source.html b/docs/unstable/getri_8hpp_source.html index 7e256defd..2497d5337 100644 --- a/docs/unstable/getri_8hpp_source.html +++ b/docs/unstable/getri_8hpp_source.html @@ -147,7 +147,7 @@
34#include <complex>
35#include <type_traits>
36
-
37namespace nda::lapack {
+
37namespace nda::lapack {
38
39 /**
40 * @ingroup linalg_lapack
@@ -210,6 +210,7 @@
95
96} // namespace nda::lapack
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int getri(A &&a, IPIV const &ipiv)
Interface to the LAPACK getri routine.
Definition getri.hpp:59
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/getrs_8hpp_source.html b/docs/unstable/getrs_8hpp_source.html index 9a3ddb21f..18bb0329b 100644 --- a/docs/unstable/getrs_8hpp_source.html +++ b/docs/unstable/getrs_8hpp_source.html @@ -147,7 +147,7 @@
34#include <algorithm>
35#include <type_traits>
36
-
37namespace nda::lapack {
+
37namespace nda::lapack {
38
39 /**
40 * @ingroup linalg_lapack
@@ -204,6 +204,7 @@
90
91} // namespace nda::lapack
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int getrs(A const &a, B &&b, IPIV const &ipiv)
Interface to the LAPACK getrs routine.
Definition getrs.hpp:64
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/group__av__algs.html b/docs/unstable/group__av__algs.html index 7ed90bf16..9a554e3e3 100644 --- a/docs/unstable/group__av__algs.html +++ b/docs/unstable/group__av__algs.html @@ -141,6 +141,22 @@ auto nda::fold (F f, A const &a, R r)  Perform a fold operation on the given nda::Array object.
  +template<Array A, Array B>
+requires (nda::get_rank<A> == nda::get_rank<B>) +constexpr auto nda::hadamard (A &&a, B &&b) + Hadamard product of two nda::Array objects.
+  +constexpr auto nda::hadamard (nda::Scalar auto a, nda::Scalar auto b) + Hadamard product of two arithmetic types.
+  +template<typename T , typename U , size_t R> +constexpr auto nda::hadamard (std::array< T, R > const &a, std::array< U, R > const &b) + Hadamard product of two std::array objects.
+  +template<typename T , typename U > +constexpr auto nda::hadamard (std::vector< T > const &a, std::vector< U > const &b) + Hadamard product of two std::vector objects.
+  template<Array A> auto nda::max_element (A const &a)  Find the maximum element of an array.
@@ -186,7 +202,7 @@

auto greater0 = nda::map([](auto x) { return x > 0.0; })(A);
auto res = nda::all(greater0);
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
-
bool all(A const &a)
Do all elements of the array evaluate to true?
+
bool all(A const &a)
Do all elements of the array evaluate to true?
mapped< F > map(F f)
Create a lazy function call expression on arrays/views.
Definition map.hpp:199
Template Parameters
@@ -202,7 +218,7 @@

Returns
True if all elements of the array evaluate to true, false otherwise.
-

Definition at line 113 of file algorithms.hpp.

+

Definition at line 118 of file algorithms.hpp.

@@ -230,7 +246,7 @@

auto greater05 = nda::map([](auto x) { return x > 0.5; })(A);
auto res = nda::any(greater05);
-
bool any(A const &a)
Does any of the elements of the array evaluate to true?
+
bool any(A const &a)
Does any of the elements of the array evaluate to true?
Template Parameters

@@ -245,7 +261,7 @@

Returns
True if at least one element of the array evaluates to true, false otherwise.
-

Definition at line 92 of file algorithms.hpp.

+

Definition at line 97 of file algorithms.hpp.

@@ -299,7 +315,215 @@

Returns
Result of the fold operation.
-

Definition at line 63 of file algorithms.hpp.

+

Definition at line 68 of file algorithms.hpp.

+ + + + +

◆ hadamard() [1/4]

+ +
+
+
+template<Array A, Array B>
+requires (nda::get_rank<A> == nda::get_rank<B>)
+

Anda::Array type.
+ + + + +
+ + + + + + + + + + + +
auto nda::hadamard (A && a,
B && b )
+
+nodiscardconstexpr
+
+ +

#include <nda/algorithms.hpp>

+ +

Hadamard product of two nda::Array objects.

+
Template Parameters
+ + + +
Anda::Array type.
Bnda::Array type.
+
+
+
Parameters
+ + + +
anda::Array object.
bnda::Array object.
+
+
+
Returns
A lazy nda::expr_call object representing the elementwise product of the two input objects.
+ +

Definition at line 218 of file algorithms.hpp.

+ +
+ + +

◆ hadamard() [2/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
auto nda::hadamard (nda::Scalar auto a,
nda::Scalar auto b )
+
+constexpr
+
+ +

#include <nda/algorithms.hpp>

+ +

Hadamard product of two arithmetic types.

+
Template Parameters
+ + + +
Tnda::Scalar type of the first input.
Unda::Scalar type of the second input.
+
+
+
Parameters
+ + + +
aFirst input.
bSecond input.
+
+
+
Returns
Product of the two inputs.
+ +

Definition at line 265 of file algorithms.hpp.

+ +
+
+ +

◆ hadamard() [3/4]

+ +
+
+
+template<typename T , typename U , size_t R>
+ + + + + +
+ + + + + + + + + + + +
auto nda::hadamard (std::array< T, R > const & a,
std::array< U, R > const & b )
+
+nodiscardconstexpr
+
+ +

#include <nda/algorithms.hpp>

+ +

Hadamard product of two std::array objects.

+
Template Parameters
+ + + + +
TValue type of the first array.
UValue type of the second array.
RSize of the arrays.
+
+
+
Parameters
+ + + +
astd::array object.
bstd::array object.
+
+
+
Returns
std::array containing the elementwise product of the two input arrays.
+ +

Definition at line 233 of file algorithms.hpp.

+ +
+
+ +

◆ hadamard() [4/4]

+ +
+
+
+template<typename T , typename U >
+ + + + + +
+ + + + + + + + + + + +
auto nda::hadamard (std::vector< T > const & a,
std::vector< U > const & b )
+
+nodiscardconstexpr
+
+ +

#include <nda/algorithms.hpp>

+ +

Hadamard product of two std::vector objects.

+
Template Parameters
+ + + +
TValue type of the first input vector.
UValue type of the second input vector.
+
+
+
Parameters
+ + + +
astd::vector object.
bstd::vector object.
+
+
+
Returns
std::vector containing the elementwise product of the two input vectors.
+ +

Definition at line 247 of file algorithms.hpp.

@@ -338,7 +562,7 @@

Returns
Maximum element of the array.

-

Definition at line 128 of file algorithms.hpp.

+

Definition at line 133 of file algorithms.hpp.

@@ -377,7 +601,7 @@

Returns
Minimum element of the array.
-

Definition at line 147 of file algorithms.hpp.

+

Definition at line 152 of file algorithms.hpp.

@@ -416,7 +640,7 @@

Returns
Product of all elements.
-

Definition at line 196 of file algorithms.hpp.

+

Definition at line 201 of file algorithms.hpp.

@@ -455,7 +679,7 @@

Returns
Sum of all elements.
-

Definition at line 182 of file algorithms.hpp.

+

Definition at line 187 of file algorithms.hpp.

diff --git a/docs/unstable/group__av__math.html b/docs/unstable/group__av__math.html index d2fa95dde..da488d6e9 100644 --- a/docs/unstable/group__av__math.html +++ b/docs/unstable/group__av__math.html @@ -865,7 +865,7 @@

Returns
Frobenius norm of the array/matrix.
-

Definition at line 165 of file algorithms.hpp.

+

Definition at line 170 of file algorithms.hpp.

diff --git a/docs/unstable/group__indices_8hpp_source.html b/docs/unstable/group__indices_8hpp_source.html index 73177a6ba..8693c24e3 100644 --- a/docs/unstable/group__indices_8hpp_source.html +++ b/docs/unstable/group__indices_8hpp_source.html @@ -146,7 +146,7 @@
33#include <numeric>
34#include <stdexcept>
35
-
36namespace nda {
+
36namespace nda {
37
38 namespace detail {
39
@@ -584,6 +584,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto reshape(A &&a, Ints... is)
Reshape an nda::basic_array or nda::basic_array_view.
auto transposed_view(A &&a)
Transpose two indices/dimensions of an nda::basic_array or nda::basic_array_view.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
@@ -717,25 +718,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/group__utils__std.html b/docs/unstable/group__utils__std.html index b36b202c1..b945d616d 100644 --- a/docs/unstable/group__utils__std.html +++ b/docs/unstable/group__utils__std.html @@ -167,10 +167,10 @@ constexpr std::array< T, R - N > nda::stdutil::mpop (std::array< T, R > const &a)  Make a new std::array by popping the last N elements of an existing std::array.
  -template<typename T , size_t R> -constexpr std::array< T, R > std::operator* (std::array< T, R > const &lhs, std::array< T, R > const &rhs) - Multiply two std::array objects element-wise.
-  +template<typename T , typename U , size_t R> +constexpr auto std::operator* (std::array< T, R > const &lhs, std::array< U, R > const &rhs) + Multiply two std::array objects element-wise.
template<typename T , typename U >
requires (std::is_arithmetic_v<T> and std::is_arithmetic_v<U> and std::common_with<T, U> and !std::is_same_v<T, U>) @@ -334,7 +334,7 @@

Returns
A copy of the input array with the additional element appended at the end.
-

Definition at line 214 of file array.hpp.

+

Definition at line 217 of file array.hpp.

@@ -388,7 +388,7 @@

Returns
Sum of the element-wise products of the two arrays.
-

Definition at line 366 of file array.hpp.

+

Definition at line 369 of file array.hpp.

@@ -441,7 +441,7 @@

Returns
A copy of the input array with the additional element prepended at the front.
-

Definition at line 232 of file array.hpp.

+

Definition at line 235 of file array.hpp.

@@ -489,7 +489,7 @@

Returns
A copy of the input array with the first N elements removed.
-

Definition at line 278 of file array.hpp.

+

Definition at line 281 of file array.hpp.

@@ -536,7 +536,7 @@

Returns
A copy of the input array with the first element removed.
-

Definition at line 293 of file array.hpp.

+

Definition at line 296 of file array.hpp.

@@ -589,7 +589,7 @@

Returns
Array of size R1 + R2 containing the elements of the first array followed by the elements of the second array.
-

Definition at line 309 of file array.hpp.

+

Definition at line 312 of file array.hpp.

@@ -636,7 +636,7 @@

Returns
std::array initialized with the constant value.
-

Definition at line 165 of file array.hpp.

+

Definition at line 168 of file array.hpp.

@@ -684,7 +684,7 @@

Returns
std::array with the same values as the input array and value type T.
-

Definition at line 181 of file array.hpp.

+

Definition at line 184 of file array.hpp.

@@ -732,30 +732,30 @@

Returns
A copy of the input array with the last N elements removed.
-

Definition at line 249 of file array.hpp.

+

Definition at line 252 of file array.hpp.

- -

◆ operator*() [1/2]

+ +

◆ operator*() [1/2]

-template<typename T , size_t R>
+template<typename T , typename U , size_t R>
@@ -770,7 +770,8 @@

Template Parameters

- + - +
std::array< T, R > std::operator* auto std::operator* ( std::array< T, R > const & lhs,
std::array< T, R > const & rhs )std::array< U, R > const & rhs )
- + +
TValue type of the arrays.
TValue type of the first array.
UValue type of the second array.
RSize of the arrays.
@@ -784,7 +785,7 @@

Returns
std::array containing the element-wise product.
-

Definition at line 115 of file array.hpp.

+

Definition at line 116 of file array.hpp.

@@ -836,7 +837,7 @@

Returns
std::array containing the product of each element with the scalar.
-

Definition at line 146 of file array.hpp.

+

Definition at line 149 of file array.hpp.

@@ -935,7 +936,7 @@

Returns
std::array containing the element-wise negation.
-

Definition at line 130 of file array.hpp.

+

Definition at line 133 of file array.hpp.

@@ -1078,7 +1079,7 @@

Returns
A copy of the input array with the last element removed.
-

Definition at line 264 of file array.hpp.

+

Definition at line 267 of file array.hpp.

@@ -1125,7 +1126,7 @@

Returns
Product of all elements in the input array.
-

Definition at line 345 of file array.hpp.

+

Definition at line 348 of file array.hpp.

@@ -1172,7 +1173,7 @@

Returns
Sum of all the elements of the input array. If its size is zero, return a default constructed object of type T.
-

Definition at line 326 of file array.hpp.

+

Definition at line 329 of file array.hpp.

@@ -1258,7 +1259,7 @@

Returns
std::vector of the same size and with the same values as the input array.
-

Definition at line 197 of file array.hpp.

+

Definition at line 200 of file array.hpp.

diff --git a/docs/unstable/gtest__tools_8hpp_source.html b/docs/unstable/gtest__tools_8hpp_source.html index f8b98972c..92e15a4dc 100644 --- a/docs/unstable/gtest__tools_8hpp_source.html +++ b/docs/unstable/gtest__tools_8hpp_source.html @@ -220,8 +220,8 @@
103template <typename X, typename Y>
104::testing::AssertionResult array_are_close(X const &x, Y const &y, double precision = 1.e-10) {
-
105 nda::array<nda::get_value_t<X>, nda::get_rank<X>> x_reg = x;
-
106 nda::array<nda::get_value_t<X>, nda::get_rank<X>> y_reg = y;
+
105 nda::array<nda::get_value_t<X>, nda::get_rank<X>> x_reg = x;
+
106 nda::array<nda::get_value_t<X>, nda::get_rank<X>> y_reg = y;
107
108 // check their shapes
109 if (x_reg.shape() != y_reg.shape())
@@ -254,7 +254,7 @@
135template <typename X>
136::testing::AssertionResult array_almost_zero(X const &x) {
-
137 nda::array<nda::get_value_t<X>, nda::get_rank<X>> x_reg = x;
+
137 nda::array<nda::get_value_t<X>, nda::get_rank<X>> x_reg = x;
138
139 constexpr double eps = 1.e-10;
140 const auto max = max_element(abs(x_reg));
@@ -293,6 +293,7 @@
170#define EXPECT_CLOSE(X, Y) EXPECT_TRUE(generic_are_near(X, Y));
171
172/** @} */
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
::testing::AssertionResult array_almost_zero(X const &x)
Check that an array/view is close to zero, i.e. that its largest absolute element is less than 1e-10.
::testing::AssertionResult generic_are_near(X const &x, Y const &y)
Check that that two generic objects are close, i.e. that their absolute difference is less than 1e-12...
::testing::AssertionResult array_are_close(X const &x, Y const &y, double precision=1.e-10)
Check that two arrays/views are close, i.e. that they have the same shape and that the largest elemen...
diff --git a/docs/unstable/gtsv_8hpp_source.html b/docs/unstable/gtsv_8hpp_source.html index 70f720b48..0f6c6a6bc 100644 --- a/docs/unstable/gtsv_8hpp_source.html +++ b/docs/unstable/gtsv_8hpp_source.html @@ -140,7 +140,7 @@
27#include "../mem/address_space.hpp"
28#include "../traits.hpp"
29
-
30namespace nda::lapack {
+
30namespace nda::lapack {
31
32 /**
33 * @ingroup linalg_lapack
@@ -191,6 +191,7 @@
77
78} // namespace nda::lapack
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int gtsv(DL &&dl, D &&d, DU &&du, B &&b)
Interface to the LAPACK gtsv routine.
Definition gtsv.hpp:62
#define EXPECTS(X)
Definition macros.hpp:59
diff --git a/docs/unstable/h5_8hpp_source.html b/docs/unstable/h5_8hpp_source.html index 61bd62952..123a89227 100644 --- a/docs/unstable/h5_8hpp_source.html +++ b/docs/unstable/h5_8hpp_source.html @@ -153,7 +153,7 @@
40#include <utility>
41#include <vector>
42
-
43namespace nda {
+
43namespace nda {
44
45 /**
46 * @addtogroup av_hdf5
@@ -242,14 +242,14 @@
129 template <MemoryArray A>
130 void h5_write(h5::group g, std::string const &name, A const &a, bool compress = true) {
-
131 if constexpr (std::is_same_v<nda::get_value_t<A>, std::string>) {
+
131 if constexpr (std::is_same_v<nda::get_value_t<A>, std::string>) {
132 // 1-dimensional array/view of strings
133 h5_write(g, name, detail::to_char_buf(a));
134 } else if constexpr (is_scalar_v<typename A::value_type>) {
135 // n-dimensional array/view of scalars
136 // make a copy if the array/view is not in C-order and write the copy
137 if (not a.indexmap().is_stride_order_C()) {
-
138 using h5_arr_t = nda::array<get_value_t<A>, A::rank>;
+
138 using h5_arr_t = nda::array<get_value_t<A>, A::rank>;
139 auto a_c_layout = h5_arr_t{a.shape()};
140 a_c_layout() = a;
141 h5_write(g, name, a_c_layout, compress);
@@ -264,7 +264,7 @@
150 auto g2 = g.create_group(name);
151 h5_write(g2, "shape", a.shape());
152 auto make_name = [](auto i0, auto... is) { return (std::to_string(i0) + ... + ("_" + std::to_string(is))); };
-
153 nda::for_each(a.shape(), [&](auto... is) { h5_write(g2, make_name(is...), a(is...)); });
+
153 nda::for_each(a.shape(), [&](auto... is) { h5_write(g2, make_name(is...), a(is...)); });
154 }
155 }
@@ -331,18 +331,18 @@
215 if constexpr (std::integral<IR>) {
216 slab.offset[n] = ir;
217 slab.count[n] = 1;
-
218 } else if constexpr (std::is_same_v<IR, nda::ellipsis>) {
+
218 } else if constexpr (std::is_same_v<IR, nda::ellipsis>) {
219 for (auto k : range(n, n + ellipsis_width)) {
220 slab.count[k] = ds_shape[k];
221 shape[m++] = ds_shape[k];
222 }
-
223 } else if constexpr (std::is_same_v<IR, nda::range>) {
+
223 } else if constexpr (std::is_same_v<IR, nda::range>) {
224 slab.offset[n] = ir.first();
225 slab.stride[n] = ir.step();
226 slab.count[n] = ir.size();
227 shape[m++] = ir.size();
228 } else {
-
229 static_assert(std::is_same_v<IR, nda::range::all_t>);
+
229 static_assert(std::is_same_v<IR, nda::range::all_t>);
230 slab.count[n] = ds_shape[n];
231 shape[m++] = ds_shape[n];
232 }
@@ -380,7 +380,7 @@
262
263 // make a copy if the array/view is not in C-order and write the copy
264 if (not a.indexmap().is_stride_order_C()) {
-
265 using h5_arr_t = nda::array<get_value_t<A>, A::rank>;
+
265 using h5_arr_t = nda::array<get_value_t<A>, A::rank>;
266 auto a_c_layout = h5_arr_t{a.shape()};
267 a_c_layout() = a;
268 h5_write(g, name, a_c_layout, slice);
@@ -438,7 +438,7 @@
318 // n-dimensional array/view of scalars
319 // read into a temporary array if the array/view is not in C-order and copy the elements
320 if (not a.indexmap().is_stride_order_C()) {
-
321 using h5_arr_t = nda::array<typename A::value_type, A::rank>;
+
321 using h5_arr_t = nda::array<typename A::value_type, A::rank>;
322 auto a_c_layout = h5_arr_t{};
323 h5_read(g, name, a_c_layout, slice);
324 detail::resize_or_check(a, a_c_layout.shape());
@@ -494,7 +494,7 @@
374
375 // read element-by-element using the appropriate h5_read implementation
376 auto make_name = [](auto i0, auto... is) { return (std::to_string(i0) + ... + ("_" + std::to_string(is))); };
-
377 nda::for_each(a.shape(), [&](auto... is) { h5_read(g2, make_name(is...), a(is...)); });
+
377 nda::for_each(a.shape(), [&](auto... is) { h5_read(g2, make_name(is...), a(is...)); });
378 }
379 }
@@ -503,6 +503,7 @@
382
383} // namespace nda
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void h5_read(h5::group g, std::string const &name, A &a, std::tuple< IRs... > const &slice={})
Read into an nda::MemoryArray from an HDF5 file.
Definition h5.hpp:308
void h5_write(h5::group g, std::string const &name, A const &a, bool compress=true)
Write an nda::MemoryArray to a new dataset/subgroup into an HDF5 file.
Definition h5.hpp:130
void h5_write(h5::group g, std::string const &name, A const &a, std::tuple< IRs... > const &slice)
Write an nda::MemoryArray into a slice (hyperslab) of an existing dataset in an HDF5 file.
Definition h5.hpp:256
diff --git a/docs/unstable/handle_8hpp_source.html b/docs/unstable/handle_8hpp_source.html index d601e3a61..0a8f49757 100644 --- a/docs/unstable/handle_8hpp_source.html +++ b/docs/unstable/handle_8hpp_source.html @@ -147,7 +147,7 @@
34#include <type_traits>
35#include <utility>
36
-
37namespace nda::mem {
+
37namespace nda::mem {
38
39 /**
40 * @addtogroup mem_utils
@@ -243,7 +243,7 @@
127 if (data == nullptr) return;
128
129 // if needed, call the destructors of the objects stored
-
130 if constexpr (A::address_space == Host and !(std::is_trivial_v<T> or nda::is_complex_v<T>)) {
+
130 if constexpr (A::address_space == Host and !(std::is_trivial_v<T> or nda::is_complex_v<T>)) {
131 for (size_t i = 0; i < size; ++i) data[i].~T();
132 }
133
@@ -1379,6 +1379,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -1478,25 +1479,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/idx__map_8hpp_source.html b/docs/unstable/idx__map_8hpp_source.html index cf9aeb570..7a38b83d5 100644 --- a/docs/unstable/idx__map_8hpp_source.html +++ b/docs/unstable/idx__map_8hpp_source.html @@ -154,7 +154,7 @@
41#include <utility>
42#include <vector>
43
-
44namespace nda {
+
44namespace nda {
45
46 /**
47 * @addtogroup layout_idx
@@ -984,6 +984,7 @@
idx_map(std::array< long, R > const &)
Construct a new map with a shape of a different rank.
Definition idx_map.hpp:435
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/index.html b/docs/unstable/index.html index e8123869d..90969ae4d 100644 --- a/docs/unstable/index.html +++ b/docs/unstable/index.html @@ -179,9 +179,9 @@

}
}
A generic multi-dimensional array.
-
auto max_element(A const &a)
Find the maximum element of an array.
-
auto min_element(A const &a)
Find the minimum element of an array.
-
auto sum(A const &a)
Sum all the elements of an nda::Array object.
+
auto max_element(A const &a)
Find the maximum element of an array.
+
auto min_element(A const &a)
Find the minimum element of an array.
+
auto sum(A const &a)
Sum all the elements of an nda::Array object.
decltype(auto) make_regular(A &&a)
Make a given object regular.
Provides HDF5 support for the nda library.
Includes all relevant headers for the core nda library.
diff --git a/docs/unstable/io_8hpp_source.html b/docs/unstable/io_8hpp_source.html index 52ea1407f..cf2409276 100644 --- a/docs/unstable/io_8hpp_source.html +++ b/docs/unstable/io_8hpp_source.html @@ -142,7 +142,7 @@
29#include <type_traits>
30#include <utility>
31
-
32namespace nda::clef {
+
32namespace nda::clef {
33
34 /**
35 * @addtogroup clef_utils
@@ -642,6 +642,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -749,25 +750,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/iterators_8hpp_source.html b/docs/unstable/iterators_8hpp_source.html index 80d13b760..e44b49222 100644 --- a/docs/unstable/iterators_8hpp_source.html +++ b/docs/unstable/iterators_8hpp_source.html @@ -140,7 +140,7 @@
27#include <cstddef>
28#include <iterator>
29
-
30namespace nda {
+
30namespace nda {
31
32 /**
33 * @addtogroup av_utils
@@ -962,6 +962,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -1083,25 +1084,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/lapack_2interface_2cxx__interface_8cpp_source.html b/docs/unstable/lapack_2interface_2cxx__interface_8cpp_source.html index 6c9d8cc62..ed8894d3a 100644 --- a/docs/unstable/lapack_2interface_2cxx__interface_8cpp_source.html +++ b/docs/unstable/lapack_2interface_2cxx__interface_8cpp_source.html @@ -138,7 +138,7 @@
25
26#include <complex>
27
-
28namespace nda::lapack::f77 {
+
28namespace nda::lapack::f77 {
29
30 void gelss(int M, int N, int NRHS, double *A, int LDA, double *B, int LDB, double *S, double RCOND, int &RANK, double *WORK, int LWORK,
31 [[maybe_unused]] double *RWORK, int &INFO) {
@@ -209,6 +209,7 @@
96 }
97
98} // namespace nda::lapack::f77
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define LAPACK_dstev
Definition lapack.h:4287
#define LAPACK_dgeqp3
Definition lapack.h:863
#define LAPACK_dgelss
Definition lapack.h:737
diff --git a/docs/unstable/lapack_2interface_2cxx__interface_8hpp_source.html b/docs/unstable/lapack_2interface_2cxx__interface_8hpp_source.html index 2f0c9e8d7..043d0f4cb 100644 --- a/docs/unstable/lapack_2interface_2cxx__interface_8hpp_source.html +++ b/docs/unstable/lapack_2interface_2cxx__interface_8hpp_source.html @@ -142,7 +142,7 @@
29#include "./cusolver_interface.hpp"
30#endif
31
-
32namespace nda::lapack::f77 {
+
32namespace nda::lapack::f77 {
33
34 void gelss(int M, int N, int NRHS, double *A, int LDA, double *B, int LDB, double *S, double RCOND, int &RANK, double *WORK, int LWORK,
35 double *RWORK, int &INFO);
@@ -185,7 +185,7 @@
72} // namespace nda::lapack::f77
73
74// Useful routines from the BLAS interface
-
75namespace nda::lapack {
+
75namespace nda::lapack {
76
77 // See nda::blas::get_ld.
78 using blas::get_ld;
@@ -206,6 +206,7 @@
93 using blas::is_conj_array_expr;
94
95} // namespace nda::lapack
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define LAPACK_sggevx
Definition lapack.h:1489
#define LAPACK_chegv
Definition lapack.h:2016
#define LAPACK_sorgrq
Definition lapack.h:3151
diff --git a/docs/unstable/lapack_8h_source.html b/docs/unstable/lapack_8h_source.html index 3a1374eaf..a91d319e2 100644 --- a/docs/unstable/lapack_8h_source.html +++ b/docs/unstable/lapack_8h_source.html @@ -5996,6 +5996,7 @@
5883#endif
5884
5885#endif /* LAPACK_H */
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define LAPACK_sggevx
Definition lapack.h:1489
#define LAPACK_chegv
Definition lapack.h:2016
#define LAPACK_sorgrq
Definition lapack.h:3151
diff --git a/docs/unstable/lapacke__config_8h_source.html b/docs/unstable/lapacke__config_8h_source.html index 8e66eb9b4..17e7350fc 100644 --- a/docs/unstable/lapacke__config_8h_source.html +++ b/docs/unstable/lapacke__config_8h_source.html @@ -245,6 +245,7 @@
132#endif /* __cplusplus */
133
134#endif /* _LAPACKE_CONFIG_H_ */
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define LAPACK_sggevx
Definition lapack.h:1489
#define LAPACK_chegv
Definition lapack.h:2016
#define LAPACK_sorgrq
Definition lapack.h:3151
diff --git a/docs/unstable/lapacke__mangling_8h_source.html b/docs/unstable/lapacke__mangling_8h_source.html index d05ca5365..f78831fd7 100644 --- a/docs/unstable/lapacke__mangling_8h_source.html +++ b/docs/unstable/lapacke__mangling_8h_source.html @@ -127,6 +127,7 @@
14#endif
15
16#endif
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
#define LAPACK_sggevx
Definition lapack.h:1489
#define LAPACK_chegv
Definition lapack.h:2016
#define LAPACK_sorgrq
Definition lapack.h:3151
diff --git a/docs/unstable/layout_2policies_8hpp_source.html b/docs/unstable/layout_2policies_8hpp_source.html index 2f8c32a49..69fbbd63f 100644 --- a/docs/unstable/layout_2policies_8hpp_source.html +++ b/docs/unstable/layout_2policies_8hpp_source.html @@ -140,7 +140,7 @@
27#include <cstdint>
28#include <type_traits>
29
-
30namespace nda {
+
30namespace nda {
31
32 /**
33 * @addtogroup layout_pols
@@ -483,6 +483,7 @@
idx_map(std::array< long, R > const &)
Construct a new map with a shape of a different rank.
Definition idx_map.hpp:435
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -562,25 +563,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/layout__transforms_8hpp_source.html b/docs/unstable/layout__transforms_8hpp_source.html index e25e0f81c..3f916d1d5 100644 --- a/docs/unstable/layout__transforms_8hpp_source.html +++ b/docs/unstable/layout__transforms_8hpp_source.html @@ -153,7 +153,7 @@
40#include <numeric>
41#endif // NDEBUG
42
-
43namespace nda {
+
43namespace nda {
44
45 /**
46 * @addtogroup av_factories
@@ -318,7 +318,7 @@
192 requires(MemoryArray<A> or is_instantiation_of_v<expr_call, A>)
193 {
194 if constexpr (MemoryArray<A>) {
-
195 return permuted_indices_view<encode(nda::permutations::reverse_identity<get_rank<A>>())>(std::forward<A>(a));
+
195 return permuted_indices_view<encode(nda::permutations::reverse_identity<get_rank<A>>())>(std::forward<A>(a));
196 } else { // expr_call
197 static_assert(std::tuple_size_v<decltype(a.a)> == 1, "Error in nda::transpose: Cannot transpose expr_call with more than one array argument");
198 return map(a.f)(transpose(std::get<0>(std::forward<A>(a).a)));
@@ -402,7 +402,7 @@
271 template <int N, typename A>
-
273 requires(nda::is_regular_or_view_v<A>)
+
273 requires(nda::is_regular_or_view_v<A>)
274 {
275 auto const &lay = a.indexmap();
276 using lay_t = std::decay_t<decltype(lay)>;
@@ -701,6 +701,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto reshape(A &&a, Ints... is)
Reshape an nda::basic_array or nda::basic_array_view.
auto transposed_view(A &&a)
Transpose two indices/dimensions of an nda::basic_array or nda::basic_array_view.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
@@ -832,25 +833,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/linalg_2dot_8hpp_source.html b/docs/unstable/linalg_2dot_8hpp_source.html index a63917048..9f6ca140b 100644 --- a/docs/unstable/linalg_2dot_8hpp_source.html +++ b/docs/unstable/linalg_2dot_8hpp_source.html @@ -142,7 +142,7 @@
29
30#include <type_traits>
31
-
32namespace nda {
+
32namespace nda {
33
34 /**
35 * @addtogroup linalg_tools
@@ -174,7 +174,7 @@
60
61 // get resulting value type and vector type
62 using value_t = decltype(get_value_t<X>{} * get_value_t<Y>{});
-
63 using vector_t = basic_array<value_t, 1, C_layout, 'V', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
+
63 using vector_t = basic_array<value_t, 1, C_layout, 'V', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
64
65 if constexpr (is_blas_lapack_v<value_t>) {
66 // for double value types we use blas::dot
@@ -219,7 +219,7 @@
103
104 // get resulting value type and vector type
105 using value_t = decltype(get_value_t<X>{} * get_value_t<Y>{});
-
106 using vector_t = basic_array<value_t, 1, C_layout, 'V', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
+
106 using vector_t = basic_array<value_t, 1, C_layout, 'V', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
107
108 if constexpr (is_blas_lapack_v<value_t>) {
109 // for double or complex value types we use blas::dotc
@@ -243,6 +243,7 @@
126
127} // namespace nda
A generic multi-dimensional array.
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto dotc(X &&x, Y &&y)
Compute the dot product of two complex arrays/views.
Definition dot.hpp:97
auto dot(X &&x, Y &&y)
Compute the dot product of two real arrays/views.
Definition dot.hpp:54
Contiguous layout policy with C-order (row-major order).
Definition policies.hpp:47
diff --git a/docs/unstable/literals_8hpp_source.html b/docs/unstable/literals_8hpp_source.html index 64aa87194..fca3c6767 100644 --- a/docs/unstable/literals_8hpp_source.html +++ b/docs/unstable/literals_8hpp_source.html @@ -136,7 +136,7 @@
23
24#include "./clef.hpp"
25
-
26namespace nda::clef::literals {
+
26namespace nda::clef::literals {
27
28 /**
29 * @addtogroup clef_placeholders
@@ -436,6 +436,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -555,25 +556,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/macros_8hpp_source.html b/docs/unstable/macros_8hpp_source.html index e843ae815..a800da259 100644 --- a/docs/unstable/macros_8hpp_source.html +++ b/docs/unstable/macros_8hpp_source.html @@ -209,6 +209,7 @@
96#endif // _CCQ_MACROS_GUARD_H
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
mapped< F > map(F f)
Create a lazy function call expression on arrays/views.
Definition map.hpp:199
constexpr bool is_regular_v
Constexpr variable that is true if type A is a regular array, i.e. an nda::basic_array.
Definition traits.hpp:145
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
Definition traits.hpp:126
diff --git a/docs/unstable/make__lazy_8hpp_source.html b/docs/unstable/make__lazy_8hpp_source.html index 89f953c65..80373d3f0 100644 --- a/docs/unstable/make__lazy_8hpp_source.html +++ b/docs/unstable/make__lazy_8hpp_source.html @@ -139,7 +139,7 @@
26
27#include <utility>
28
-
29namespace nda::clef {
+
29namespace nda::clef {
30
31 /**
32 * @addtogroup clef_expr
@@ -402,6 +402,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/malloc_8hpp_source.html b/docs/unstable/malloc_8hpp_source.html index b5c96a76a..e4948c511 100644 --- a/docs/unstable/malloc_8hpp_source.html +++ b/docs/unstable/malloc_8hpp_source.html @@ -139,7 +139,7 @@
26
27#include <cstdlib>
28
-
29namespace nda::mem {
+
29namespace nda::mem {
30
31 /**
32 * @addtogroup mem_utils
@@ -162,7 +162,7 @@
49 void *malloc(size_t size) {
50 check_adr_sp_valid<AdrSp>();
-
51 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
+
51 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
52
53 void *ptr = nullptr;
54 if constexpr (AdrSp == Host) {
@@ -190,7 +190,7 @@
75 void free(void *p) {
76 check_adr_sp_valid<AdrSp>();
-
77 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
+
77 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
78
79 if constexpr (AdrSp == Host) {
80 std::free(p); // NOLINT (we want to call free with a void*)
@@ -454,6 +454,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -549,25 +550,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/map_8hpp_source.html b/docs/unstable/map_8hpp_source.html index 3ef695542..c45a3314e 100644 --- a/docs/unstable/map_8hpp_source.html +++ b/docs/unstable/map_8hpp_source.html @@ -143,7 +143,7 @@
30#include <utility>
31#include <tuple>
32
-
33namespace nda {
+
33namespace nda {
34
35 /// @cond
36 // Forward declarations.
@@ -330,6 +330,7 @@
205} // namespace nda
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
mapped< F > map(F f)
Create a lazy function call expression on arrays/views.
Definition map.hpp:199
constexpr bool is_regular_v
Constexpr variable that is true if type A is a regular array, i.e. an nda::basic_array.
Definition traits.hpp:145
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
Definition traits.hpp:126
diff --git a/docs/unstable/mapped__functions_8hpp_source.html b/docs/unstable/mapped__functions_8hpp_source.html index bd3af2268..dfe3016b2 100644 --- a/docs/unstable/mapped__functions_8hpp_source.html +++ b/docs/unstable/mapped__functions_8hpp_source.html @@ -144,7 +144,7 @@
31#include <type_traits>
32#include <utility>
33
-
34namespace nda {
+
34namespace nda {
35
36 /**
37 * @addtogroup av_math
@@ -161,7 +161,7 @@
48 template <typename T>
49 auto real(T t)
-
50 requires(nda::is_scalar_v<T>)
+
50 requires(nda::is_scalar_v<T>)
51 {
52 if constexpr (is_complex_v<T>) {
53 return std::real(t);
@@ -181,7 +181,7 @@
66 template <typename T>
67 auto conj(T t)
-
68 requires(nda::is_scalar_v<T>)
+
68 requires(nda::is_scalar_v<T>)
69 {
70 if constexpr (is_complex_v<T>) {
71 return std::conj(t);
@@ -245,7 +245,7 @@
126 template <Array A>
127 auto pow(A &&a, double p) {
-
128 return nda::map([p](auto const &x) {
+
128 return nda::map([p](auto const &x) {
129 using std::pow;
130 return pow(x, p);
131 })(std::forward<A>(a));
@@ -271,7 +271,7 @@
148 decltype(auto) conj(A &&a) {
149 if constexpr (is_complex_v<get_value_t<A>>)
-
150 return nda::map(conj_f{})(std::forward<A>(a));
+
150 return nda::map(conj_f{})(std::forward<A>(a));
151 else
152 return std::forward<A>(a);
153 }
@@ -282,6 +282,7 @@
157} // namespace nda
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
double abs2(std::complex< double > z)
Get the squared absolute value of a std::complex<double>.
bool isnan(std::complex< double > const &z)
Check if a std::complex<double> is NaN.
double abs2(double x)
Get the squared absolute value of a double.
diff --git a/docs/unstable/mapped__functions_8hxx_source.html b/docs/unstable/mapped__functions_8hxx_source.html index 39849d1a4..a94386b6c 100644 --- a/docs/unstable/mapped__functions_8hxx_source.html +++ b/docs/unstable/mapped__functions_8hxx_source.html @@ -189,7 +189,7 @@
76
77*/
78
-
79namespace nda {
+
79namespace nda {
80
81 /**
82 * @addtogroup av_math
@@ -207,7 +207,7 @@
94 template <Array A>
95 auto abs(A &&a) {
-
96 return nda::map(
+
96 return nda::map(
97 [](auto const &x) {
98 using std::abs;
99 return abs(x);
@@ -223,7 +223,7 @@
108 template <Array A>
109 auto imag(A &&a) {
-
110 return nda::map(
+
110 return nda::map(
111 [](auto const &x) {
112 using std::imag;
113 return imag(x);
@@ -239,7 +239,7 @@
122 template <Array A>
123 auto floor(A &&a) {
-
124 return nda::map(
+
124 return nda::map(
125 [](auto const &x) {
126 using std::floor;
127 return floor(x);
@@ -255,7 +255,7 @@
136 template <Array A>
137 auto real(A &&a) {
-
138 return nda::map(
+
138 return nda::map(
139 [](auto const &x) {return real(x); })(std::forward<A>(a));
140 }
@@ -268,7 +268,7 @@
147 template <Array A>
148 auto abs2(A &&a) {
-
149 return nda::map(
+
149 return nda::map(
150 [](auto const &x) {return abs2(x); })(std::forward<A>(a));
151 }
@@ -281,7 +281,7 @@
158 template <Array A>
159 auto isnan(A &&a) {
-
160 return nda::map(
+
160 return nda::map(
161 [](auto const &x) {return isnan(x); })(std::forward<A>(a));
162 }
@@ -294,7 +294,7 @@
169 template <Array A>
170 auto exp(A &&a) requires(get_algebra<A> != 'M') {
-
171 return nda::map(
+
171 return nda::map(
172 [](auto const &x) {
173 using std::exp;
174 return exp(x);
@@ -310,7 +310,7 @@
183 template <Array A>
184 auto cos(A &&a) requires(get_algebra<A> != 'M') {
-
185 return nda::map(
+
185 return nda::map(
186 [](auto const &x) {
187 using std::cos;
188 return cos(x);
@@ -326,7 +326,7 @@
197 template <Array A>
198 auto sin(A &&a) requires(get_algebra<A> != 'M') {
-
199 return nda::map(
+
199 return nda::map(
200 [](auto const &x) {
201 using std::sin;
202 return sin(x);
@@ -342,7 +342,7 @@
211 template <Array A>
212 auto tan(A &&a) requires(get_algebra<A> != 'M') {
-
213 return nda::map(
+
213 return nda::map(
214 [](auto const &x) {
215 using std::tan;
216 return tan(x);
@@ -358,7 +358,7 @@
225 template <Array A>
226 auto cosh(A &&a) requires(get_algebra<A> != 'M') {
-
227 return nda::map(
+
227 return nda::map(
228 [](auto const &x) {
229 using std::cosh;
230 return cosh(x);
@@ -374,7 +374,7 @@
239 template <Array A>
240 auto sinh(A &&a) requires(get_algebra<A> != 'M') {
-
241 return nda::map(
+
241 return nda::map(
242 [](auto const &x) {
243 using std::sinh;
244 return sinh(x);
@@ -390,7 +390,7 @@
253 template <Array A>
254 auto tanh(A &&a) requires(get_algebra<A> != 'M') {
-
255 return nda::map(
+
255 return nda::map(
256 [](auto const &x) {
257 using std::tanh;
258 return tanh(x);
@@ -406,7 +406,7 @@
267 template <Array A>
268 auto acos(A &&a) requires(get_algebra<A> != 'M') {
-
269 return nda::map(
+
269 return nda::map(
270 [](auto const &x) {
271 using std::acos;
272 return acos(x);
@@ -422,7 +422,7 @@
281 template <Array A>
282 auto asin(A &&a) requires(get_algebra<A> != 'M') {
-
283 return nda::map(
+
283 return nda::map(
284 [](auto const &x) {
285 using std::asin;
286 return asin(x);
@@ -438,7 +438,7 @@
295 template <Array A>
296 auto atan(A &&a) requires(get_algebra<A> != 'M') {
-
297 return nda::map(
+
297 return nda::map(
298 [](auto const &x) {
299 using std::atan;
300 return atan(x);
@@ -454,7 +454,7 @@
309 template <Array A>
310 auto log(A &&a) requires(get_algebra<A> != 'M') {
-
311 return nda::map(
+
311 return nda::map(
312 [](auto const &x) {
313 using std::log;
314 return log(x);
@@ -470,7 +470,7 @@
323 template <Array A>
324 auto sqrt(A &&a) requires(get_algebra<A> != 'M') {
-
325 return nda::map(
+
325 return nda::map(
326 [](auto const &x) {
327 using std::sqrt;
328 return sqrt(x);
@@ -480,6 +480,7 @@
331
332 /** @} */
333}
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto cos(A &&a)
Lazy, coefficient-wise cos function for non-matrix nda::Array types.
auto sinh(A &&a)
Lazy, coefficient-wise sinh function for non-matrix nda::Array types.
auto tanh(A &&a)
Lazy, coefficient-wise tanh function for non-matrix nda::Array types.
diff --git a/docs/unstable/math_8hpp_source.html b/docs/unstable/math_8hpp_source.html index 04d916957..90869185d 100644 --- a/docs/unstable/math_8hpp_source.html +++ b/docs/unstable/math_8hpp_source.html @@ -139,7 +139,7 @@
26#include <cmath>
27#include <complex>
28
-
29namespace nda::clef {
+
29namespace nda::clef {
30
31 /**
32 * @addtogroup clef_expr
@@ -423,6 +423,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -527,25 +528,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/matmul_8hpp_source.html b/docs/unstable/matmul_8hpp_source.html index c289cd0fe..9b8c9ddc7 100644 --- a/docs/unstable/matmul_8hpp_source.html +++ b/docs/unstable/matmul_8hpp_source.html @@ -148,7 +148,7 @@
35#include <type_traits>
36#include <utility>
37
-
38namespace nda {
+
38namespace nda {
39
40 /**
41 * @addtogroup linalg_tools
@@ -211,7 +211,7 @@
97 using value_t = decltype(get_value_t<A>{} * get_value_t<B>{});
98 using layout_policy =
99 std::conditional_t<get_layout_info<A>.stride_order == get_layout_info<B>.stride_order, detail::get_layout_policy<A>, C_layout>;
-
100 using matrix_t = basic_array<value_t, 2, layout_policy, 'M', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
+
100 using matrix_t = basic_array<value_t, 2, layout_policy, 'M', nda::heap<mem::combine<L_adr_spc, R_adr_spc>>>;
101
102 // perform matrix-matrix multiplication
103 auto result = matrix_t(a.shape()[0], b.shape()[1]);
@@ -318,6 +318,7 @@
201
202} // namespace nda
A generic multi-dimensional array.
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto matvecmul(A &&a, X &&x)
Perform a matrix-vector multiplication.
Definition matmul.hpp:152
auto matmul(A &&a, B &&b)
Perform a matrix-matrix multiplication.
Definition matmul.hpp:87
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/matrix__functions_8hpp_source.html b/docs/unstable/matrix__functions_8hpp_source.html index 95af8b961..f36f925f5 100644 --- a/docs/unstable/matrix__functions_8hpp_source.html +++ b/docs/unstable/matrix__functions_8hpp_source.html @@ -149,7 +149,7 @@
36#include <ranges>
37#include <type_traits>
38
-
39namespace nda {
+
39namespace nda {
40
41 /**
42 * @addtogroup av_factories
@@ -227,7 +227,7 @@
107 long dim = std::min(m.shape()[0], m.shape()[1]);
108 long stride = stdutil::sum(m.indexmap().strides());
109 using vector_view_t =
-
110 basic_array_view<std::remove_reference_t<decltype(*m.data())>, 1, C_stride_layout, 'V', nda::default_accessor, nda::borrowed<>>;
+
110 basic_array_view<std::remove_reference_t<decltype(*m.data())>, 1, C_stride_layout, 'V', nda::default_accessor, nda::borrowed<>>;
111 return vector_view_t{C_stride_layout::mapping<1>{{dim}, {stride}}, m.data()};
112 }
@@ -244,7 +244,7 @@
123 ArrayOfRank<2> auto diag(V const &v) {
124 if constexpr (std::ranges::contiguous_range<V>) {
-
125 return diag(nda::basic_array_view{v});
+
125 return diag(nda::basic_array_view{v});
126 } else {
127 auto m = matrix<std::remove_const_t<typename V::value_type>>::zeros({v.size(), v.size()});
128 diagonal(m) = v;
@@ -289,6 +289,7 @@
164} // namespace nda
A generic view of a multi-dimensional array.
idx_map(std::array< long, Rank > const &shape, std::array< long, Rank > const &strides) noexcept(!check_stride_order)
Construct a new map from a given shape and strides.
Definition idx_map.hpp:379
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto eye(Int dim)
Create an identity nda::matrix with ones on the diagonal.
ArrayOfRank< 1 > auto diagonal(M &m)
Get a view of the diagonal of a 2-dimensional array/view.
ArrayOfRank< 2 > auto diag(V const &v)
Get a new nda::matrix with the given values on the diagonal.
diff --git a/docs/unstable/mem_2policies_8hpp_source.html b/docs/unstable/mem_2policies_8hpp_source.html index 1f15b8461..edf432dc5 100644 --- a/docs/unstable/mem_2policies_8hpp_source.html +++ b/docs/unstable/mem_2policies_8hpp_source.html @@ -137,7 +137,7 @@
24#include "./allocators.hpp"
25#include "./handle.hpp"
26
-
27namespace nda {
+
27namespace nda {
28
29 /**
30 * @addtogroup mem_pols
@@ -145,8 +145,8 @@
32 */
33
34#ifdef NDA_TEST_DEFAULT_ALLOC_MBUCKET // for testing only: use multi_bucket allocator
-
35 template <typename Allocator =
-
36 mem::segregator<8 * NDA_TEST_DEFAULT_ALLOC_MBUCKET, mem::multi_bucket<8 * NDA_TEST_DEFAULT_ALLOC_MBUCKET>, mem::mallocator>>
+
35 template <typename Allocator =
+
37#else // normal case
38 /**
39 * @brief Memory policy using an nda::mem::handle_heap.
@@ -414,6 +414,7 @@
Custom allocator that uses nda::mem::malloc to allocate memory.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -504,25 +505,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/memcpy_8hpp_source.html b/docs/unstable/memcpy_8hpp_source.html index d6f1d91fc..d5a589e5d 100644 --- a/docs/unstable/memcpy_8hpp_source.html +++ b/docs/unstable/memcpy_8hpp_source.html @@ -140,7 +140,7 @@
27
28#include <cstring>
29
-
30namespace nda::mem {
+
30namespace nda::mem {
31
32 /**
33 * @addtogroup mem_utils
@@ -164,7 +164,7 @@
51 void memcpy(void *dest, void const *src, size_t count) {
52 check_adr_sp_valid<DestAdrSp, SrcAdrSp>();
-
53 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
+
53 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
54
55 if constexpr (DestAdrSp == Host && SrcAdrSp == Host) {
56 std::memcpy(dest, src, count);
@@ -200,13 +200,13 @@
84 void memcpy2D(void *dest, size_t dpitch, const void *src, size_t spitch, size_t width, size_t height) {
85 EXPECTS(width <= dpitch && width <= spitch);
86 check_adr_sp_valid<DestAdrSp, SrcAdrSp>();
-
87 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
+
87 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
88
89 if constexpr (DestAdrSp == Host && SrcAdrSp == Host) {
90 auto *desti = static_cast<unsigned char *>(dest);
91 auto *srci = static_cast<const unsigned char *>(src);
92 for (size_t i = 0; i < height; ++i, desti += dpitch, srci += spitch) std::memcpy(desti, srci, width);
-
93 } else if (nda::have_device) {
+
93 } else if (nda::have_device) {
94 device_error_check(cudaMemcpy2D(dest, dpitch, src, spitch, width, height, cudaMemcpyDefault), "cudaMemcpy2D");
95 }
96 }
@@ -466,6 +466,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -566,25 +567,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/memset_8hpp_source.html b/docs/unstable/memset_8hpp_source.html index 2e6b42c9b..c119c69c0 100644 --- a/docs/unstable/memset_8hpp_source.html +++ b/docs/unstable/memset_8hpp_source.html @@ -139,7 +139,7 @@
26
27#include <cstring>
28
-
29namespace nda::mem {
+
29namespace nda::mem {
30
31 /**
32 * @addtogroup mem_utils
@@ -162,7 +162,7 @@
49 void memset(void *p, int value, size_t count) {
50 check_adr_sp_valid<AdrSp>();
-
51 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
+
51 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
52
53 if constexpr (AdrSp == Host) {
54 std::memset(p, value, count);
@@ -193,7 +193,7 @@
78 void memset2D(void *ptr, size_t pitch, int value, size_t width, size_t height) {
79 check_adr_sp_valid<AdrSp>();
-
80 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
+
80 static_assert(nda::have_device == nda::have_cuda, "Adjust function for new device types");
81
82 if constexpr (AdrSp == Host) {
83 auto *ptri = static_cast<unsigned char *>(ptr);
@@ -458,6 +458,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -555,25 +556,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/norm_8hpp_source.html b/docs/unstable/norm_8hpp_source.html index 6fe84fdfb..f865c19f9 100644 --- a/docs/unstable/norm_8hpp_source.html +++ b/docs/unstable/norm_8hpp_source.html @@ -147,7 +147,7 @@
34#include <complex>
35#include <limits>
36
-
37namespace nda {
+
37namespace nda {
38
39 /**
40 * @ingroup linalg_tools
@@ -174,7 +174,7 @@
60
61 if (p == 2.0) [[likely]] {
62 if constexpr (MemoryArray<A>)
-
63 return std::sqrt(std::real(nda::blas::dotc(a, a)));
+
63 return std::sqrt(std::real(nda::blas::dotc(a, a)));
64 else
65 return norm(make_regular(a));
66 } else if (p == 1.0) {
@@ -196,6 +196,7 @@
82
83} // namespace nda
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
double norm(A const &a, double p=2.0)
Calculate the p-norm of an nda::ArrayOfRank<1> object with scalar values. The p-norm is defined as.
Definition norm.hpp:58
diff --git a/docs/unstable/operation_8hpp_source.html b/docs/unstable/operation_8hpp_source.html index 52732d437..a8816fcd6 100644 --- a/docs/unstable/operation_8hpp_source.html +++ b/docs/unstable/operation_8hpp_source.html @@ -142,7 +142,7 @@
29#include <type_traits>
30#include <utility>
31
-
32namespace nda::clef {
+
32namespace nda::clef {
33
34 /**
35 * @addtogroup clef_expr
@@ -527,6 +527,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/orgqr_8hpp_source.html b/docs/unstable/orgqr_8hpp_source.html index 229b2bb55..95cf78372 100644 --- a/docs/unstable/orgqr_8hpp_source.html +++ b/docs/unstable/orgqr_8hpp_source.html @@ -148,7 +148,7 @@
35#include <complex>
36#include <type_traits>
37
-
38namespace nda::lapack {
+
38namespace nda::lapack {
39
40 /**
41 * @ingroup linalg_lapack
@@ -192,7 +192,7 @@
78 int bufferSize = static_cast<int>(std::ceil(std::real(bufferSize_T)));
79
80 // allocate work buffer and perform actual library call
-
81 nda::array<value_type, 1, C_layout, heap<mem::get_addr_space<A>>> work(bufferSize);
+
81 nda::array<value_type, 1, C_layout, heap<mem::get_addr_space<A>>> work(bufferSize);
82 lapack::f77::orgqr(m, std::min(m, n), k, a.data(), get_ld(a), tau.data(), work.data(), bufferSize, info);
83
84 if (info) NDA_RUNTIME_ERROR << "Error in nda::lapack::orgqr: info = " << info;
@@ -202,6 +202,7 @@
87
88} // namespace nda::lapack
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int orgqr(A &&a, TAU &&tau)
Interface to the LAPACK orgqr routine.
Definition orgqr.hpp:63
#define EXPECTS(X)
Definition macros.hpp:59
Contiguous layout policy with C-order (row-major order).
Definition policies.hpp:47
diff --git a/docs/unstable/permutation_8hpp_source.html b/docs/unstable/permutation_8hpp_source.html index 840523c59..53ca52be1 100644 --- a/docs/unstable/permutation_8hpp_source.html +++ b/docs/unstable/permutation_8hpp_source.html @@ -145,7 +145,7 @@
32#include <cstddef>
33#include <cstdint>
34
-
35namespace nda {
+
35namespace nda {
36
37 /**
38 * @addtogroup utils_perms
@@ -198,7 +198,7 @@
81
82} // namespace nda
83
-
84namespace nda::permutations {
+
84namespace nda::permutations {
85
86 /**
87 * @addtogroup utils_perms
@@ -564,6 +564,7 @@
idx_map(std::array< long, R > const &)
Construct a new map with a shape of a different rank.
Definition idx_map.hpp:435
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/placeholder_8hpp_source.html b/docs/unstable/placeholder_8hpp_source.html index 8ebaa161b..cda4e5661 100644 --- a/docs/unstable/placeholder_8hpp_source.html +++ b/docs/unstable/placeholder_8hpp_source.html @@ -140,7 +140,7 @@
27#include <type_traits>
28#include <utility>
29
-
30namespace nda::clef {
+
30namespace nda::clef {
31
32 /**
33 * @addtogroup clef_placeholders
@@ -406,6 +406,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/print_8hpp_source.html b/docs/unstable/print_8hpp_source.html index 00b8d66c8..e559b1ecb 100644 --- a/docs/unstable/print_8hpp_source.html +++ b/docs/unstable/print_8hpp_source.html @@ -145,7 +145,7 @@
32#include <cstdint>
33#include <ostream>
34
-
35namespace nda {
+
35namespace nda {
36
37 /**
38 * @addtogroup layout_utils
@@ -321,6 +321,7 @@
194} // namespace nda
Adapter that consists of a shape and a callable object, which takes R integers as arguments (just lik...
Layout that specifies how to map multi-dimensional indices to a linear/flat index.
Definition idx_map.hpp:103
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
constexpr bool has_contiguous(layout_prop_e lp)
Checks if a layout property has the contiguous property.
Definition traits.hpp:282
constexpr bool has_strided_1d(layout_prop_e lp)
Checks if a layout property has the strided_1d property.
Definition traits.hpp:266
constexpr bool has_smallest_stride_is_one(layout_prop_e lp)
Checks if a layout property has the smallest_stride_is_one property.
Definition traits.hpp:274
diff --git a/docs/unstable/range_8hpp_source.html b/docs/unstable/range_8hpp_source.html index 061077f17..4b445d9ff 100644 --- a/docs/unstable/range_8hpp_source.html +++ b/docs/unstable/range_8hpp_source.html @@ -143,7 +143,7 @@
30#include <ostream>
31#include <type_traits>
32
-
33namespace nda {
+
33namespace nda {
34
35 /**
36 * @addtogroup layout_utils
@@ -193,6 +193,7 @@
80} // namespace nda
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
mapped< F > map(F f)
Create a lazy function call expression on arrays/views.
Definition map.hpp:199
constexpr bool is_regular_v
Constexpr variable that is true if type A is a regular array, i.e. an nda::basic_array.
Definition traits.hpp:145
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
Definition traits.hpp:126
diff --git a/docs/unstable/reduce_8hpp_source.html b/docs/unstable/reduce_8hpp_source.html index 54d18888c..bb7667a8a 100644 --- a/docs/unstable/reduce_8hpp_source.html +++ b/docs/unstable/reduce_8hpp_source.html @@ -218,7 +218,7 @@
103 // perform the reduction
104 if constexpr (not mpi::has_mpi_type<value_type>) {
105 // if the value type cannot be reduced directly, we call mpi::reduce for each element
-
106 target = nda::map([this](auto const &x) { return mpi::reduce(x, this->comm, this->root, this->all, this->op); })(rhs);
+
106 target = nda::map([this](auto const &x) { return mpi::reduce(x, this->comm, this->root, this->all, this->op); })(rhs);
107 } else {
108 // value type has a corresponding MPI type
109 bool in_place = (target.data() == rhs.data());
@@ -226,7 +226,7 @@
111 if (rhs.size() != target.size())
112 NDA_RUNTIME_ERROR << "Error in MPI reduce for nda::Array: In-place reduction requires arrays of the same size";
113 } else {
-
114 if ((comm.rank() == root) || all) nda::resize_or_check_if_view(target, shape());
+
114 if ((comm.rank() == root) || all) nda::resize_or_check_if_view(target, shape());
115 if (std::abs(target.data() - rhs.data()) < rhs.size()) NDA_RUNTIME_ERROR << "Error in MPI reduce for nda::Array: Overlapping arrays";
116 }
117
@@ -251,7 +251,7 @@
135};
136
-
137namespace nda {
+
137namespace nda {
138
139 /**
140 * @ingroup av_mpi
@@ -294,6 +294,7 @@
175
176} // namespace nda
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
ArrayInitializer< std::remove_reference_t< A > > auto mpi_reduce(A &&a, mpi::communicator comm={}, int root=0, bool all=false, MPI_Op op=MPI_SUM)
Implementation of an MPI reduce for nda::basic_array or nda::basic_array_view types.
Definition reduce.hpp:167
const_view_type rhs
View of the array/view to be reduced.
Definition reduce.hpp:58
auto shape() const
Compute the shape of the target array.
Definition reduce.hpp:77
diff --git a/docs/unstable/scal_8hpp_source.html b/docs/unstable/scal_8hpp_source.html index 3418600cc..117eed9c2 100644 --- a/docs/unstable/scal_8hpp_source.html +++ b/docs/unstable/scal_8hpp_source.html @@ -141,7 +141,7 @@
28#include "../mem/address_space.hpp"
29#include "../traits.hpp"
30
-
31namespace nda::blas {
+
31namespace nda::blas {
32
33 /**
34 * @ingroup linalg_blas
@@ -176,6 +176,7 @@
62
63} // namespace nda::blas
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
void scal(get_value_t< X > alpha, X &&x)
Interface to the BLAS scal routine.
Definition scal.hpp:49
void compile_error_no_gpu()
Trigger a compilation error in case GPU specific functionality is used without configuring the projec...
Definition device.hpp:47
diff --git a/docs/unstable/scatter_8hpp_source.html b/docs/unstable/scatter_8hpp_source.html index 0ffa896d7..82e845568 100644 --- a/docs/unstable/scatter_8hpp_source.html +++ b/docs/unstable/scatter_8hpp_source.html @@ -243,7 +243,7 @@
125};
126
-
127namespace nda {
+
127namespace nda {
128
129 /**
130 * @ingroup av_mpi
@@ -286,6 +286,7 @@
165
166} // namespace nda
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
ArrayInitializer< std::remove_reference_t< A > > auto mpi_scatter(A &&a, mpi::communicator comm={}, int root=0, bool all=false)
Implementation of an MPI scatter for nda::basic_array or nda::basic_array_view types.
Definition scatter.hpp:158
void invoke(T &&target) const
Execute the lazy MPI operation and write the result to a target array/view.
Definition scatter.hpp:93
const_view_type rhs
View of the array/view to be scattered.
Definition scatter.hpp:57
diff --git a/docs/unstable/search/all_13.js b/docs/unstable/search/all_13.js index b885be78e..47528822d 100644 --- a/docs/unstable/search/all_13.js +++ b/docs/unstable/search/all_13.js @@ -34,7 +34,7 @@ var searchData= ['operator_21_3d_31',['operator!=',['../classnda_1_1array__iterator.html#aa8ed532ebc2d8ad15ceaf7fd83770660',1,'nda::array_iterator::operator!=()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#a6f65e9fc6e76ca1957e3637228005360',1,'nda::array_iterator< 1, T, Pointer >::operator!=()']]], ['operator_26_32',['operator&',['../group__layout__utils.html#ga68e464683566699ffeecb191bbbd26fa',1,'nda::operator&(layout_prop_e lhs, layout_prop_e rhs)'],['../group__layout__utils.html#ga6ca72da0ad8b29fc125e0eb3ac1213a9',1,'nda::operator&(layout_info_t lhs, layout_info_t rhs)']]], ['operator_28_29_33',['operator()',['../structnda_1_1expr__call.html#a741e9884ed31b48fb51ed445db46d3e8',1,'nda::expr_call::operator()()'],['../structnda_1_1mapped.html#a47a0c578e7ab0ed58e5d2d5f1ca1f6a8',1,'nda::mapped::operator()()'],['../structnda_1_1conj__f.html#aad1b8f05cf585dc2c9c93cecb89d4619',1,'nda::conj_f::operator()()'],['../classnda_1_1basic__array.html#afd5e2d580b3de2b53a8550ea2bb32ec9',1,'nda::basic_array::operator()(_linear_index_t idx) const noexcept'],['../classnda_1_1basic__array.html#a68a7b1c66cebb72ffb9bc893d9419f20',1,'nda::basic_array::operator()(_linear_index_t idx) noexcept'],['../classnda_1_1basic__array.html#aede48d11646d617f63e192a2ae72a669',1,'nda::basic_array::operator()(Ts const &...idxs) const &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array.html#a69b27a5398829310d2d47663fb8cd659',1,'nda::basic_array::operator()(Ts const &...idxs) &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array.html#ad5395ea2478baf5c1a4ee78eef1cddaf',1,'nda::basic_array::operator()(Ts const &...idxs) &&noexcept(has_no_boundcheck)'],['../structnda_1_1expr__unary.html#a53a14614d4500b87a77a73e8c81f7792',1,'nda::expr_unary::operator()()'],['../structnda_1_1expr.html#ace28351da246baaa9e83e4ea8f2b6476',1,'nda::expr::operator()()'],['../classnda_1_1array__adapter.html#a6da7cb0261e2b7e01913120378717e90',1,'nda::array_adapter::operator()()'],['../classnda_1_1basic__array__view.html#a8bf1595081e087e2f2640e2771d29aeb',1,'nda::basic_array_view::operator()(_linear_index_t idx) const noexcept'],['../classnda_1_1basic__array__view.html#a6ae5e6ef1c303aa220bb65d1e595dcb3',1,'nda::basic_array_view::operator()(_linear_index_t idx) noexcept'],['../classnda_1_1basic__array__view.html#a8d630334727e3ff9192d395700af88c6',1,'nda::basic_array_view::operator()(Ts const &...idxs) const &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array__view.html#a39c5f396cd87423d953e632c4c46e5f7',1,'nda::basic_array_view::operator()(Ts const &...idxs) &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array__view.html#ae9e0d656c99d4bc754ba5bf55d96c34c',1,'nda::basic_array_view::operator()(Ts const &...idxs) &&noexcept(has_no_boundcheck)'],['../structnda_1_1clef_1_1evaluator.html#a17b42b4ec3748a2168930de52f14e32f',1,'nda::clef::evaluator::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01placeholder_3_01N_01_4_00_01pair_3_01Is_00_01Ts_01_4_8_8_8_01_4.html#a805361372dd59ea80496376b2075d38e',1,'nda::clef::evaluator< placeholder< N >, pair< Is, Ts >... >::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01std_1_1reference__wrapper_3_01T_01_4_00_01Pairs_8_8_8_01_4.html#a5709746c74940f8cbdd4715fe3e1e6db',1,'nda::clef::evaluator< std::reference_wrapper< T >, Pairs... >::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01expr_3_01Tag_00_01Childs_8_8_8_01_4_00_01Pairs_8_8_8_01_4.html#adb0e994415a3c364ea2258d3d0c9ee42',1,'nda::clef::evaluator< expr< Tag, Childs... >, Pairs... >::operator()()'],['../structnda_1_1clef_1_1expr.html#afdf8fc34e5f34d7ff957c2a99a7c4cbe',1,'nda::clef::expr::operator()()'],['../structnda_1_1clef_1_1make__fun__impl.html#af9013b53bbed9c8b9983c2da6bed6810',1,'nda::clef::make_fun_impl::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01make__fun__impl_3_01T_00_01Is_8_8_8_01_4_00_01Pairs_8_8_8_01_4.html#a241b49e0c7b4ed69e6b60b030f10bbaf',1,'nda::clef::evaluator< make_fun_impl< T, Is... >, Pairs... >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1terminal_01_4.html#a359d36ac2e8a80ee6a9a7407baaa302f',1,'nda::clef::operation< tags::terminal >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1function_01_4.html#a38c84964bc4bd1b751d96fe3bacfa9de',1,'nda::clef::operation< tags::function >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1subscript_01_4.html#aa650f785cf7dfb631bca35a4d8d6f28b',1,'nda::clef::operation< tags::subscript >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1plus_01_4.html#aa5fef986df5bfcfb4fac586038eca74e',1,'nda::clef::operation< tags::plus >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1minus_01_4.html#aab81ed897df8d285ef079658dfcea06f',1,'nda::clef::operation< tags::minus >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1multiplies_01_4.html#a7e21f9a9bc83f556b7477b28b20f89f4',1,'nda::clef::operation< tags::multiplies >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1divides_01_4.html#a0b3ffd3f64f46cc5ed56e5c8f077eafd',1,'nda::clef::operation< tags::divides >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1greater_01_4.html#a0313324ad507bc55d9cf257699aa2368',1,'nda::clef::operation< tags::greater >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1less_01_4.html#a9d9753439825fdc6b39e600946299117',1,'nda::clef::operation< tags::less >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1leq_01_4.html#a9bc654dd1d593473d99944c2b331fcec',1,'nda::clef::operation< tags::leq >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1geq_01_4.html#a693455debd0003b2c6c1c064ab90dfbd',1,'nda::clef::operation< tags::geq >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1eq_01_4.html#a0d71d8d21e82e3d4de1b83749a74c3a0',1,'nda::clef::operation< tags::eq >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1unaryplus_01_4.html#a46827ad694f387556cfb05bb0fd0529e',1,'nda::clef::operation< tags::unaryplus >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1negate_01_4.html#a13b922e733529f78b7453342fd4cd534',1,'nda::clef::operation< tags::negate >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1loginot_01_4.html#a06ba94650ba7ac83250dd850cc74710f',1,'nda::clef::operation< tags::loginot >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1if__else_01_4.html#aa308451c9109ad1645ec3f29936c4d76',1,'nda::clef::operation< tags::if_else >::operator()()'],['../structnda_1_1clef_1_1placeholder.html#a9176cd8bd502430b7604078a8c35396b',1,'nda::clef::placeholder::operator()()'],['../classnda_1_1lapack_1_1gelss__worker.html#ae0a4cab3deb38bab3038b58851941600',1,'nda::lapack::gelss_worker::operator()(matrix_const_view< T > B, std::optional< long >={}) const'],['../classnda_1_1lapack_1_1gelss__worker.html#a6775670c0781714e0d62d3a3e742fc4c',1,'nda::lapack::gelss_worker::operator()(vector_const_view< T > b, std::optional< long >={}) const'],['../structnda_1_1lapack_1_1gelss__worker__hermitian.html#aa644455b19e4cdc962d8e82c41787fa8',1,'nda::lapack::gelss_worker_hermitian::operator()()'],['../classnda_1_1idx__map.html#a0b06eac006dea6bf1dae630087f0b693',1,'nda::idx_map::operator()()'],['../structnda_1_1operation.html#a32f1f27ecb00219f98d6101db7344146',1,'nda::operation::operator()()']]], - ['operator_2a_34',['operator*',['../classnda_1_1array__iterator.html#ab2170aa0ce489e7ebb6fbbb9cda52a0b',1,'nda::array_iterator::operator*()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#aa700540657d68317d98da26c85e7651c',1,'nda::array_iterator< 1, T, Pointer >::operator*()'],['../structnda_1_1operation.html#a914b1e93c801621791883e7307c64f56',1,'nda::operation::operator*()'],['../group__av__ops.html#ga99b0f013ecf0a681b982e18407b2605b',1,'nda::operator*(L &&l, R &&r)'],['../group__av__ops.html#gad7faac0d1f858667bb8460cb24ef2ca5',1,'nda::operator*(A &&a, S &&s)'],['../group__av__ops.html#ga67a055fb687f8946c02fcd489013e194',1,'nda::operator*(S &&s, A &&a)'],['../group__clef__expr.html#gac978aeae0e098854b22faed551f55d0b',1,'nda::clef::operator*()'],['../group__utils__std.html#ga150bf6446a518f7929c3b77eb01831e3',1,'std::operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)'],['../group__utils__std.html#ga811f3de76af8953ea07be27bd75cd1fa',1,'std::operator*(T s, std::array< T, R > const &a)'],['../group__utils__std.html#ga073562363f858235479b35707b89f2f7',1,'std::operator*(std::complex< T > const &x, U y)'],['../group__utils__std.html#gae5f3b5487d0dafb7b238e935c97bad0b',1,'std::operator*(T x, std::complex< U > const &y)'],['../group__utils__std.html#ga3dcc9bd7f252ccab3d08cbf04ff51b4d',1,'std::operator*(std::complex< T > const &x, std::complex< U > const &y)']]], + ['operator_2a_34',['operator*',['../classnda_1_1array__iterator.html#ab2170aa0ce489e7ebb6fbbb9cda52a0b',1,'nda::array_iterator::operator*()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#aa700540657d68317d98da26c85e7651c',1,'nda::array_iterator< 1, T, Pointer >::operator*()'],['../structnda_1_1operation.html#a914b1e93c801621791883e7307c64f56',1,'nda::operation::operator*()'],['../group__av__ops.html#ga99b0f013ecf0a681b982e18407b2605b',1,'nda::operator*(L &&l, R &&r)'],['../group__av__ops.html#gad7faac0d1f858667bb8460cb24ef2ca5',1,'nda::operator*(A &&a, S &&s)'],['../group__av__ops.html#ga67a055fb687f8946c02fcd489013e194',1,'nda::operator*(S &&s, A &&a)'],['../group__clef__expr.html#gac978aeae0e098854b22faed551f55d0b',1,'nda::clef::operator*()'],['../group__utils__std.html#ga123c9c27f42fa662b906d6312f2ac57c',1,'std::operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)'],['../group__utils__std.html#ga811f3de76af8953ea07be27bd75cd1fa',1,'std::operator*(T s, std::array< T, R > const &a)'],['../group__utils__std.html#ga073562363f858235479b35707b89f2f7',1,'std::operator*(std::complex< T > const &x, U y)'],['../group__utils__std.html#gae5f3b5487d0dafb7b238e935c97bad0b',1,'std::operator*(T x, std::complex< U > const &y)'],['../group__utils__std.html#ga3dcc9bd7f252ccab3d08cbf04ff51b4d',1,'std::operator*(std::complex< T > const &x, std::complex< U > const &y)']]], ['operator_2a_3d_35',['operator*=',['../classnda_1_1basic__array.html#ae37d092bc5eaed902eb8ec5ba15af641',1,'nda::basic_array::operator*=()'],['../classnda_1_1basic__array__view.html#a90e27ffa2cde5484451e35140a83a658',1,'nda::basic_array_view::operator*=()']]], ['operator_2b_36',['operator+',['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#a50559e8f82c930c4d0de5013ae4861af',1,'nda::array_iterator< 1, T, Pointer >::operator+'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#ac8c3db0dad678fdef53d2225c8d3f878',1,'nda::array_iterator< 1, T, Pointer >::operator+'],['../group__av__ops.html#ga0e020426887be8ac9d2a18b96acb2d06',1,'nda::operator+(L &&l, R &&r)'],['../group__av__ops.html#gac0598e71d9a03e7fe29ee703cf0284a0',1,'nda::operator+(A &&a, S &&s)'],['../group__av__ops.html#ga62cb5f1c89a42b0b34e431c2e4a3fdef',1,'nda::operator+(S &&s, A &&a)'],['../group__clef__expr.html#ga4c5021bcdfd094832ae680bd85f80eb3',1,'nda::clef::operator+(L &&l, R &&r)'],['../group__clef__expr.html#ga50a49f8c0f2fe891c2d425d4c5811629',1,'nda::clef::operator+(L &&l)'],['../group__utils__std.html#ga4402967146599c40ebbb648249c4a5f6',1,'std::operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)'],['../group__utils__std.html#ga7f3edec88edd9eac10597c9fb85883ac',1,'std::operator+(std::complex< T > const &x, U y)'],['../group__utils__std.html#gaff7123f20bcd76b9240caa4f627c9b28',1,'std::operator+(T x, std::complex< U > const &y)'],['../group__utils__std.html#ga235ace931d1a620e7e8191b0205829f4',1,'std::operator+(std::complex< T > const &x, std::complex< U > const &y)']]], ['operator_2b_2b_37',['operator++',['../classnda_1_1array__iterator.html#af4fe77db9873e9f68a1718d463f3c1c3',1,'nda::array_iterator::operator++()'],['../classnda_1_1array__iterator.html#a30fe3b76caac790c833c8103648811bc',1,'nda::array_iterator::operator++(int)'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#a7a78ccda3bd77158508634080489be11',1,'nda::array_iterator< 1, T, Pointer >::operator++()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#aa806fb334f3c22a43854bceda5d21657',1,'nda::array_iterator< 1, T, Pointer >::operator++(int)']]], diff --git a/docs/unstable/search/all_c.js b/docs/unstable/search/all_c.js index 5173bf503..a30e58458 100644 --- a/docs/unstable/search/all_c.js +++ b/docs/unstable/search/all_c.js @@ -3,35 +3,36 @@ var searchData= ['h5_2ehpp_0',['h5.hpp',['../h5_8hpp.html',1,'']]], ['h5_5fread_1',['h5_read',['../group__av__hdf5.html#ga2bbce727dcb0638aac491a58bd2a6b28',1,'nda']]], ['h5_5fwrite_2',['h5_write',['../group__av__hdf5.html#ga45a1f6d57e999ad0cf8023e3d1b0ff2c',1,'nda::h5_write(h5::group g, std::string const &name, A const &a, bool compress=true)'],['../group__av__hdf5.html#gaa4dee39e09d66dbc7e09347ac8045475',1,'nda::h5_write(h5::group g, std::string const &name, A const &a, std::tuple< IRs... > const &slice)']]], - ['handle_3',['handle',['../structnda_1_1heap__basic.html#a5d8ff05114dc8abc64de0f6b0ebda74a',1,'nda::heap_basic::handle'],['../structnda_1_1sso.html#ab22f2a384227ce8ae989d11296677614',1,'nda::sso::handle'],['../structnda_1_1stack.html#adc4ca01f24fbf6b0e9c7e0ff5fb152d4',1,'nda::stack::handle'],['../structnda_1_1shared.html#a862cd58ac2455a70eccc952a93ff719c',1,'nda::shared::handle'],['../structnda_1_1borrowed.html#ad6179beaa7b9c8da002fb3ad3cce04c1',1,'nda::borrowed::handle']]], - ['handle_2ehpp_4',['handle.hpp',['../handle_8hpp.html',1,'']]], - ['handle_5fborrowed_5',['handle_borrowed',['../structnda_1_1mem_1_1handle__borrowed.html',1,'nda::mem::handle_borrowed< T, AdrSp >'],['../structnda_1_1mem_1_1handle__borrowed.html#a5538f05cf62914934a85ec6c4044c9ba',1,'nda::mem::handle_borrowed::handle_borrowed()=default'],['../structnda_1_1mem_1_1handle__borrowed.html#ab66465f100d97213f16f42798e0bfb81',1,'nda::mem::handle_borrowed::handle_borrowed(handle_borrowed const &)=default'],['../structnda_1_1mem_1_1handle__borrowed.html#a1c11a8f6b756e57322547fce226edfff',1,'nda::mem::handle_borrowed::handle_borrowed(T *ptr) noexcept'],['../structnda_1_1mem_1_1handle__borrowed.html#a2d9c4a994942da7b8139b820cfd97a03',1,'nda::mem::handle_borrowed::handle_borrowed(H const &h, long offset=0) noexcept']]], - ['handle_5fheap_6',['handle_heap',['../structnda_1_1mem_1_1handle__heap.html',1,'nda::mem::handle_heap< T, A >'],['../structnda_1_1mem_1_1handle__heap.html#adedc0f42778a31dc30345dc405b01ad9',1,'nda::mem::handle_heap::handle_heap()=default'],['../structnda_1_1mem_1_1handle__heap.html#a477909753bc7f6288251b6dd20482d70',1,'nda::mem::handle_heap::handle_heap(handle_heap &&h) noexcept'],['../structnda_1_1mem_1_1handle__heap.html#ac88adb5f9b3775b8d3450fcfd002fcdc',1,'nda::mem::handle_heap::handle_heap(handle_heap const &h)'],['../structnda_1_1mem_1_1handle__heap.html#af870fc0652c8102d85412e9b7ce7ee22',1,'nda::mem::handle_heap::handle_heap(H const &h)'],['../structnda_1_1mem_1_1handle__heap.html#aa773a5e24ef1901230372e84eda31f6c',1,'nda::mem::handle_heap::handle_heap(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__heap.html#a545b2e0135f9d17df3e46e4494917a48',1,'nda::mem::handle_heap::handle_heap(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__heap.html#a86a57ea956e1d866d81bf38d04aeb0a0',1,'nda::mem::handle_heap::handle_heap(long size)']]], - ['handle_5fheap_3c_20t0_20_3e_7',['handle_heap< T0 >',['../structnda_1_1mem_1_1handle__heap.html',1,'nda::mem']]], - ['handle_5fshared_8',['handle_shared',['../structnda_1_1mem_1_1handle__shared.html',1,'nda::mem::handle_shared< T, AdrSp >'],['../structnda_1_1mem_1_1handle__shared.html#a1a266459c9fcddedbbe3043e5536cfb8',1,'nda::mem::handle_shared::handle_shared()=default'],['../structnda_1_1mem_1_1handle__shared.html#aaaf9c8b72e0ada692c924862dbe69f0c',1,'nda::mem::handle_shared::handle_shared(T *data, size_t size, void *foreign_handle, void(*foreign_decref)(void *)) noexcept'],['../structnda_1_1mem_1_1handle__shared.html#a18efbebe1b46a1f08ee8e45e7abed580',1,'nda::mem::handle_shared::handle_shared(handle_heap< T, A > const &h) noexcept']]], - ['handle_5fsso_9',['handle_sso',['../structnda_1_1mem_1_1handle__sso.html',1,'nda::mem::handle_sso< T, Size >'],['../structnda_1_1mem_1_1handle__sso.html#a1caa82b7f8bd340d1e9e1c7aecae1837',1,'nda::mem::handle_sso::handle_sso()'],['../structnda_1_1mem_1_1handle__sso.html#ab235e1b08c0f78a0768a8484aa35b732',1,'nda::mem::handle_sso::handle_sso(handle_sso &&h) noexcept'],['../structnda_1_1mem_1_1handle__sso.html#a65e3c814068e48281cb43a6104ecf23f',1,'nda::mem::handle_sso::handle_sso(handle_sso const &h)'],['../structnda_1_1mem_1_1handle__sso.html#ab27cde8796775cf351f73d0a6b9f2183',1,'nda::mem::handle_sso::handle_sso(H const &h)'],['../structnda_1_1mem_1_1handle__sso.html#a915e2503b739f86ecca2b5494fd0c24c',1,'nda::mem::handle_sso::handle_sso(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__sso.html#a9a8b4ad445c3e946f140fa2e246506c1',1,'nda::mem::handle_sso::handle_sso(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__sso.html#a656c8cf420d6ca9f49156667151c4639',1,'nda::mem::handle_sso::handle_sso(long size)']]], - ['handle_5fstack_10',['handle_stack',['../structnda_1_1mem_1_1handle__stack.html',1,'nda::mem::handle_stack< T, Size >'],['../structnda_1_1mem_1_1handle__stack.html#a109e0d63f201bc4c7f98d1437f5b1d65',1,'nda::mem::handle_stack::handle_stack()=default'],['../structnda_1_1mem_1_1handle__stack.html#a7c00baad1e664d6c23d2b7ce5b3b1828',1,'nda::mem::handle_stack::handle_stack(handle_stack &&h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a7064f98ddbbe954eea70195d57346938',1,'nda::mem::handle_stack::handle_stack(handle_stack const &h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a73261a92e65f78db3b55b110a54bc578',1,'nda::mem::handle_stack::handle_stack(long, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__stack.html#a93adf9da541e76e115f9381dcffd1d5d',1,'nda::mem::handle_stack::handle_stack(long, init_zero_t)'],['../structnda_1_1mem_1_1handle__stack.html#a1b6fd5bbe9979f5ac278e4a813a133fc',1,'nda::mem::handle_stack::handle_stack(long)']]], - ['handles_11',['Handles',['../group__mem__handles.html',1,'']]], - ['has_5fc_5flayout_12',['has_C_layout',['../group__linalg__blas.html#ga24228d6ce4cd37cb84f967a933287d95',1,'nda::blas']]], - ['has_5fcontiguous_13',['has_contiguous',['../group__layout__utils.html#ga1d7ef293822e5f68be5fbd4e0c369937',1,'nda']]], - ['has_5fcontiguous_5flayout_14',['has_contiguous_layout',['../group__layout__utils.html#gac7d16d8a853591e7beb588629b58a846',1,'nda']]], - ['has_5ff_5flayout_15',['has_F_layout',['../group__linalg__blas.html#gaa270d9c3e10b12ca1406623ac3f93471',1,'nda::blas']]], - ['has_5flayout_5fsmallest_5fstride_5fis_5fone_16',['has_layout_smallest_stride_is_one',['../group__layout__utils.html#ga1ef7692c60ce001f192b006342be102b',1,'nda']]], - ['has_5flayout_5fstrided_5f1d_17',['has_layout_strided_1d',['../group__layout__utils.html#ga41ac3f557a1cd926fd51f611c2ecbfba',1,'nda']]], - ['has_5fpositive_5fstrides_18',['has_positive_strides',['../classnda_1_1basic__array.html#a716dd47a70116e99b508eff3bd658a55',1,'nda::basic_array::has_positive_strides()'],['../classnda_1_1basic__array__view.html#a228d9c682c7cc4be848275e1cf5cc42b',1,'nda::basic_array_view::has_positive_strides()'],['../classnda_1_1idx__map.html#a538420e44bfb0d1743266bf978ca485c',1,'nda::idx_map::has_positive_strides()']]], - ['has_5fsmallest_5fstride_5fis_5fone_19',['has_smallest_stride_is_one',['../group__layout__utils.html#gab24716de53fb29177b58627cc30f34b3',1,'nda']]], - ['has_5fstrided_5f1d_20',['has_strided_1d',['../group__layout__utils.html#ga2446a9e6ebbe07bc8733e92af41d93e1',1,'nda']]], - ['have_5fcompatible_5faddr_5fspace_21',['have_compatible_addr_space',['../group__mem__addrspcs.html#ga52e76a3017612d7b7f185a7c68aab304',1,'nda::mem']]], - ['have_5fcuda_22',['have_cuda',['../group__mem__utils.html#ga09b33840a06e6a7bf8a8cfee8ec152d7',1,'nda']]], - ['have_5fdevice_23',['have_device',['../group__mem__utils.html#ga332eb62504ae4f22585e078bc2e40568',1,'nda']]], - ['have_5fdevice_5fcompatible_5faddr_5fspace_24',['have_device_compatible_addr_space',['../group__mem__addrspcs.html#ga741fdd851fbcccbcd1a66c0016b6d0bd',1,'nda::mem']]], - ['have_5fhost_5fcompatible_5faddr_5fspace_25',['have_host_compatible_addr_space',['../group__mem__addrspcs.html#ga2b3d35f78473b4788004f10c135fe0df',1,'nda::mem']]], - ['have_5fsame_5faddr_5fspace_26',['have_same_addr_space',['../group__mem__addrspcs.html#gafda444b995c212e092735e1807446546',1,'nda::mem']]], - ['have_5fsame_5frank_5fv_27',['have_same_rank_v',['../group__av__utils.html#gaaa352089001205a56c1f801fdcb5e218',1,'nda']]], - ['have_5fsame_5fvalue_5ftype_5fv_28',['have_same_value_type_v',['../group__av__utils.html#ga62eb26ca688c9730a4590c264b51c64b',1,'nda']]], - ['hdf5_20support_29',['HDF5 support',['../group__av__hdf5.html',1,'']]], - ['heap_30',['heap',['../group__mem__pols.html#ga4c4f5b0a09f480782bf1353ca308e640',1,'nda']]], - ['heap_5fbasic_31',['heap_basic',['../structnda_1_1heap__basic.html',1,'nda']]], - ['histogram_32',['histogram',['../classnda_1_1mem_1_1stats.html#a2d8868aaf2e00f6bc7ded214870be5fc',1,'nda::mem::stats']]], - ['hyperslab_5fand_5fshape_5ffrom_5fslice_33',['hyperslab_and_shape_from_slice',['../group__av__hdf5.html#gab6fea3ef30e10b8ab043fe8fcfe26138',1,'nda']]] + ['hadamard_3',['hadamard',['../group__av__algs.html#ga9ee51842bd47f09b28d6d36cdf289b62',1,'nda::hadamard(A &&a, B &&b)'],['../group__av__algs.html#gad8886854a020e7b28b63a96d6087485d',1,'nda::hadamard(std::array< T, R > const &a, std::array< U, R > const &b)'],['../group__av__algs.html#ga3aec2e627c396aaeb87141efa7a49bc4',1,'nda::hadamard(std::vector< T > const &a, std::vector< U > const &b)'],['../group__av__algs.html#gac201e48555bdb773ad45706882e787b5',1,'nda::hadamard(nda::Scalar auto a, nda::Scalar auto b)']]], + ['handle_4',['handle',['../structnda_1_1heap__basic.html#a5d8ff05114dc8abc64de0f6b0ebda74a',1,'nda::heap_basic::handle'],['../structnda_1_1sso.html#ab22f2a384227ce8ae989d11296677614',1,'nda::sso::handle'],['../structnda_1_1stack.html#adc4ca01f24fbf6b0e9c7e0ff5fb152d4',1,'nda::stack::handle'],['../structnda_1_1shared.html#a862cd58ac2455a70eccc952a93ff719c',1,'nda::shared::handle'],['../structnda_1_1borrowed.html#ad6179beaa7b9c8da002fb3ad3cce04c1',1,'nda::borrowed::handle']]], + ['handle_2ehpp_5',['handle.hpp',['../handle_8hpp.html',1,'']]], + ['handle_5fborrowed_6',['handle_borrowed',['../structnda_1_1mem_1_1handle__borrowed.html',1,'nda::mem::handle_borrowed< T, AdrSp >'],['../structnda_1_1mem_1_1handle__borrowed.html#a5538f05cf62914934a85ec6c4044c9ba',1,'nda::mem::handle_borrowed::handle_borrowed()=default'],['../structnda_1_1mem_1_1handle__borrowed.html#ab66465f100d97213f16f42798e0bfb81',1,'nda::mem::handle_borrowed::handle_borrowed(handle_borrowed const &)=default'],['../structnda_1_1mem_1_1handle__borrowed.html#a1c11a8f6b756e57322547fce226edfff',1,'nda::mem::handle_borrowed::handle_borrowed(T *ptr) noexcept'],['../structnda_1_1mem_1_1handle__borrowed.html#a2d9c4a994942da7b8139b820cfd97a03',1,'nda::mem::handle_borrowed::handle_borrowed(H const &h, long offset=0) noexcept']]], + ['handle_5fheap_7',['handle_heap',['../structnda_1_1mem_1_1handle__heap.html',1,'nda::mem::handle_heap< T, A >'],['../structnda_1_1mem_1_1handle__heap.html#adedc0f42778a31dc30345dc405b01ad9',1,'nda::mem::handle_heap::handle_heap()=default'],['../structnda_1_1mem_1_1handle__heap.html#a477909753bc7f6288251b6dd20482d70',1,'nda::mem::handle_heap::handle_heap(handle_heap &&h) noexcept'],['../structnda_1_1mem_1_1handle__heap.html#ac88adb5f9b3775b8d3450fcfd002fcdc',1,'nda::mem::handle_heap::handle_heap(handle_heap const &h)'],['../structnda_1_1mem_1_1handle__heap.html#af870fc0652c8102d85412e9b7ce7ee22',1,'nda::mem::handle_heap::handle_heap(H const &h)'],['../structnda_1_1mem_1_1handle__heap.html#aa773a5e24ef1901230372e84eda31f6c',1,'nda::mem::handle_heap::handle_heap(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__heap.html#a545b2e0135f9d17df3e46e4494917a48',1,'nda::mem::handle_heap::handle_heap(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__heap.html#a86a57ea956e1d866d81bf38d04aeb0a0',1,'nda::mem::handle_heap::handle_heap(long size)']]], + ['handle_5fheap_3c_20t0_20_3e_8',['handle_heap< T0 >',['../structnda_1_1mem_1_1handle__heap.html',1,'nda::mem']]], + ['handle_5fshared_9',['handle_shared',['../structnda_1_1mem_1_1handle__shared.html',1,'nda::mem::handle_shared< T, AdrSp >'],['../structnda_1_1mem_1_1handle__shared.html#a1a266459c9fcddedbbe3043e5536cfb8',1,'nda::mem::handle_shared::handle_shared()=default'],['../structnda_1_1mem_1_1handle__shared.html#aaaf9c8b72e0ada692c924862dbe69f0c',1,'nda::mem::handle_shared::handle_shared(T *data, size_t size, void *foreign_handle, void(*foreign_decref)(void *)) noexcept'],['../structnda_1_1mem_1_1handle__shared.html#a18efbebe1b46a1f08ee8e45e7abed580',1,'nda::mem::handle_shared::handle_shared(handle_heap< T, A > const &h) noexcept']]], + ['handle_5fsso_10',['handle_sso',['../structnda_1_1mem_1_1handle__sso.html',1,'nda::mem::handle_sso< T, Size >'],['../structnda_1_1mem_1_1handle__sso.html#a1caa82b7f8bd340d1e9e1c7aecae1837',1,'nda::mem::handle_sso::handle_sso()'],['../structnda_1_1mem_1_1handle__sso.html#ab235e1b08c0f78a0768a8484aa35b732',1,'nda::mem::handle_sso::handle_sso(handle_sso &&h) noexcept'],['../structnda_1_1mem_1_1handle__sso.html#a65e3c814068e48281cb43a6104ecf23f',1,'nda::mem::handle_sso::handle_sso(handle_sso const &h)'],['../structnda_1_1mem_1_1handle__sso.html#ab27cde8796775cf351f73d0a6b9f2183',1,'nda::mem::handle_sso::handle_sso(H const &h)'],['../structnda_1_1mem_1_1handle__sso.html#a915e2503b739f86ecca2b5494fd0c24c',1,'nda::mem::handle_sso::handle_sso(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__sso.html#a9a8b4ad445c3e946f140fa2e246506c1',1,'nda::mem::handle_sso::handle_sso(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__sso.html#a656c8cf420d6ca9f49156667151c4639',1,'nda::mem::handle_sso::handle_sso(long size)']]], + ['handle_5fstack_11',['handle_stack',['../structnda_1_1mem_1_1handle__stack.html',1,'nda::mem::handle_stack< T, Size >'],['../structnda_1_1mem_1_1handle__stack.html#a109e0d63f201bc4c7f98d1437f5b1d65',1,'nda::mem::handle_stack::handle_stack()=default'],['../structnda_1_1mem_1_1handle__stack.html#a7c00baad1e664d6c23d2b7ce5b3b1828',1,'nda::mem::handle_stack::handle_stack(handle_stack &&h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a7064f98ddbbe954eea70195d57346938',1,'nda::mem::handle_stack::handle_stack(handle_stack const &h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a73261a92e65f78db3b55b110a54bc578',1,'nda::mem::handle_stack::handle_stack(long, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__stack.html#a93adf9da541e76e115f9381dcffd1d5d',1,'nda::mem::handle_stack::handle_stack(long, init_zero_t)'],['../structnda_1_1mem_1_1handle__stack.html#a1b6fd5bbe9979f5ac278e4a813a133fc',1,'nda::mem::handle_stack::handle_stack(long)']]], + ['handles_12',['Handles',['../group__mem__handles.html',1,'']]], + ['has_5fc_5flayout_13',['has_C_layout',['../group__linalg__blas.html#ga24228d6ce4cd37cb84f967a933287d95',1,'nda::blas']]], + ['has_5fcontiguous_14',['has_contiguous',['../group__layout__utils.html#ga1d7ef293822e5f68be5fbd4e0c369937',1,'nda']]], + ['has_5fcontiguous_5flayout_15',['has_contiguous_layout',['../group__layout__utils.html#gac7d16d8a853591e7beb588629b58a846',1,'nda']]], + ['has_5ff_5flayout_16',['has_F_layout',['../group__linalg__blas.html#gaa270d9c3e10b12ca1406623ac3f93471',1,'nda::blas']]], + ['has_5flayout_5fsmallest_5fstride_5fis_5fone_17',['has_layout_smallest_stride_is_one',['../group__layout__utils.html#ga1ef7692c60ce001f192b006342be102b',1,'nda']]], + ['has_5flayout_5fstrided_5f1d_18',['has_layout_strided_1d',['../group__layout__utils.html#ga41ac3f557a1cd926fd51f611c2ecbfba',1,'nda']]], + ['has_5fpositive_5fstrides_19',['has_positive_strides',['../classnda_1_1basic__array.html#a716dd47a70116e99b508eff3bd658a55',1,'nda::basic_array::has_positive_strides()'],['../classnda_1_1basic__array__view.html#a228d9c682c7cc4be848275e1cf5cc42b',1,'nda::basic_array_view::has_positive_strides()'],['../classnda_1_1idx__map.html#a538420e44bfb0d1743266bf978ca485c',1,'nda::idx_map::has_positive_strides()']]], + ['has_5fsmallest_5fstride_5fis_5fone_20',['has_smallest_stride_is_one',['../group__layout__utils.html#gab24716de53fb29177b58627cc30f34b3',1,'nda']]], + ['has_5fstrided_5f1d_21',['has_strided_1d',['../group__layout__utils.html#ga2446a9e6ebbe07bc8733e92af41d93e1',1,'nda']]], + ['have_5fcompatible_5faddr_5fspace_22',['have_compatible_addr_space',['../group__mem__addrspcs.html#ga52e76a3017612d7b7f185a7c68aab304',1,'nda::mem']]], + ['have_5fcuda_23',['have_cuda',['../group__mem__utils.html#ga09b33840a06e6a7bf8a8cfee8ec152d7',1,'nda']]], + ['have_5fdevice_24',['have_device',['../group__mem__utils.html#ga332eb62504ae4f22585e078bc2e40568',1,'nda']]], + ['have_5fdevice_5fcompatible_5faddr_5fspace_25',['have_device_compatible_addr_space',['../group__mem__addrspcs.html#ga741fdd851fbcccbcd1a66c0016b6d0bd',1,'nda::mem']]], + ['have_5fhost_5fcompatible_5faddr_5fspace_26',['have_host_compatible_addr_space',['../group__mem__addrspcs.html#ga2b3d35f78473b4788004f10c135fe0df',1,'nda::mem']]], + ['have_5fsame_5faddr_5fspace_27',['have_same_addr_space',['../group__mem__addrspcs.html#gafda444b995c212e092735e1807446546',1,'nda::mem']]], + ['have_5fsame_5frank_5fv_28',['have_same_rank_v',['../group__av__utils.html#gaaa352089001205a56c1f801fdcb5e218',1,'nda']]], + ['have_5fsame_5fvalue_5ftype_5fv_29',['have_same_value_type_v',['../group__av__utils.html#ga62eb26ca688c9730a4590c264b51c64b',1,'nda']]], + ['hdf5_20support_30',['HDF5 support',['../group__av__hdf5.html',1,'']]], + ['heap_31',['heap',['../group__mem__pols.html#ga4c4f5b0a09f480782bf1353ca308e640',1,'nda']]], + ['heap_5fbasic_32',['heap_basic',['../structnda_1_1heap__basic.html',1,'nda']]], + ['histogram_33',['histogram',['../classnda_1_1mem_1_1stats.html#a2d8868aaf2e00f6bc7ded214870be5fc',1,'nda::mem::stats']]], + ['hyperslab_5fand_5fshape_5ffrom_5fslice_34',['hyperslab_and_shape_from_slice',['../group__av__hdf5.html#gab6fea3ef30e10b8ab043fe8fcfe26138',1,'nda']]] ]; diff --git a/docs/unstable/search/functions_7.js b/docs/unstable/search/functions_7.js index a1d2cdd85..f21fc5480 100644 --- a/docs/unstable/search/functions_7.js +++ b/docs/unstable/search/functions_7.js @@ -2,15 +2,16 @@ var searchData= [ ['h5_5fread_0',['h5_read',['../group__av__hdf5.html#ga2bbce727dcb0638aac491a58bd2a6b28',1,'nda']]], ['h5_5fwrite_1',['h5_write',['../group__av__hdf5.html#ga45a1f6d57e999ad0cf8023e3d1b0ff2c',1,'nda::h5_write(h5::group g, std::string const &name, A const &a, bool compress=true)'],['../group__av__hdf5.html#gaa4dee39e09d66dbc7e09347ac8045475',1,'nda::h5_write(h5::group g, std::string const &name, A const &a, std::tuple< IRs... > const &slice)']]], - ['handle_5fborrowed_2',['handle_borrowed',['../structnda_1_1mem_1_1handle__borrowed.html#a5538f05cf62914934a85ec6c4044c9ba',1,'nda::mem::handle_borrowed::handle_borrowed()=default'],['../structnda_1_1mem_1_1handle__borrowed.html#ab66465f100d97213f16f42798e0bfb81',1,'nda::mem::handle_borrowed::handle_borrowed(handle_borrowed const &)=default'],['../structnda_1_1mem_1_1handle__borrowed.html#a1c11a8f6b756e57322547fce226edfff',1,'nda::mem::handle_borrowed::handle_borrowed(T *ptr) noexcept'],['../structnda_1_1mem_1_1handle__borrowed.html#a2d9c4a994942da7b8139b820cfd97a03',1,'nda::mem::handle_borrowed::handle_borrowed(H const &h, long offset=0) noexcept']]], - ['handle_5fheap_3',['handle_heap',['../structnda_1_1mem_1_1handle__heap.html#adedc0f42778a31dc30345dc405b01ad9',1,'nda::mem::handle_heap::handle_heap()=default'],['../structnda_1_1mem_1_1handle__heap.html#a477909753bc7f6288251b6dd20482d70',1,'nda::mem::handle_heap::handle_heap(handle_heap &&h) noexcept'],['../structnda_1_1mem_1_1handle__heap.html#ac88adb5f9b3775b8d3450fcfd002fcdc',1,'nda::mem::handle_heap::handle_heap(handle_heap const &h)'],['../structnda_1_1mem_1_1handle__heap.html#af870fc0652c8102d85412e9b7ce7ee22',1,'nda::mem::handle_heap::handle_heap(H const &h)'],['../structnda_1_1mem_1_1handle__heap.html#aa773a5e24ef1901230372e84eda31f6c',1,'nda::mem::handle_heap::handle_heap(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__heap.html#a545b2e0135f9d17df3e46e4494917a48',1,'nda::mem::handle_heap::handle_heap(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__heap.html#a86a57ea956e1d866d81bf38d04aeb0a0',1,'nda::mem::handle_heap::handle_heap(long size)']]], - ['handle_5fshared_4',['handle_shared',['../structnda_1_1mem_1_1handle__shared.html#a1a266459c9fcddedbbe3043e5536cfb8',1,'nda::mem::handle_shared::handle_shared()=default'],['../structnda_1_1mem_1_1handle__shared.html#aaaf9c8b72e0ada692c924862dbe69f0c',1,'nda::mem::handle_shared::handle_shared(T *data, size_t size, void *foreign_handle, void(*foreign_decref)(void *)) noexcept'],['../structnda_1_1mem_1_1handle__shared.html#a18efbebe1b46a1f08ee8e45e7abed580',1,'nda::mem::handle_shared::handle_shared(handle_heap< T, A > const &h) noexcept']]], - ['handle_5fsso_5',['handle_sso',['../structnda_1_1mem_1_1handle__sso.html#a1caa82b7f8bd340d1e9e1c7aecae1837',1,'nda::mem::handle_sso::handle_sso()'],['../structnda_1_1mem_1_1handle__sso.html#ab235e1b08c0f78a0768a8484aa35b732',1,'nda::mem::handle_sso::handle_sso(handle_sso &&h) noexcept'],['../structnda_1_1mem_1_1handle__sso.html#a65e3c814068e48281cb43a6104ecf23f',1,'nda::mem::handle_sso::handle_sso(handle_sso const &h)'],['../structnda_1_1mem_1_1handle__sso.html#ab27cde8796775cf351f73d0a6b9f2183',1,'nda::mem::handle_sso::handle_sso(H const &h)'],['../structnda_1_1mem_1_1handle__sso.html#a915e2503b739f86ecca2b5494fd0c24c',1,'nda::mem::handle_sso::handle_sso(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__sso.html#a9a8b4ad445c3e946f140fa2e246506c1',1,'nda::mem::handle_sso::handle_sso(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__sso.html#a656c8cf420d6ca9f49156667151c4639',1,'nda::mem::handle_sso::handle_sso(long size)']]], - ['handle_5fstack_6',['handle_stack',['../structnda_1_1mem_1_1handle__stack.html#a109e0d63f201bc4c7f98d1437f5b1d65',1,'nda::mem::handle_stack::handle_stack()=default'],['../structnda_1_1mem_1_1handle__stack.html#a7c00baad1e664d6c23d2b7ce5b3b1828',1,'nda::mem::handle_stack::handle_stack(handle_stack &&h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a7064f98ddbbe954eea70195d57346938',1,'nda::mem::handle_stack::handle_stack(handle_stack const &h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a73261a92e65f78db3b55b110a54bc578',1,'nda::mem::handle_stack::handle_stack(long, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__stack.html#a93adf9da541e76e115f9381dcffd1d5d',1,'nda::mem::handle_stack::handle_stack(long, init_zero_t)'],['../structnda_1_1mem_1_1handle__stack.html#a1b6fd5bbe9979f5ac278e4a813a133fc',1,'nda::mem::handle_stack::handle_stack(long)']]], - ['has_5fcontiguous_7',['has_contiguous',['../group__layout__utils.html#ga1d7ef293822e5f68be5fbd4e0c369937',1,'nda']]], - ['has_5fpositive_5fstrides_8',['has_positive_strides',['../classnda_1_1basic__array.html#a716dd47a70116e99b508eff3bd658a55',1,'nda::basic_array::has_positive_strides()'],['../classnda_1_1basic__array__view.html#a228d9c682c7cc4be848275e1cf5cc42b',1,'nda::basic_array_view::has_positive_strides()'],['../classnda_1_1idx__map.html#a538420e44bfb0d1743266bf978ca485c',1,'nda::idx_map::has_positive_strides()']]], - ['has_5fsmallest_5fstride_5fis_5fone_9',['has_smallest_stride_is_one',['../group__layout__utils.html#gab24716de53fb29177b58627cc30f34b3',1,'nda']]], - ['has_5fstrided_5f1d_10',['has_strided_1d',['../group__layout__utils.html#ga2446a9e6ebbe07bc8733e92af41d93e1',1,'nda']]], - ['histogram_11',['histogram',['../classnda_1_1mem_1_1stats.html#a2d8868aaf2e00f6bc7ded214870be5fc',1,'nda::mem::stats']]], - ['hyperslab_5fand_5fshape_5ffrom_5fslice_12',['hyperslab_and_shape_from_slice',['../group__av__hdf5.html#gab6fea3ef30e10b8ab043fe8fcfe26138',1,'nda']]] + ['hadamard_2',['hadamard',['../group__av__algs.html#ga9ee51842bd47f09b28d6d36cdf289b62',1,'nda::hadamard(A &&a, B &&b)'],['../group__av__algs.html#gad8886854a020e7b28b63a96d6087485d',1,'nda::hadamard(std::array< T, R > const &a, std::array< U, R > const &b)'],['../group__av__algs.html#ga3aec2e627c396aaeb87141efa7a49bc4',1,'nda::hadamard(std::vector< T > const &a, std::vector< U > const &b)'],['../group__av__algs.html#gac201e48555bdb773ad45706882e787b5',1,'nda::hadamard(nda::Scalar auto a, nda::Scalar auto b)']]], + ['handle_5fborrowed_3',['handle_borrowed',['../structnda_1_1mem_1_1handle__borrowed.html#a5538f05cf62914934a85ec6c4044c9ba',1,'nda::mem::handle_borrowed::handle_borrowed()=default'],['../structnda_1_1mem_1_1handle__borrowed.html#ab66465f100d97213f16f42798e0bfb81',1,'nda::mem::handle_borrowed::handle_borrowed(handle_borrowed const &)=default'],['../structnda_1_1mem_1_1handle__borrowed.html#a1c11a8f6b756e57322547fce226edfff',1,'nda::mem::handle_borrowed::handle_borrowed(T *ptr) noexcept'],['../structnda_1_1mem_1_1handle__borrowed.html#a2d9c4a994942da7b8139b820cfd97a03',1,'nda::mem::handle_borrowed::handle_borrowed(H const &h, long offset=0) noexcept']]], + ['handle_5fheap_4',['handle_heap',['../structnda_1_1mem_1_1handle__heap.html#adedc0f42778a31dc30345dc405b01ad9',1,'nda::mem::handle_heap::handle_heap()=default'],['../structnda_1_1mem_1_1handle__heap.html#a477909753bc7f6288251b6dd20482d70',1,'nda::mem::handle_heap::handle_heap(handle_heap &&h) noexcept'],['../structnda_1_1mem_1_1handle__heap.html#ac88adb5f9b3775b8d3450fcfd002fcdc',1,'nda::mem::handle_heap::handle_heap(handle_heap const &h)'],['../structnda_1_1mem_1_1handle__heap.html#af870fc0652c8102d85412e9b7ce7ee22',1,'nda::mem::handle_heap::handle_heap(H const &h)'],['../structnda_1_1mem_1_1handle__heap.html#aa773a5e24ef1901230372e84eda31f6c',1,'nda::mem::handle_heap::handle_heap(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__heap.html#a545b2e0135f9d17df3e46e4494917a48',1,'nda::mem::handle_heap::handle_heap(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__heap.html#a86a57ea956e1d866d81bf38d04aeb0a0',1,'nda::mem::handle_heap::handle_heap(long size)']]], + ['handle_5fshared_5',['handle_shared',['../structnda_1_1mem_1_1handle__shared.html#a1a266459c9fcddedbbe3043e5536cfb8',1,'nda::mem::handle_shared::handle_shared()=default'],['../structnda_1_1mem_1_1handle__shared.html#aaaf9c8b72e0ada692c924862dbe69f0c',1,'nda::mem::handle_shared::handle_shared(T *data, size_t size, void *foreign_handle, void(*foreign_decref)(void *)) noexcept'],['../structnda_1_1mem_1_1handle__shared.html#a18efbebe1b46a1f08ee8e45e7abed580',1,'nda::mem::handle_shared::handle_shared(handle_heap< T, A > const &h) noexcept']]], + ['handle_5fsso_6',['handle_sso',['../structnda_1_1mem_1_1handle__sso.html#a1caa82b7f8bd340d1e9e1c7aecae1837',1,'nda::mem::handle_sso::handle_sso()'],['../structnda_1_1mem_1_1handle__sso.html#ab235e1b08c0f78a0768a8484aa35b732',1,'nda::mem::handle_sso::handle_sso(handle_sso &&h) noexcept'],['../structnda_1_1mem_1_1handle__sso.html#a65e3c814068e48281cb43a6104ecf23f',1,'nda::mem::handle_sso::handle_sso(handle_sso const &h)'],['../structnda_1_1mem_1_1handle__sso.html#ab27cde8796775cf351f73d0a6b9f2183',1,'nda::mem::handle_sso::handle_sso(H const &h)'],['../structnda_1_1mem_1_1handle__sso.html#a915e2503b739f86ecca2b5494fd0c24c',1,'nda::mem::handle_sso::handle_sso(long size, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__sso.html#a9a8b4ad445c3e946f140fa2e246506c1',1,'nda::mem::handle_sso::handle_sso(long size, init_zero_t)'],['../structnda_1_1mem_1_1handle__sso.html#a656c8cf420d6ca9f49156667151c4639',1,'nda::mem::handle_sso::handle_sso(long size)']]], + ['handle_5fstack_7',['handle_stack',['../structnda_1_1mem_1_1handle__stack.html#a109e0d63f201bc4c7f98d1437f5b1d65',1,'nda::mem::handle_stack::handle_stack()=default'],['../structnda_1_1mem_1_1handle__stack.html#a7c00baad1e664d6c23d2b7ce5b3b1828',1,'nda::mem::handle_stack::handle_stack(handle_stack &&h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a7064f98ddbbe954eea70195d57346938',1,'nda::mem::handle_stack::handle_stack(handle_stack const &h) noexcept'],['../structnda_1_1mem_1_1handle__stack.html#a73261a92e65f78db3b55b110a54bc578',1,'nda::mem::handle_stack::handle_stack(long, do_not_initialize_t)'],['../structnda_1_1mem_1_1handle__stack.html#a93adf9da541e76e115f9381dcffd1d5d',1,'nda::mem::handle_stack::handle_stack(long, init_zero_t)'],['../structnda_1_1mem_1_1handle__stack.html#a1b6fd5bbe9979f5ac278e4a813a133fc',1,'nda::mem::handle_stack::handle_stack(long)']]], + ['has_5fcontiguous_8',['has_contiguous',['../group__layout__utils.html#ga1d7ef293822e5f68be5fbd4e0c369937',1,'nda']]], + ['has_5fpositive_5fstrides_9',['has_positive_strides',['../classnda_1_1basic__array.html#a716dd47a70116e99b508eff3bd658a55',1,'nda::basic_array::has_positive_strides()'],['../classnda_1_1basic__array__view.html#a228d9c682c7cc4be848275e1cf5cc42b',1,'nda::basic_array_view::has_positive_strides()'],['../classnda_1_1idx__map.html#a538420e44bfb0d1743266bf978ca485c',1,'nda::idx_map::has_positive_strides()']]], + ['has_5fsmallest_5fstride_5fis_5fone_10',['has_smallest_stride_is_one',['../group__layout__utils.html#gab24716de53fb29177b58627cc30f34b3',1,'nda']]], + ['has_5fstrided_5f1d_11',['has_strided_1d',['../group__layout__utils.html#ga2446a9e6ebbe07bc8733e92af41d93e1',1,'nda']]], + ['histogram_12',['histogram',['../classnda_1_1mem_1_1stats.html#a2d8868aaf2e00f6bc7ded214870be5fc',1,'nda::mem::stats']]], + ['hyperslab_5fand_5fshape_5ffrom_5fslice_13',['hyperslab_and_shape_from_slice',['../group__av__hdf5.html#gab6fea3ef30e10b8ab043fe8fcfe26138',1,'nda']]] ]; diff --git a/docs/unstable/search/functions_d.js b/docs/unstable/search/functions_d.js index 20580e877..59526a5a6 100644 --- a/docs/unstable/search/functions_d.js +++ b/docs/unstable/search/functions_d.js @@ -8,7 +8,7 @@ var searchData= ['operator_21_3d_5',['operator!=',['../classnda_1_1array__iterator.html#aa8ed532ebc2d8ad15ceaf7fd83770660',1,'nda::array_iterator::operator!=()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#a6f65e9fc6e76ca1957e3637228005360',1,'nda::array_iterator< 1, T, Pointer >::operator!=()']]], ['operator_26_6',['operator&',['../group__layout__utils.html#ga68e464683566699ffeecb191bbbd26fa',1,'nda::operator&(layout_prop_e lhs, layout_prop_e rhs)'],['../group__layout__utils.html#ga6ca72da0ad8b29fc125e0eb3ac1213a9',1,'nda::operator&(layout_info_t lhs, layout_info_t rhs)']]], ['operator_28_29_7',['operator()',['../structnda_1_1expr__call.html#a741e9884ed31b48fb51ed445db46d3e8',1,'nda::expr_call::operator()()'],['../structnda_1_1mapped.html#a47a0c578e7ab0ed58e5d2d5f1ca1f6a8',1,'nda::mapped::operator()()'],['../structnda_1_1conj__f.html#aad1b8f05cf585dc2c9c93cecb89d4619',1,'nda::conj_f::operator()()'],['../classnda_1_1basic__array.html#afd5e2d580b3de2b53a8550ea2bb32ec9',1,'nda::basic_array::operator()(_linear_index_t idx) const noexcept'],['../classnda_1_1basic__array.html#a68a7b1c66cebb72ffb9bc893d9419f20',1,'nda::basic_array::operator()(_linear_index_t idx) noexcept'],['../classnda_1_1basic__array.html#aede48d11646d617f63e192a2ae72a669',1,'nda::basic_array::operator()(Ts const &...idxs) const &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array.html#a69b27a5398829310d2d47663fb8cd659',1,'nda::basic_array::operator()(Ts const &...idxs) &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array.html#ad5395ea2478baf5c1a4ee78eef1cddaf',1,'nda::basic_array::operator()(Ts const &...idxs) &&noexcept(has_no_boundcheck)'],['../structnda_1_1expr__unary.html#a53a14614d4500b87a77a73e8c81f7792',1,'nda::expr_unary::operator()()'],['../structnda_1_1expr.html#ace28351da246baaa9e83e4ea8f2b6476',1,'nda::expr::operator()()'],['../classnda_1_1array__adapter.html#a6da7cb0261e2b7e01913120378717e90',1,'nda::array_adapter::operator()()'],['../classnda_1_1basic__array__view.html#a8bf1595081e087e2f2640e2771d29aeb',1,'nda::basic_array_view::operator()(_linear_index_t idx) const noexcept'],['../classnda_1_1basic__array__view.html#a6ae5e6ef1c303aa220bb65d1e595dcb3',1,'nda::basic_array_view::operator()(_linear_index_t idx) noexcept'],['../classnda_1_1basic__array__view.html#a8d630334727e3ff9192d395700af88c6',1,'nda::basic_array_view::operator()(Ts const &...idxs) const &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array__view.html#a39c5f396cd87423d953e632c4c46e5f7',1,'nda::basic_array_view::operator()(Ts const &...idxs) &noexcept(has_no_boundcheck)'],['../classnda_1_1basic__array__view.html#ae9e0d656c99d4bc754ba5bf55d96c34c',1,'nda::basic_array_view::operator()(Ts const &...idxs) &&noexcept(has_no_boundcheck)'],['../structnda_1_1clef_1_1evaluator.html#a17b42b4ec3748a2168930de52f14e32f',1,'nda::clef::evaluator::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01placeholder_3_01N_01_4_00_01pair_3_01Is_00_01Ts_01_4_8_8_8_01_4.html#a805361372dd59ea80496376b2075d38e',1,'nda::clef::evaluator< placeholder< N >, pair< Is, Ts >... >::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01std_1_1reference__wrapper_3_01T_01_4_00_01Pairs_8_8_8_01_4.html#a5709746c74940f8cbdd4715fe3e1e6db',1,'nda::clef::evaluator< std::reference_wrapper< T >, Pairs... >::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01expr_3_01Tag_00_01Childs_8_8_8_01_4_00_01Pairs_8_8_8_01_4.html#adb0e994415a3c364ea2258d3d0c9ee42',1,'nda::clef::evaluator< expr< Tag, Childs... >, Pairs... >::operator()()'],['../structnda_1_1clef_1_1expr.html#afdf8fc34e5f34d7ff957c2a99a7c4cbe',1,'nda::clef::expr::operator()()'],['../structnda_1_1clef_1_1make__fun__impl.html#af9013b53bbed9c8b9983c2da6bed6810',1,'nda::clef::make_fun_impl::operator()()'],['../structnda_1_1clef_1_1evaluator_3_01make__fun__impl_3_01T_00_01Is_8_8_8_01_4_00_01Pairs_8_8_8_01_4.html#a241b49e0c7b4ed69e6b60b030f10bbaf',1,'nda::clef::evaluator< make_fun_impl< T, Is... >, Pairs... >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1terminal_01_4.html#a359d36ac2e8a80ee6a9a7407baaa302f',1,'nda::clef::operation< tags::terminal >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1function_01_4.html#a38c84964bc4bd1b751d96fe3bacfa9de',1,'nda::clef::operation< tags::function >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1subscript_01_4.html#aa650f785cf7dfb631bca35a4d8d6f28b',1,'nda::clef::operation< tags::subscript >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1plus_01_4.html#aa5fef986df5bfcfb4fac586038eca74e',1,'nda::clef::operation< tags::plus >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1minus_01_4.html#aab81ed897df8d285ef079658dfcea06f',1,'nda::clef::operation< tags::minus >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1multiplies_01_4.html#a7e21f9a9bc83f556b7477b28b20f89f4',1,'nda::clef::operation< tags::multiplies >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1divides_01_4.html#a0b3ffd3f64f46cc5ed56e5c8f077eafd',1,'nda::clef::operation< tags::divides >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1greater_01_4.html#a0313324ad507bc55d9cf257699aa2368',1,'nda::clef::operation< tags::greater >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1less_01_4.html#a9d9753439825fdc6b39e600946299117',1,'nda::clef::operation< tags::less >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1leq_01_4.html#a9bc654dd1d593473d99944c2b331fcec',1,'nda::clef::operation< tags::leq >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1geq_01_4.html#a693455debd0003b2c6c1c064ab90dfbd',1,'nda::clef::operation< tags::geq >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1eq_01_4.html#a0d71d8d21e82e3d4de1b83749a74c3a0',1,'nda::clef::operation< tags::eq >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1unaryplus_01_4.html#a46827ad694f387556cfb05bb0fd0529e',1,'nda::clef::operation< tags::unaryplus >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1negate_01_4.html#a13b922e733529f78b7453342fd4cd534',1,'nda::clef::operation< tags::negate >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1loginot_01_4.html#a06ba94650ba7ac83250dd850cc74710f',1,'nda::clef::operation< tags::loginot >::operator()()'],['../structnda_1_1clef_1_1operation_3_01tags_1_1if__else_01_4.html#aa308451c9109ad1645ec3f29936c4d76',1,'nda::clef::operation< tags::if_else >::operator()()'],['../structnda_1_1clef_1_1placeholder.html#a9176cd8bd502430b7604078a8c35396b',1,'nda::clef::placeholder::operator()()'],['../classnda_1_1lapack_1_1gelss__worker.html#ae0a4cab3deb38bab3038b58851941600',1,'nda::lapack::gelss_worker::operator()(matrix_const_view< T > B, std::optional< long >={}) const'],['../classnda_1_1lapack_1_1gelss__worker.html#a6775670c0781714e0d62d3a3e742fc4c',1,'nda::lapack::gelss_worker::operator()(vector_const_view< T > b, std::optional< long >={}) const'],['../structnda_1_1lapack_1_1gelss__worker__hermitian.html#aa644455b19e4cdc962d8e82c41787fa8',1,'nda::lapack::gelss_worker_hermitian::operator()()'],['../classnda_1_1idx__map.html#a0b06eac006dea6bf1dae630087f0b693',1,'nda::idx_map::operator()()'],['../structnda_1_1operation.html#a32f1f27ecb00219f98d6101db7344146',1,'nda::operation::operator()()']]], - ['operator_2a_8',['operator*',['../classnda_1_1array__iterator.html#ab2170aa0ce489e7ebb6fbbb9cda52a0b',1,'nda::array_iterator::operator*()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#aa700540657d68317d98da26c85e7651c',1,'nda::array_iterator< 1, T, Pointer >::operator*()'],['../structnda_1_1operation.html#a914b1e93c801621791883e7307c64f56',1,'nda::operation::operator*()'],['../group__av__ops.html#ga99b0f013ecf0a681b982e18407b2605b',1,'nda::operator*(L &&l, R &&r)'],['../group__av__ops.html#gad7faac0d1f858667bb8460cb24ef2ca5',1,'nda::operator*(A &&a, S &&s)'],['../group__av__ops.html#ga67a055fb687f8946c02fcd489013e194',1,'nda::operator*(S &&s, A &&a)'],['../group__clef__expr.html#gac978aeae0e098854b22faed551f55d0b',1,'nda::clef::operator*()'],['../group__utils__std.html#ga150bf6446a518f7929c3b77eb01831e3',1,'std::operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)'],['../group__utils__std.html#ga811f3de76af8953ea07be27bd75cd1fa',1,'std::operator*(T s, std::array< T, R > const &a)'],['../group__utils__std.html#ga073562363f858235479b35707b89f2f7',1,'std::operator*(std::complex< T > const &x, U y)'],['../group__utils__std.html#gae5f3b5487d0dafb7b238e935c97bad0b',1,'std::operator*(T x, std::complex< U > const &y)'],['../group__utils__std.html#ga3dcc9bd7f252ccab3d08cbf04ff51b4d',1,'std::operator*(std::complex< T > const &x, std::complex< U > const &y)']]], + ['operator_2a_8',['operator*',['../classnda_1_1array__iterator.html#ab2170aa0ce489e7ebb6fbbb9cda52a0b',1,'nda::array_iterator::operator*()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#aa700540657d68317d98da26c85e7651c',1,'nda::array_iterator< 1, T, Pointer >::operator*()'],['../structnda_1_1operation.html#a914b1e93c801621791883e7307c64f56',1,'nda::operation::operator*()'],['../group__av__ops.html#ga99b0f013ecf0a681b982e18407b2605b',1,'nda::operator*(L &&l, R &&r)'],['../group__av__ops.html#gad7faac0d1f858667bb8460cb24ef2ca5',1,'nda::operator*(A &&a, S &&s)'],['../group__av__ops.html#ga67a055fb687f8946c02fcd489013e194',1,'nda::operator*(S &&s, A &&a)'],['../group__clef__expr.html#gac978aeae0e098854b22faed551f55d0b',1,'nda::clef::operator*()'],['../group__utils__std.html#ga123c9c27f42fa662b906d6312f2ac57c',1,'std::operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)'],['../group__utils__std.html#ga811f3de76af8953ea07be27bd75cd1fa',1,'std::operator*(T s, std::array< T, R > const &a)'],['../group__utils__std.html#ga073562363f858235479b35707b89f2f7',1,'std::operator*(std::complex< T > const &x, U y)'],['../group__utils__std.html#gae5f3b5487d0dafb7b238e935c97bad0b',1,'std::operator*(T x, std::complex< U > const &y)'],['../group__utils__std.html#ga3dcc9bd7f252ccab3d08cbf04ff51b4d',1,'std::operator*(std::complex< T > const &x, std::complex< U > const &y)']]], ['operator_2a_3d_9',['operator*=',['../classnda_1_1basic__array.html#ae37d092bc5eaed902eb8ec5ba15af641',1,'nda::basic_array::operator*=()'],['../classnda_1_1basic__array__view.html#a90e27ffa2cde5484451e35140a83a658',1,'nda::basic_array_view::operator*=()']]], ['operator_2b_10',['operator+',['../group__av__ops.html#ga0e020426887be8ac9d2a18b96acb2d06',1,'nda::operator+(L &&l, R &&r)'],['../group__av__ops.html#gac0598e71d9a03e7fe29ee703cf0284a0',1,'nda::operator+(A &&a, S &&s)'],['../group__av__ops.html#ga62cb5f1c89a42b0b34e431c2e4a3fdef',1,'nda::operator+(S &&s, A &&a)'],['../group__clef__expr.html#ga4c5021bcdfd094832ae680bd85f80eb3',1,'nda::clef::operator+(L &&l, R &&r)'],['../group__clef__expr.html#ga50a49f8c0f2fe891c2d425d4c5811629',1,'nda::clef::operator+(L &&l)'],['../group__utils__std.html#ga4402967146599c40ebbb648249c4a5f6',1,'std::operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)'],['../group__utils__std.html#ga7f3edec88edd9eac10597c9fb85883ac',1,'std::operator+(std::complex< T > const &x, U y)'],['../group__utils__std.html#gaff7123f20bcd76b9240caa4f627c9b28',1,'std::operator+(T x, std::complex< U > const &y)'],['../group__utils__std.html#ga235ace931d1a620e7e8191b0205829f4',1,'std::operator+(std::complex< T > const &x, std::complex< U > const &y)']]], ['operator_2b_2b_11',['operator++',['../classnda_1_1array__iterator.html#af4fe77db9873e9f68a1718d463f3c1c3',1,'nda::array_iterator::operator++()'],['../classnda_1_1array__iterator.html#a30fe3b76caac790c833c8103648811bc',1,'nda::array_iterator::operator++(int)'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#a7a78ccda3bd77158508634080489be11',1,'nda::array_iterator< 1, T, Pointer >::operator++()'],['../classnda_1_1array__iterator_3_011_00_01T_00_01Pointer_01_4.html#aa806fb334f3c22a43854bceda5d21657',1,'nda::array_iterator< 1, T, Pointer >::operator++(int)']]], diff --git a/docs/unstable/slice__static_8hpp_source.html b/docs/unstable/slice__static_8hpp_source.html index 0dc2e5800..86b725762 100644 --- a/docs/unstable/slice__static_8hpp_source.html +++ b/docs/unstable/slice__static_8hpp_source.html @@ -150,7 +150,7 @@
37#include "./bound_check_worker.hpp"
38#endif
39
-
40namespace nda {
+
40namespace nda {
41
42 /// @cond
43 // Forward declarations.
@@ -160,7 +160,7 @@
47
48} // namespace nda
49
-
50namespace nda::slice_static {
+
50namespace nda::slice_static {
51
52 /**
53 * @addtogroup layout_idx
@@ -626,6 +626,7 @@
idx_map(std::array< long, R > const &)
Construct a new map with a shape of a different rank.
Definition idx_map.hpp:435
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -705,25 +706,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/stdutil_2concepts_8hpp_source.html b/docs/unstable/stdutil_2concepts_8hpp_source.html index 4ac7400f0..86b056315 100644 --- a/docs/unstable/stdutil_2concepts_8hpp_source.html +++ b/docs/unstable/stdutil_2concepts_8hpp_source.html @@ -151,6 +151,7 @@
38#endif
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int get_ld(A const &a)
Get the leading dimension in LAPACK jargon of an nda::MemoryMatrix.
Definition tools.hpp:109
static constexpr bool has_C_layout
Constexpr variable that is true if the given nda::Array type has a C memory layout.
Definition tools.hpp:76
static constexpr bool is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
Definition tools.hpp:52
diff --git a/docs/unstable/sum_8hpp_source.html b/docs/unstable/sum_8hpp_source.html index b2652b69b..a3cc0332a 100644 --- a/docs/unstable/sum_8hpp_source.html +++ b/docs/unstable/sum_8hpp_source.html @@ -138,7 +138,7 @@
25#include "../basic_functions.hpp"
26#include "../exceptions.hpp"
27
-
28namespace nda::clef {
+
28namespace nda::clef {
29
30 /**
31 * @addtogroup clef_expr
@@ -481,6 +481,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -602,25 +603,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75
diff --git a/docs/unstable/sym__grp_8hpp_source.html b/docs/unstable/sym__grp_8hpp_source.html index 8293ac964..274aca597 100644 --- a/docs/unstable/sym__grp_8hpp_source.html +++ b/docs/unstable/sym__grp_8hpp_source.html @@ -147,7 +147,7 @@
34#include <type_traits>
35#include <vector>
36
-
37namespace nda {
+
37namespace nda {
38
39 /**
40 * @addtogroup av_sym
@@ -512,6 +512,7 @@
sym_grp(A const &a, std::vector< F > const &sym_list, long const max_length=0)
Construct a symmetry group for a given array and a list of its symmetries.
Definition sym_grp.hpp:295
sym_grp()=default
Default constructor for a symmetry group.
static constexpr int ndims
Rank of the input array.
Definition sym_grp.hpp:148
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
bool is_valid(A const &a, std::array< long, static_cast< std::size_t >(get_rank< A >)> const &idx)
Check if a multi-dimensional index is valid, i.e. not out of bounds, w.r.t. to a given nda::Array obj...
Definition sym_grp.hpp:88
A structure to capture combinations of complex conjugation and sign flip operations.
Definition sym_grp.hpp:47
bool sgn
Boolean value indicating a sign flip operation.
Definition sym_grp.hpp:49
diff --git a/docs/unstable/tools_8hpp_source.html b/docs/unstable/tools_8hpp_source.html index cb837ae0f..2cc60ba36 100644 --- a/docs/unstable/tools_8hpp_source.html +++ b/docs/unstable/tools_8hpp_source.html @@ -143,7 +143,7 @@
30#include <type_traits>
31#include <utility>
32
-
33namespace nda {
+
33namespace nda {
34
35 /**
36 * @ingroup linalg_blas
@@ -153,7 +153,7 @@
40
41} // namespace nda
42
-
43namespace nda::blas {
+
43namespace nda::blas {
44
45 /**
46 * @addtogroup linalg_blas
@@ -250,6 +250,7 @@
127} // namespace nda::blas
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int get_ld(A const &a)
Get the leading dimension in LAPACK jargon of an nda::MemoryMatrix.
Definition tools.hpp:109
static constexpr bool has_C_layout
Constexpr variable that is true if the given nda::Array type has a C memory layout.
Definition tools.hpp:76
static constexpr bool is_conj_array_expr
Constexpr variable that is true if the given type is a conjugate lazy expression.
Definition tools.hpp:52
diff --git a/docs/unstable/traits_8hpp_source.html b/docs/unstable/traits_8hpp_source.html index d6f1f308d..56aeb5ccc 100644 --- a/docs/unstable/traits_8hpp_source.html +++ b/docs/unstable/traits_8hpp_source.html @@ -140,7 +140,7 @@
27#include <type_traits>
28#include <utility>
29
-
30namespace nda {
+
30namespace nda {
31
32 /**
33 * @addtogroup utils_type_traits
@@ -477,6 +477,7 @@
350} // namespace nda
#define CUBLAS_CHECK(X,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
constexpr bool is_regular_v
Constexpr variable that is true if type A is a regular array, i.e. an nda::basic_array.
Definition traits.hpp:145
constexpr char get_algebra
Constexpr variable that specifies the algebra of a type.
Definition traits.hpp:126
constexpr bool is_matrix_or_view_v
Constexpr variable that is true if type A is a regular matrix or a view of a matrix.
Definition traits.hpp:167
diff --git a/docs/unstable/ungqr_8hpp_source.html b/docs/unstable/ungqr_8hpp_source.html index 4efcf51e8..c516facbe 100644 --- a/docs/unstable/ungqr_8hpp_source.html +++ b/docs/unstable/ungqr_8hpp_source.html @@ -148,7 +148,7 @@
35#include <complex>
36#include <type_traits>
37
-
38namespace nda::lapack {
+
38namespace nda::lapack {
39
40 /**
41 * @ingroup linalg_lapack
@@ -192,7 +192,7 @@
78 int bufferSize = static_cast<int>(std::ceil(std::real(bufferSize_T)));
79
80 // allocate work buffer and perform actual library call
-
81 nda::array<value_type, 1, C_layout, heap<mem::get_addr_space<A>>> work(bufferSize);
+
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);
83
84 if (info) NDA_RUNTIME_ERROR << "Error in nda::lapack::ungqr: info = " << info;
@@ -202,6 +202,7 @@
87
88} // namespace nda::lapack
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
int ungqr(A &&a, TAU &&tau)
Interface to the LAPACK ungqr routine.
Definition ungqr.hpp:63
#define EXPECTS(X)
Definition macros.hpp:59
Contiguous layout policy with C-order (row-major order).
Definition policies.hpp:47
diff --git a/docs/unstable/utils_8hpp_source.html b/docs/unstable/utils_8hpp_source.html index a9ae06f41..ecc73fa0b 100644 --- a/docs/unstable/utils_8hpp_source.html +++ b/docs/unstable/utils_8hpp_source.html @@ -138,7 +138,7 @@
25#include <functional>
26#include <type_traits>
27
-
28namespace nda::clef {
+
28namespace nda::clef {
29
30 /**
31 * @addtogroup clef_utils
@@ -413,6 +413,7 @@
static basic_array rand(std::array< Int, Rank > const &shape)
Make a random-initialized array with the given shape.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
diff --git a/docs/unstable/vector_8hpp_source.html b/docs/unstable/vector_8hpp_source.html index afbcd5eb4..c9e51a576 100644 --- a/docs/unstable/vector_8hpp_source.html +++ b/docs/unstable/vector_8hpp_source.html @@ -139,7 +139,7 @@
26#include <utility>
27#include <vector>
28
-
29namespace nda::clef {
+
29namespace nda::clef {
30
31 /**
32 * @addtogroup clef_autoassign
@@ -431,6 +431,7 @@
stats()=default
Default constructor.
#define CUSOLVER_CHECK(X, info,...)
#define NDA_RUNTIME_ERROR
+
constexpr auto hadamard(nda::Scalar auto a, nda::Scalar auto b)
Hadamard product of two arithmetic types.
auto rand(std::array< Int, Rank > const &shape)
Make an array of the given shape and initialize it with random values from the uniform distribution o...
decltype(auto) make_regular(A &&a)
Make a given object regular.
void resize_or_check_if_view(A &a, std::array< long, A::rank > const &sha)
Resize a given regular array to the given shape or check if a given view as the correct shape.
@@ -536,25 +537,25 @@
constexpr std::array< int, N > cycle(int p, int pos=N)
Perform a forward (partial) cyclic permutation of the identity p times.
constexpr std::array< Int, N > compose(std::array< Int, N > const &p1, std::array< Int, N > const &p2)
Composition of two permutations.
constexpr std::array< T, N > apply(std::array< Int, N > const &p, std::array< T, N > const &a)
Apply a permutation to a std::array.
-
constexpr std::array< T, R > operator*(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:115
-
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:278
-
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:214
-
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:232
-
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:264
+
constexpr auto operator*(std::array< T, R > const &lhs, std::array< U, R > const &rhs)
Multiply two std::array objects element-wise.
Definition array.hpp:116
+
constexpr std::array< T, R - N > front_mpop(std::array< T, R > const &a)
Make a new std::array by popping the first N elements of an existing std::array.
Definition array.hpp:281
+
constexpr std::array< T, R+1 > append(std::array< T, R > const &a, U const &x)
Make a new std::array by appending one element at the end to an existing std::array.
Definition array.hpp:217
+
constexpr std::array< T, R+1 > front_append(std::array< T, R > const &a, U const &x)
Make a new std::array by prepending one element at the front to an existing std::array.
Definition array.hpp:235
+
constexpr std::array< T, R - 1 > pop(std::array< T, R > const &a)
Make a new std::array by popping the last element of an existing std::array.
Definition array.hpp:267
constexpr std::array< T, R > operator+(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Add two std::array objects element-wise.
Definition array.hpp:83
-
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:130
-
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.
Definition array.hpp:309
-
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:146
-
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:197
-
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:165
-
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:326
+
constexpr std::array< T, R > operator-(std::array< T, R > const &a)
Negate a std::array element-wise (unary minus).
Definition array.hpp:133
+
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.
Definition array.hpp:312
+
constexpr std::array< T, R > operator*(T s, std::array< T, R > const &a)
Multiply a scalar and a std::array element-wise.
Definition array.hpp:149
+
constexpr std::vector< T > to_vector(std::array< T, R > const &a)
Convert a std::array to a std::vector.
Definition array.hpp:200
+
constexpr std::array< T, R > make_initialized_array(T v)
Create a new std::array object initialized with a specific value.
Definition array.hpp:168
+
constexpr auto sum(std::array< T, R > const &a)
Calculate the sum of all elements in a std::array.
Definition array.hpp:329
std::string to_string(std::array< T, R > const &a)
Get a string representation of a std::array.
Definition array.hpp:65
constexpr std::array< T, R > operator-(std::array< T, R > const &lhs, std::array< T, R > const &rhs)
Subtract two std::array objects element-wise.
Definition array.hpp:99
-
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:181
-
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:293
-
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:345
-
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:366
-
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:249
+
constexpr std::array< T, R > make_std_array(std::array< U, R > const &a)
Convert a std::array with value type U to a std::array with value type T.
Definition array.hpp:184
+
constexpr std::array< T, R - 1 > front_pop(std::array< T, R > const &a)
Make a new std::array by popping the first element of an existing std::array.
Definition array.hpp:296
+
constexpr auto product(std::array< T, R > const &a)
Calculate the product of all elements in a std::array.
Definition array.hpp:348
+
constexpr auto dot_product(std::array< T, R > const &a1, std::array< U, R > const &a2)
Calculate the dot product of two std::array objects.
Definition array.hpp:369
+
constexpr std::array< T, R - N > mpop(std::array< T, R > const &a)
Make a new std::array by popping the last N elements of an existing std::array.
Definition array.hpp:252
#define EXPECTS(X)
Definition macros.hpp:59
#define FORCEINLINE
Definition macros.hpp:41
#define EXPECTS_WITH_MESSAGE(X,...)
Definition macros.hpp:75