Files
cppdraft_translate/cppdraft/linalg/conj/conjugated.md
2025-10-25 03:02:53 +03:00

2.5 KiB
Raw Blame History

[linalg.conj.conjugated]

29 Numerics library [numerics]

29.9 Basic linear algebra algorithms [linalg]

29.9.9 Conjugated in-place transformation [linalg.conj]

29.9.9.3 Function template conjugated [linalg.conj.conjugated]

🔗

template<class ElementType, class Extents, class Layout, class Accessor> constexpr auto [conjugated](#lib:conjugated "29.9.9.3Function template conjugated[linalg.conj.conjugated]")(mdspan<ElementType, Extents, Layout, Accessor> a);

1

#

Let A be

remove_cvref_t<decltype(a.accessor().nested_accessor())> if Accessor is a specialization of conjugated_accessor;

otherwise,Accessor if remove_cvref_t is an arithmetic type;

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;;

otherwise,Accessor.

2

#

Returns: Let MD be mdspan<typename A::element_type, Extents, Layout, A>.

MD(a.data_handle(), a.mapping(), a.accessor().nested_accessor()) if Accessor is a
specialization of conjugated_accessor;

otherwise,a, if is_same_v<A, Accessor> is true;

otherwise,MD(a.data_handle(), a.mapping(), conjugated_accessor(a.accessor())).

3

#

[Example 1: void test_conjugated_complex(mdspan<complex, extents<int, 10>> 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<double, extents<int, 10>> 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]