function W=sample_singular_Inv_wishart(Sigma,v)
% Copyright (c) 2013-2018, Francesco Corsello, All Rights Reserved.
%p=rank(Sigma);
S=geninv(Sigma);
p=rank(S);
[US,LS]=eigg(S,p); 
dLS=sqrt(vec(diag(LS)));
Z_til=normrnd(zeros(v*p,1),repmat(dLS,v,1));
Z=US*reshape(Z_til,p,v);
WW=geninv(Z*Z');
[lW,dW]=eigg(WW,p);
W=lW*abs(dW)*lW';
