function s = lusolZt(Z,t)

%        s = lusolZt(Z,t);
% takes an n-vector t and computes s = Z'*t,
% where Z satisfies S'*Z = 0.
% If t = S*u say, we will have s = Z'*S*u = 0.

% 15 Dec 2015: First working version of lusolZt.

r    = Z.lu.rank;
n    = length(t);
b    = Z.Rinv*t;
if ~Z.trans
    p    = Z.lu.p;
    s    = Z.lu.solveL(b);
    s    = s(p);
else
    q    = Z.lu.q;
    b    = b(q);
    s    = Z.Utri'\b;
end
s    = [sparse(r,1); s(r+1:n)];