Here you can find the source of max(final double[] vec)
Parameter | Description |
---|---|
vec | the vector. |
public static double max(final double[] vec)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w.ja v a 2s.co m * Computes the maximum of the elements of a vector. * @param vec the vector. * @return the maximum of the elements of the vector. */ public static double max(final double[] vec) { assert vec != null; double max = vec[0]; for (double i : vec) { if (i > max) { max = i; } } return max; } }