Here you can find the source of minScalar(final double[] a, final double scalar)
public static Callable minScalar(final double[] a, final double scalar) throws Exception
//package com.java2s; import java.util.concurrent.*; public class Main { public static Callable minScalar(final double[] a, final double scalar) throws Exception { Callable c = new Callable() { public Object call() throws Exception { double[] result = new double[a.length]; for (int i = 0; i < a.length; i++) { result[i] = Math.min(a[i], scalar); }//from w w w . ja v a 2s .co m return result; } }; return c; } public static Callable min(final double[] a, final double[] b) throws Exception { if (a.length != b.length) throw new Exception(""); Callable c = new Callable() { public Object call() throws Exception { double[] result = new double[a.length]; for (int i = 0; i < a.length; i++) { result[i] = Math.min(a[i], b[i]); } return result; } }; return c; } }