Here you can find the source of maxOverArraySubset(double[] array, Iterable
Parameter | Description |
---|---|
array | The array |
subset | The subset |
public static double maxOverArraySubset(double[] array, Iterable<Integer> subset)
//package com.java2s; // it under the terms of the GNU General Public License as published by public class Main { /**/*from w w w .ja va 2 s .com*/ * Compute the maximum value over a subset of an array of doubles. * @param array The array * @param subset The subset */ public static double maxOverArraySubset(double[] array, Iterable<Integer> subset) { double d; d = Double.NEGATIVE_INFINITY; for (int j : subset) { if (array[j] > d) d = array[j]; } return d; } }