setIdImagReal

Define transformation operators to identify real and complex vectors/matrices.

Contents

Syntax

seti = setIdImagReal(seti)

Description

seti = setIdImagReal(seti adds to struct seti seti.S and seti.T to identify real and complex vectors/matrices (S maps C to R x R and T maps R x R to C) as well as auxiliary functions seti.R and seti.I to extract the real and imaginary part.

Input Arguments

Output Arguments

More About:

The transformation operators are, see Section 4.5 in [1]:

For $y = (y^{\mathrm{real}},y^{\mathrm{imag}})$ the auxiliary functions are defined as:

References

See Also

Code

function seti = setIdImagReal(seti)
% Identification of imaginary vector with real (and inverse), i.e.
% for real and complex vectors: S: C -> R x R and T: R x R -> C.
%
% Notation:
% hs = h_S = [hr;hi] = [real(h); imag(h)];
% hr = h_R, hi = h_I
% h = hz (complex)

seti.S = @(hz) [real(hz); imag(hz)]; % S: C -> R x R
% More about seti.S:
% real and imag part as vector (V): S: h |-> [hr; hi] (C -> R x R)
% (vector or matrix possible)

seti.R = @(hs) hs(1:size(hs,1)/2,:,:,:); % real (R) part
% (real part is stored in the first half of real vector hs)

seti.I = @(hs) hs(size(hs,1)/2+1:size(hs,1),:,:,:); % imag (I) part
% (imaginary part is stored in the second part of real vector hs)

% More about seti.R and seti.I:
% * Note that size(hs,1) is faster than end
%   (when you have matrices with 3 dimensions).
% * Note that R and I have 4 input arguments
%   because the matrix gu to store grad(u) has 4 dimensions in case of 3D.

seti.T = @(hs) seti.R(hs) + 1i.*seti.I(hs); % T: R x R -> C
% More about seti.T:
% real(h) + i imag(h): T: hs |-> real + 1i imag (R x R -> C)
% (vector or matrix possible)

% Connection of S, T, R and I:
% hs = S(hz); hz = T(hz); hr = R(hs); hi = I(hs)

end