/** * Normalizes the matrix such that the Frobenius norm is equal to one. * * @param A The matrix that is to be normalized. */ public static void normalizeF(DMatrixRMaj A) { double val = normF(A); if (val == 0) { return; } int size = A.getNumElements(); for (int i = 0; i < size; i++) { A.div(i, val); } }