int[] dimWVWHH = { m, r };
SparseMatrix matrixVWH = new SparseMatrix(dimVWH);
SparseMatrix matrixWVWHH = new SparseMatrix(dimWVWHH);
SparseMatrix matrixWH = w.mutiplyMatrix(h);
TLongFloatIterator itV = v.vector.iterator();
TLongFloatIterator itW = w.vector.iterator();
for (int i = v.vector.size(); i-- > 0;) {
itV.advance();
matrixVWH.set(itV.key(),
itV.value() / (matrixWH.elementAt(itV.key()) + eps));
}
SparseMatrix matrixTranH = h.trans();
SparseMatrix matrixVWHH = matrixVWH.mutiplyMatrix(matrixTranH);
for (int i = w.vector.size(); i-- > 0;) {
itW.advance();
matrixWVWHH.set(itW.key(),
itW.value() * matrixVWHH.elementAt(itW.key()));
}
return matrixWVWHH;
}