% This computes gradient for IPM_D.
%
% Jan 12, 2012

function [g,invX] = gradient(X,w,MA,mu,blk)

m = size(w,1);
n = size(X,1);

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

g = MA'*(-svec(blk,invX)) - mu*1./w + mu/(1-sum(w))*ones(m,1);

