function y = mult_E22(x, QC1, QC2, mC, nC, ...
   QD1, QD2, mD, nD, w)
% Called by wls.m during Conjugate Gradient interations.
%
% Compute the product y = E22 x.

% Break x into pieces.
x2 = x(1 : nC*(mD-nD));
x3 = x(nC*(mD-nD) + (1 : (mC-nC)*nD));
x4 = x(nC*(mD-nD) + (mC-nC)*nD + 1 : mC*mD-nC*nD);

% Compute z's.
z2 = KPmult(QC1, QD2, x2);
z3 = KPmult(QC2, QD1, x3);
z4 = KPmult(QC2, QD2, x4);
z = w .* (z2 + z3 + z4);

% Compute y's.
y2 = KPmultT(QC1, QD2, z);
y3 = KPmultT(QC2, QD1, z);
y4 = KPmultT(QC2, QD2, z);

% Form y.
y = [y2; y3; y4];
