ctranspose!

ctranspose!(dest,src)

Conjugate transpose array src and store the result in the preallocated array dest, which should have a size corresponding to (size(src,2),size(src,1)). No in-place transposition is supported and unexpected results will happen if src and dest have overlapping memory regions.

Examples

  1. Conjugate transpose a matrix:

    julia> A = [1+2im 3+4im; 5+6im 7+8im];
    julia> B = similar(A, (size(A, 2), size(A, 1)));
    julia> ctranspose!(B, A)
    2×2 Array{Complex{Int64},2}:
    1-2im  5-6im
    3-4im  7-8im

    This example computes the conjugate transpose of matrix A and stores the result in preallocated matrix B.

  2. Transpose a real-valued matrix:

    julia> C = [1 2 3; 4 5 6];
    julia> D = similar(C, (size(C, 2), size(C, 1)));
    julia> ctranspose!(D, C)
    3×2 Array{Int64,2}:
    1  4
    2  5
    3  6

    Here, the function transposes the real-valued matrix C and stores the result in the preallocated matrix D.

  3. Handle complex conjugate transpose of a vector:
    julia> v = [1+2im, 3+4im, 5+6im];
    julia> w = similar(v, (size(v, 2), size(v, 1)));
    julia> ctranspose!(w, v)
    3×1 Array{Complex{Int64},2}:
    1-2im
    3-4im
    5-6im

    This example demonstrates the conjugate transpose of a complex vector v and stores the result in the preallocated vector w.

Note: It is important to allocate the destination array dest properly with dimensions (size(src, 2), size(src, 1)) to hold the transposed elements. Also, ensure that src and dest do not have overlapping memory regions to avoid unexpected results.

See Also

abs2, beta, binomial, ceil, cell, cross, ctranspose, ctranspose!, cummin, cumprod, cumprod!, cumsum, cumsum!, cumsum_kbn, div, divrem, eigfact, eigfact!, eigmin, eps, erf, erfc, erfcinv, erfcx, erfi, erfinv, exp, exp10, exp2, expm1, exponent, factor, factorial, factorize, floor, gcd, invmod, log, log10, log1p, log2, logspace, max, min, mod, mod1, modf, next, nextpow, nextprod, num, primes, primesmask, prod, realmin, sqrt, sum!, sumabs, sumabs!, sumabs2, sumabs2!,

User Contributed Notes

Add a Note

The format of note supported is markdown, use triple backtick to start and end a code block.

*Required Field
Details

Checking you are not a robot: