[linalg.conj.conjugatedaccessor]

# 29 Numerics library [[numerics]](./#numerics)

## 29.9 Basic linear algebra algorithms [[linalg]](linalg#conj.conjugatedaccessor)

### 29.9.9 Conjugated in-place transformation [[linalg.conj]](linalg.conj#conjugatedaccessor)

#### 29.9.9.2 Class template conjugated_accessor [linalg.conj.conjugatedaccessor]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12765)

The class template conjugated_accessor is an mdspan accessor policy
which upon access produces conjugate elements[.](#1.sentence-1)

It is part of the implementation ofconjugated ([[linalg.conj.conjugated]](linalg.conj.conjugated "29.9.9.3 Function template conjugated"))[.](#1.sentence-2)

namespace std::linalg {template<class NestedAccessor>class [conjugated_accessor](#lib:conjugated_accessor "29.9.9.2 Class template conjugated_­accessor [linalg.conj.conjugatedaccessor]") {public:using element_type = add_const_t<decltype(*conj-if-needed*(declval<NestedAccessor::element_type>()))>; using reference = remove_const_t<element_type>; using data_handle_type = typename NestedAccessor::data_handle_type; using offset_policy = conjugated_accessor<NestedAccessor::offset_policy>; constexpr conjugated_accessor() = default; template<class OtherNestedAccessor>explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>>)constexpr conjugated_accessor(const conjugated_accessor<OtherNestedAccessor>& 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*};}

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12801)

*Mandates*: 

- [(2.1)](#2.1)

element_type is valid and denotes a type,

- [(2.2)](#2.2)

is_copy_constructible_v<reference> is true,

- [(2.3)](#2.3)

is_reference_v<element_type> is false, and

- [(2.4)](#2.4)

NestedAccessor meets the accessor policy requirements ([[mdspan.accessor.reqmts]](mdspan.accessor.reqmts "23.7.3.5.2 Requirements"))[.](#2.sentence-1)

[ð](#lib:conjugated_accessor,constructor)

`constexpr conjugated_accessor(const NestedAccessor& acc);
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12820)

*Effects*: Direct-non-list-initializes*nested-accessor_* with acc[.](#3.sentence-1)

[ð](#lib:conjugated_accessor,constructor_)

`template<class OtherNestedAccessor>
  explicit(!is_convertible_v<OtherNestedAccessor, NestedAccessor>>)
    constexpr conjugated_accessor(const conjugated_accessor<OtherNestedAccessor>& other);
`

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12834)

*Constraints*: is_constructible_v<NestedAccessor, const OtherNestedAccessor&> is true[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12839)

*Effects*: Direct-non-list-initializes *nested-accessor_* with other.nested_accessor()[.](#5.sentence-1)

[ð](#lib:conjugated_accessor,access)

`constexpr reference access(data_handle_type p, size_t i) const;
`

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12851)

*Returns*: *conj-if-needed*(NestedAccessor​::​element_type(*nested-accessor_*.access(p, i)))

[ð](#lib:conjugated_accessor,offset)

`constexpr typename offset_policy::data_handle_type offset(data_handle_type p, size_t i) const;
`

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12862)

*Returns*: *nested-accessor_*.offset(p, i)
