Java Array Min Value minOverArraySubset(double[] array, Iterable subset)

Here you can find the source of minOverArraySubset(double[] array, Iterable subset)

Description

Compute the minimum value over a subset of an array of doubles.

License

Open Source License

Parameter

Parameter Description
array The array
subset The subset

Declaration

public static double minOverArraySubset(double[] array,
        Iterable<Integer> subset) 

Method Source Code

//package com.java2s;
//   it under the terms of the GNU General Public License as published by

public class Main {
    /**/*from w w w  .j  av a  2  s . com*/
     * Compute the minimum value over a subset of an array of doubles.
     * @param array The array
     * @param subset The subset
     */
    public static double minOverArraySubset(double[] array,
            Iterable<Integer> subset) {
        double d;
        d = Double.POSITIVE_INFINITY;
        for (int j : subset) {
            if (array[j] < d)
                d = array[j];
        }
        return d;
    }
}

Related

  1. minOfArr(int[] arrInput)
  2. minOfArray(float[] array)
  3. minOfCol(int[][] matrixTable, int colBound)
  4. minOfSortedValues(double[] sortedValues)
  5. minOfSubRange(double[] xs, int start, int end)
  6. minPrim(final int... numbers)
  7. minsort(int[] vet1)
  8. minValue(double array[][])
  9. minValue(double[] from)