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

1.9 KiB

[linalg.conjtransposed]

29 Numerics library [numerics]

29.9 Basic linear algebra algorithms [linalg]

29.9.11 Conjugate transpose in-place transform [linalg.conjtransposed]

1

#

The conjugate_transposed function returns a conjugate transpose view of an object.

This combines the effects of transposed and conjugated.

🔗

template<class ElementType, class Extents, class Layout, class Accessor> constexpr auto conjugate_transposed(mdspan<ElementType, Extents, Layout, Accessor> a);

2

#

Effects: Equivalent to: return conjugated(transposed(a));

3

#

[Example 1: void test_conjugate_transposed(mdspan<complex, extents<size_t, 3, 4>> a) {const auto num_rows = a.extent(0); const auto num_cols = a.extent(1); auto a_ct = conjugate_transposed(a); assert(num_rows == a_ct.extent(1)); assert(num_cols == a_ct.extent(0)); assert(a.stride(0) == a_ct.stride(1)); assert(a.stride(1) == a_ct.stride(0)); for (size_t row = 0; row < num_rows; ++row) {for (size_t col = 0; col < num_rows; ++col) { assert(a[row, col] == conj(a_ct[col, row])); }}auto a_ct_ct = conjugate_transposed(a_ct); assert(num_rows == a_ct_ct.extent(0)); assert(num_cols == a_ct_ct.extent(1)); assert(a.stride(0) == a_ct_ct.stride(0)); assert(a.stride(1) == a_ct_ct.stride(1)); for (size_t row = 0; row < num_rows; ++row) {for (size_t col = 0; col < num_rows; ++col) { assert(a[row, col] == a_ct_ct[row, col]); assert(conj(a_ct[col, row]) == a_ct_ct[row, col]); }}} — end example]