Here you can find the source of norm2DoubleArray(double[] v)
public static double norm2DoubleArray(double[] v)
//package com.java2s; public class Main { public static double norm2DoubleArray(double[] v) { double normSum = 0; for (double d : v) { normSum += d * d;//from w w w.j ava2s .c o m } return Math.sqrt(normSum); } }