Java Array Min Value arrayMin(double minVal, double[] vals)

Here you can find the source of arrayMin(double minVal, double[] vals)

Description

Applies a min value to all elements in an array

License

Open Source License

Parameter

Parameter Description
values a parameter

Declaration

public static double[] arrayMin(double minVal, double[] vals) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**/*from  w w w  .  ja  va  2  s . com*/
     * Applies a min value to all elements in an array 
     * @param values
     * @return
     */
    public static double[] arrayMin(double minVal, double[] vals) {
        double[] out = new double[vals.length];
        for (int i = 0; i < vals.length; i++) {
            out[i] = Math.min(minVal, vals[i]);
        }

        return out;
    }
}

Related

  1. argmin(double... vs)
  2. argmin(final double[] vec)
  3. argmin(int[] a)
  4. argMin(int[] a)
  5. arrayMin(double[] arr)
  6. arrayMin(double[] x)
  7. arrayMin(final double[] array)
  8. arrayMin(int[] property)