Home > manopt > manifolds > euclidean > euclideancomplexfactory.m

euclideancomplexfactory

PURPOSE ^

Returns a manifold struct to optimize over complex m-by-n matrices.

SYNOPSIS ^

function M = euclideancomplexfactory(m, n)

DESCRIPTION ^

 Returns a manifold struct to optimize over complex m-by-n matrices.

 function M = euclideancomplexfactory(m, n)

 Returns M, a structure describing the vector space of complex m-by-n
 matrices, as a manifold for Manopt.

 The complex plane is here viewed as R^2. The inner product between two
 m-by-n matrices A and B is given by: real(trace(A'*B)). This choice
 guides the proper definition of gradient and Hessian for this geometry.
 This is not the classical Euclidean inner product for complex matrices;
 it is a real inner product.

 See also: euclideanfactory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function M = euclideancomplexfactory(m, n)
0002 % Returns a manifold struct to optimize over complex m-by-n matrices.
0003 %
0004 % function M = euclideancomplexfactory(m, n)
0005 %
0006 % Returns M, a structure describing the vector space of complex m-by-n
0007 % matrices, as a manifold for Manopt.
0008 %
0009 % The complex plane is here viewed as R^2. The inner product between two
0010 % m-by-n matrices A and B is given by: real(trace(A'*B)). This choice
0011 % guides the proper definition of gradient and Hessian for this geometry.
0012 % This is not the classical Euclidean inner product for complex matrices;
0013 % it is a real inner product.
0014 %
0015 % See also: euclideanfactory
0016 
0017 % This file is part of Manopt: www.manopt.org.
0018 % Original author: Nicolas Boumal, April 7, 2015.
0019 % Contributors:
0020 % Change log:
0021 
0022     
0023     if ~exist('n', 'var') || isempty(n)
0024         n = 1;
0025     end
0026 
0027     M.name = @() sprintf('Vector space C^(%dx%d)', m, n);
0028     
0029     M.dim = @() 2*m*n;
0030     
0031     M.inner = @(x, d1, d2) real(d1(:)'*d2(:));
0032     
0033     M.norm = @(x, d) norm(d, 'fro');
0034     
0035     M.dist = @(x, y) norm(x-y, 'fro');
0036     
0037     M.typicaldist = @() sqrt(m*n);
0038     
0039     M.proj = @(x, d) d;
0040     
0041     M.egrad2rgrad = @(x, g) g;
0042     
0043     M.ehess2rhess = @(x, eg, eh, d) eh;
0044     
0045     M.tangent = M.proj;
0046     
0047     M.exp = @exp;
0048     function y = exp(x, d, t)
0049         if nargin == 3
0050             y = x + t*d;
0051         else
0052             y = x + d;
0053         end
0054     end
0055     
0056     M.retr = M.exp;
0057     
0058     M.log = @(x, y) y-x;
0059 
0060     M.hash = @(x) ['z' hashmd5([real(x(:)) ; imag(x(:))])];
0061     
0062     M.rand = @() (randn(m, n) + 1i*randn(m, n))/sqrt(2);
0063     
0064     M.randvec = @randvec;
0065     function u = randvec(x) %#ok<INUSD>
0066         u = randn(m, n) + 1i*randn(m, n);
0067         u = u / norm(u, 'fro');
0068     end
0069     
0070     M.lincomb = @matrixlincomb;
0071     
0072     M.zerovec = @(x) zeros(m, n);
0073     
0074     M.transp = @(x1, x2, d) d;
0075     
0076     M.pairmean = @(x1, x2) .5*(x1+x2);
0077     
0078     mn = m*n;
0079     M.vec = @(x, u_mat) [real(u_mat(:)) ; imag(u_mat(:))];
0080     M.mat = @(x, u_vec) reshape(u_vec(1:mn), [m, n]) + 1i*reshape(u_vec((mn+1):end), [m, n]);
0081     M.vecmatareisometries = @() true;
0082 
0083 end

Generated on Sat 12-Nov-2016 14:11:22 by m2html © 2005