Home > manopt > autodiff > functions_AD > cmat2col.m

cmat2col

PURPOSE ^

Converts X into a column vector

SYNOPSIS ^

function Xcol = cmat2col(X)

DESCRIPTION ^

 Converts X into a column vector

 function Xcol = cmat2col(X)

 Returns X(:) where the input X can be either a numeric array or a 
 struct with fields real and imag.

 See also: manoptADhelp

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function Xcol = cmat2col(X)
0002 % Converts X into a column vector
0003 %
0004 % function Xcol = cmat2col(X)
0005 %
0006 % Returns X(:) where the input X can be either a numeric array or a
0007 % struct with fields real and imag.
0008 %
0009 % See also: manoptADhelp
0010 
0011 % This file is part of Manopt: www.manopt.org.
0012 % Original author: Xiaowen Jiang, July. 31, 2021.
0013 % Contributors: Nicolas Boumal
0014 % Change log:
0015 
0016     if iscstruct(X)
0017         Xreal = X.real;
0018         Ximag = X.imag;
0019         Xcol.real = Xreal(:);
0020         Xcol.imag = Ximag(:);
0021     elseif isnumeric(X)
0022         Xcol = X(:);
0023     else
0024         ME = MException('cmat2col:inputError', ...
0025                         'Input does not have the expected format.');
0026         throw(ME);
0027     end
0028     
0029 end

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