tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
conjugated.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_LINALG_CONJUGATED_HPP
4#define TETL_LINALG_CONJUGATED_HPP
5
10
11namespace etl::linalg {
12
14template <typename ElementType, typename Extents, typename Layout, typename Accessor>
16{
19 a.data_handle(),
20 a.mapping(),
21 a.accessor(),
22 };
23 } else {
24 using element_type = typename accessor_conjugate<Accessor>::element_type;
25 using accessor_type = accessor_conjugate<Accessor>;
26
28 a.data_handle(),
29 a.mapping(),
30 accessor_type(a.accessor()),
31 };
32 }
33}
34
36template <typename ElementType, typename Extents, typename Layout, typename NestedAccessor>
37[[nodiscard]] constexpr auto conjugated(mdspan<ElementType, Extents, Layout, accessor_conjugate<NestedAccessor>> a)
38{
39 using element_type = typename NestedAccessor::element_type;
40 using accessor_type = NestedAccessor;
41
43 a.data_handle(),
44 a.mapping(),
45 a.accessor().nested_accessor(),
46 };
47}
48
49} // namespace etl::linalg
50
51#endif // TETL_LINALG_CONJUGATED_HPP
constexpr auto conjugated(mdspan< ElementType, Extents, Layout, Accessor > a)
Definition conjugated.hpp:15
Definition accessor_conjugate.hpp:12
constexpr bool is_arithmetic_v
Definition is_arithmetic.hpp:21
Definition accessor_conjugate.hpp:16
add_const_t< conditional_t< is_arithmetic_v< remove_cv_t< typename Accessor::element_type > >, typename Accessor::element_type, typename reference::value_type > > element_type
Definition accessor_conjugate.hpp:21
Definition mdspan.hpp:38