Here you can find the source of length(final double[] a)
Parameter | Description |
---|---|
a | a parameter |
public static double length(final double[] a)
//package com.java2s; public class Main { /**/*from www . jav a 2s .c om*/ * get the length of a. * * @param a */ public static double length(final double[] a) { return Math.sqrt(squareLength(a)); } /** * get the squared length of a. * * @param a */ public static double squareLength(final double[] a) { final int rows = rows(a); double squ_len = 0.0; for (int i = 0; i < rows; ++i) squ_len += a[i] * a[i]; return squ_len; } public static int rows(final double[] a) { return a.length; } public static int rows(final double[][] A) { return A.length; } }