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

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

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

KXK = KtinvX'*KtinvX;

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

