Home > manopt > manifolds > euclidean > constantfactory.m

constantfactory

PURPOSE ^

Returns a manifold struct representing the singleton.

SYNOPSIS ^

function M = constantfactory(A)

DESCRIPTION ^

 Returns a manifold struct representing the singleton.

 function M = constantfactory(A)

 Given an array A, returns M: a structure describing the singleton {A} as
 a zero-dimensional manifold suitable for Manopt. The only point on M is
 the array A, and the only tangent vector at A is the zero-array of the
 same size as A.

 This is a helper factory which can be used to fix certain values in an
 optimization problem, in conjunction with productmanifold.

 See also: productmanifold euclideanfactory

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function M = constantfactory(A)
0002 % Returns a manifold struct representing the singleton.
0003 %
0004 % function M = constantfactory(A)
0005 %
0006 % Given an array A, returns M: a structure describing the singleton {A} as
0007 % a zero-dimensional manifold suitable for Manopt. The only point on M is
0008 % the array A, and the only tangent vector at A is the zero-array of the
0009 % same size as A.
0010 %
0011 % This is a helper factory which can be used to fix certain values in an
0012 % optimization problem, in conjunction with productmanifold.
0013 %
0014 % See also: productmanifold euclideanfactory
0015 
0016 % This file is part of Manopt: www.manopt.org.
0017 % Original author: Nicolas Boumal, March 15, 2018.
0018 % Contributors:
0019 % Change log:
0020     
0021     M.name = @() 'Singleton manifold';
0022     
0023     M.dim = @() 0;
0024     
0025     M.inner = @(x, d1, d2) 0;
0026     
0027     M.norm = @(x, d) 0;
0028     
0029     M.dist = @(x, y) 0;
0030     
0031     M.typicaldist = @() 0;
0032     
0033     M.proj = @(x, d) zeros(size(A));
0034     
0035     M.egrad2rgrad = @(x, g) zeros(size(A));
0036     
0037     M.ehess2rhess = @(x, eg, eh, d) zeros(size(A));
0038     
0039     M.tangent = M.proj;
0040     
0041     M.exp = @(x, d, t) A;
0042     
0043     M.retr = M.exp;
0044     
0045     M.log = @(x, y) zeros(size(A));
0046 
0047     M.hash = @(x) 'z1';
0048     
0049     M.rand = @() A;
0050     
0051     M.randvec = @(x) zeros(size(A));
0052     
0053     M.lincomb = @matrixlincomb;
0054     
0055     M.zerovec = @(x) zeros(size(A));
0056     
0057     M.transp = @(x1, x2, d) zeros(size(A));
0058     
0059     M.pairmean = @(x1, x2) A;
0060     
0061     M.vec = @(x, u_mat) u_mat(:);
0062     M.mat = @(x, u_vec) reshape(u_vec, dimensions_vec);
0063     M.vecmatareisometries = @() true;
0064 
0065 end

Generated on Fri 30-Sep-2022 13:18:25 by m2html © 2005