Home > manopt > tools > tangentorthobasis.m

tangentorthobasis

PURPOSE ^

Returns an orthonormal basis of tangent vectors in the Manopt framework.

SYNOPSIS ^

function orthobasis = tangentorthobasis(M, x, n)

DESCRIPTION ^

 Returns an orthonormal basis of tangent vectors in the Manopt framework.

 function orthobasis = tangentorthobasis(M, x)
 function orthobasis = tangentorthobasis(M, x, n)

 M is a Manopt manifold structure obtained from a factory.
 x is a point on the manifold M.
 n (optional) is the dimension of the random subspace to span; by default,
   n = M.dim() so that the returned basis spans the whole tangent space.

 orthobasis is a cell of n tangent vectors at x.
 With high probability, they form an orthonormal basis of the tangent
 space at x. If necessary, this can be checked by calling
   G = grammatrix(orthobasis)
 and verifying that G is invertible.

 See also: grammatrix orthogonalize lincomb plotprofile

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function orthobasis = tangentorthobasis(M, x, n)
0002 % Returns an orthonormal basis of tangent vectors in the Manopt framework.
0003 %
0004 % function orthobasis = tangentorthobasis(M, x)
0005 % function orthobasis = tangentorthobasis(M, x, n)
0006 %
0007 % M is a Manopt manifold structure obtained from a factory.
0008 % x is a point on the manifold M.
0009 % n (optional) is the dimension of the random subspace to span; by default,
0010 %   n = M.dim() so that the returned basis spans the whole tangent space.
0011 %
0012 % orthobasis is a cell of n tangent vectors at x.
0013 % With high probability, they form an orthonormal basis of the tangent
0014 % space at x. If necessary, this can be checked by calling
0015 %   G = grammatrix(orthobasis)
0016 % and verifying that G is invertible.
0017 %
0018 % See also: grammatrix orthogonalize lincomb plotprofile
0019 
0020 % This file is part of Manopt: www.manopt.org.
0021 % Original author: Nicolas Boumal, April 28, 2016.
0022 % Contributors:
0023 % Change log:
0024 
0025     dim = M.dim();
0026     if ~exist('n', 'var') || isempty(n)
0027         n = dim;
0028     end
0029     assert(n >= 0 && n <= dim && n == round(n), ...
0030            'n must be an integer between 0 and M.dim().');
0031     
0032     basis = cell(n, 1);
0033     
0034     % With high probability, n vectors taken at random in the tangent space
0035     % are linearly independent.
0036     for k = 1 : n
0037         basis{k} = M.randvec(x);
0038     end
0039     
0040     % The Gram-Schmidt process transforms any n linearly independent
0041     % vectors into n orthonormal vectors spanning the same subspace.
0042     orthobasis = orthogonalize(M, x, basis);
0043     
0044 end

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