3.8 KiB
[linalg.conj.conjugatedaccessor]
29 Numerics library [numerics]
29.9 Basic linear algebra algorithms [linalg]
29.9.9 Conjugated in-place transformation [linalg.conj]
29.9.9.2 Class template conjugated_accessor [linalg.conj.conjugatedaccessor]
The class template conjugated_accessor is an mdspan accessor policy which upon access produces conjugate elements.
It is part of the implementation ofconjugated ([linalg.conj.conjugated]).
namespace std::linalg {templateclass conjugated_accessor {public:using element_type = add_const_t<decltype(conj-if-needed(declvalNestedAccessor::element_type()))>; using reference = remove_const_t<element_type>; using data_handle_type = typename NestedAccessor::data_handle_type; using offset_policy = conjugated_accessorNestedAccessor::offset_policy; constexpr conjugated_accessor() = default; templateexplicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>>)constexpr conjugated_accessor(const conjugated_accessor& other); constexpr reference access(data_handle_type p, size_t i) const; constexpr typename offset_policy::data_handle_type offset(data_handle_type p, size_t i) const; constexpr const NestedAccessor& nested_accessor() const noexcept { return nested-accessor_; }private: NestedAccessor nested-accessor_{}; // exposition only};}
Mandates:
element_type is valid and denotes a type,
is_copy_constructible_v is true,
is_reference_v<element_type> is false, and
NestedAccessor meets the accessor policy requirements ([mdspan.accessor.reqmts]).
constexpr conjugated_accessor(const NestedAccessor& acc);
Effects: Direct-non-list-initializesnested-accessor_ with acc.
template<class OtherNestedAccessor> explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>>) constexpr conjugated_accessor(const conjugated_accessor<OtherNestedAccessor>& other);
Constraints: is_constructible_v<NestedAccessor, const OtherNestedAccessor&> is true.
Effects: Direct-non-list-initializes nested-accessor_ with other.nested_accessor().
constexpr reference access(data_handle_type p, size_t i) const;
Returns: conj-if-needed(NestedAccessor::element_type(nested-accessor_.access(p, i)))
constexpr typename offset_policy::data_handle_type offset(data_handle_type p, size_t i) const;
Returns: nested-accessor_.offset(p, i)