Here you can find the source of norm(double[] vector)
public static double norm(double[] vector)
//package com.java2s; // it under the terms of the GNU Lesser General Public License as published by public class Main { public static double norm(double[] vector) { double result = 0.0; for (int i = 0; i < vector.length; i++) { result += vector[i] * vector[i]; }/*from w w w. ja va2 s . c om*/ return result; } }