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
-
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-8imThis example computes the conjugate transpose of matrix
Aand stores the result in preallocated matrixB. -
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 6Here, the function transposes the real-valued matrix
Cand stores the result in the preallocated matrixD. - 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-6imThis example demonstrates the conjugate transpose of a complex vector
vand stores the result in the preallocated vectorw.
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.