function [ v ] = Atz(z, K, H, R, dt, nt, mt, rho )
%
% Evaluate v =A'*z where A is the matrix in the regularized least squares problem
%
% Matthias Heinkenschloss
% Jan 9, 2017 (revised Jan 14, 2020)

v  = zeros(size(K,2),1);
mh = size(H,1);

I = speye(size(K,1));

for j = mt:-1:1
    v = v + H'*z((j-1)*mh+1:j*mh);
    for i = nt/mt:-1:1
        v  = (I-(0.5*dt)*K)' \ v;
        v  = (I+(0.5*dt)*K)'*v; 
    end
end

v = v + sqrt(rho)*(R'*z(mt*mh+1:end));

