[linalg.conj.conjugated] # 29 Numerics library [[numerics]](./#numerics) ## 29.9 Basic linear algebra algorithms [[linalg]](linalg#conj.conjugated) ### 29.9.9 Conjugated in-place transformation [[linalg.conj]](linalg.conj#conjugated) #### 29.9.9.3 Function template conjugated [linalg.conj.conjugated] [🔗](#itemdecl:1) ` template constexpr auto [conjugated](#lib:conjugated "29.9.9.3 Function template conjugated [linalg.conj.conjugated]")(mdspan a); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12875) Let A be - [(1.1)](#1.1) remove_cvref_t if Accessor is a specialization of conjugated_accessor; - [(1.2)](#1.2) otherwise,Accessor if remove_cvref_t is an arithmetic type; - [(1.3)](#1.3) otherwise,conjugated_accessor if the expression conj(E) is valid for any subexpression E whose type is remove_cvref_t with overload resolution performed in a context that includes the declarationtemplate U conj(const U&) = delete;; - [(1.4)](#1.4) otherwise,Accessor[.](#1.sentence-1) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12896) *Returns*: Let MD be mdspan[.](#2.sentence-1) - [(2.1)](#2.1) MD(a.data_handle(), a.mapping(), a.accessor().nested_accessor()) if Accessor is a specialization of conjugated_accessor; - [(2.2)](#2.2) otherwise,a, if is_same_v is true; - [(2.3)](#2.3) otherwise,MD(a.data_handle(), a.mapping(), conjugated_accessor(a.accessor())). [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L12912) [*Example [1](#example-1)*: void test_conjugated_complex(mdspan, extents> a) {auto a_conj = conjugated(a); for (int i = 0; i < a.extent(0); ++i) { assert(a_conj[i] == conj(a[i]); }auto a_conj_conj = conjugated(a_conj); for (int i = 0; i < a.extent(0); ++i) { assert(a_conj_conj[i] == a[i]); }}void test_conjugated_real(mdspan> a) {auto a_conj = conjugated(a); for (int i = 0; i < a.extent(0); ++i) { assert(a_conj[i] == a[i]); }auto a_conj_conj = conjugated(a_conj); for (int i = 0; i < a.extent(0); ++i) { assert(a_conj_conj[i] == a[i]); }} — *end example*]