int M = r-1;
initMatrices(M);
double beta = 2.5;
BlockMatrix64F Ab = BlockMatrixOps.convert(A.getMatrix(),r);
BlockMatrix64F Aw = BlockMatrixOps.convert(W.getMatrix(),r);
// need to extract only the elements in W that are currently being used when
// computing the expected Z
W = W.extractMatrix(0,W.numRows(),0,M);
SimpleMatrix T = SimpleMatrix.random(M,1,-1,1,rand);
// -beta * (V + W*T)
SimpleMatrix expected = V.plus(W.mult(T)).scale(-beta);
BlockHouseHolder.computeZ(r,new D1Submatrix64F(Ab,0, A.numRows(), 0, r),new D1Submatrix64F(Aw,0, A.numRows(), 0, r),
M,T.getMatrix().data,beta);
for( int i = 0; i < A.numRows(); i++ ) {
assertEquals(expected.get(i),Aw.get(i,M),1e-8);
}
}