% This computes function value for IPM_AK. 
%
% Jan 12, 2012

function [fval, KtinvX, invX] = function_value(X,w,K,mu)

[V,D] = svd(X);
invX = V*diag(diag(D).^(-1))*V';
KtinvX = K'*invX;
D = svd(KtinvX*K);

fval = sum(D) - mu*sum(log(w)) - mu*log(1 - sum(w));

