// Start computing Wu = (YT*Cu*Y + lambda*I) = (YT*Y + YT*(Cu-I)*Y + lambda*I),
// by first starting with a copy of YT * Y. Or, a variant on YT * Y, if LOSS_IGNORES_UNSPECIFIED is set
RealMatrix Wu =
LOSS_IGNORES_UNSPECIFIED ?
partialTransposeTimesSelf(Y, YTY.getRowDimension(), ru.keySetIterator()) :
YTY.copy();
double[][] WuData = MatrixUtils.accessMatrixDataDirectly(Wu);
double[] YTCupu = new double[features];