Here you can find the source of lengthSQ(double[] vector)
public static double lengthSQ(double[] vector)
//package com.java2s; //License from project: Open Source License public class Main { public static double lengthSQ(double[] vector) { double max = 0.0; for (double aValue : vector) { max += aValue * aValue;/*from ww w . j a v a 2s . c om*/ } return max; } }