Here you can find the source of arrayMax(double maxVal, double[] vals)
Parameter | Description |
---|---|
values | a parameter |
public static double[] arrayMax(double maxVal, double[] vals)
//package com.java2s; //License from project: Open Source License public class Main { /**//from w w w.j a v a 2 s. co m * Applies a max value to all elements in an array * @param values * @return */ public static double[] arrayMax(double maxVal, double[] vals) { double[] out = new double[vals.length]; for (int i = 0; i < vals.length; i++) { out[i] = Math.max(maxVal, vals[i]); } return out; } }