Computes the complex conjugate of x function xconj = cconj(x) Returns the complex conjugate of x. The input can be either a numeric array or a struct with fields real and imag. See also: manoptADhelp
0001 function xconj = cconj(x) 0002 % Computes the complex conjugate of x 0003 % 0004 % function xconj = cconj(x) 0005 % 0006 % Returns the complex conjugate of x. The input can be either a numeric 0007 % array or a 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 xconj.real = x.real; 0018 xconj.imag = -x.imag; 0019 elseif isnumeric(x) 0020 xconj = conj(x); 0021 else 0022 ME = MException('cconj:inputError', ... 0023 'Input does not have the expected format.'); 0024 throw(ME); 0025 end 0026 0027 end