Beispiel #1
0
        /**
         * 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(FMatrixRMaj A)
        {
            float val = normF(A);

            if (val == 0)
            {
                return;
            }

            int size = A.getNumElements();

            for (int i = 0; i < size; i++)
            {
                A.div(i, val);
            }
        }