function z=v2g(x,G);
% z=v2g(x,G)
% takes a vector 
% x and places out the elements on the appropriate places in
% G
% z result of the same size as G
[nrow,ncol]=size(G);
[ir ic iel]=find(sparse(G));
z=full(sparse(ir,ic,x(iel),nrow,ncol));
