4#ifndef TETL_LINALG_BLAS1_SWAP_ELEMENTS_HPP
5#define TETL_LINALG_BLAS1_SWAP_ELEMENTS_HPP
7#include <etl/_contracts/check.hpp>
8#include <etl/_linalg/concepts.hpp>
9#include <etl/_utility/cmp_less.hpp>
10#include <etl/_utility/swap.hpp>
15template <inout_object InOutObj1, inout_object InOutObj2>
16 requires(InOutObj1::rank() == InOutObj1::rank())
19 TETL_PRECONDITION(x.extents() == y.extents());
21 using size_type = detail::common_size_type_t<InOutObj1, InOutObj2>;
23 if constexpr (InOutObj1::rank() == 1) {
24 for (size_type i{0};
etl::cmp_less(i, x.extent(0)); ++i) {
29 static_assert(InOutObj1::rank() == 2);
30 for (size_type i{0};
etl::cmp_less(i, x.extent(0)); ++i) {
31 for (size_type j{0};
etl::cmp_less(j, x.extent(1)); ++j) {
33 swap(x(i, j), y(i, j));
constexpr auto swap_elements(InOutObj1 x, InOutObj2 y) -> void
Definition blas1_swap_elements.hpp:17
Definition accessor_conjugate.hpp:13
Definition adjacent_find.hpp:9