function varargout = geomean2(varargin) %GEOMEAN2 Nonlinear operator in YALMIP % % t = GEOMEAN2(X) % % For Hermitian matrix X, returns det(X)^(1/(2^ceil(log2(length(X))))) % % For real vector X, returns prod(X)^(1/(2^ceil(log2(length(X))))) % % This concave function is monotonically growing in det(P) % for P>0, so it can be used for maximizing det(P), % or to add lower bound constraints on the determinant. % % When GEOMEAN2 is used in a problem, the domain constraint % set(X>0) is automatically added to the problem. % % Note that the function is the geometric mean of % the elements (or eigenvalues) if the dimension of % X is a power of 2, hence the name GEOMEAN2. % % See also SDPVAR, SDPVAR/GEOMEAN, SUMK, SUMABSK % Author Johan Löfberg % $Id: geomean2.m,v 1.1 2006/03/30 13:36:39 joloef Exp $ switch class(varargin{1}) case 'double' % What is the numerical value of this argument (needed for displays etc) X = varargin{1}; [n,m] = size(X); if min(n,m)==1 varargout{1} = prod(X)^(1/(2^ceil(log2(length(X))))); else if norm(X-X')