Here you can find the source of normalizeRows(float[][] input)
public static void normalizeRows(float[][] input)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w . j a v a 2 s . c o m * Normalizes each row in a matrix, in place. */ public static void normalizeRows(float[][] input) { for (int i = 0; i < input.length; ++i) { normalize(input[i]); } } /** * Normalizes the given input in place to make it unit length. */ public static void normalize(float[] input) { double normSq = 0; for (int i = 0; i < input.length; ++i) { normSq += input[i] * input[i]; } float norm = (float) Math.sqrt(normSq); for (int i = 0; i < input.length; ++i) { input[i] = input[i] / norm; } } }