Package ch.idsia.credici.utility
Class CollectionTools
- java.lang.Object
-
- ch.idsia.credici.utility.CollectionTools
-
public class CollectionTools extends Object
-
-
Constructor Summary
Constructors Constructor Description CollectionTools()
-
Method Summary
Modifier and Type Method Description static List<Integer>
asList(int[] elements)
static double[]
roundNonZerosToTarget(double[] arr, double target, boolean newZeros, int num_decimals)
Round non zero values such as the sum is equal to the target.static int[]
shuffle(int[] elements)
static int[]
toIntArray(List<Integer> list)
-
-
-
Method Detail
-
shuffle
public static int[] shuffle(int[] elements)
-
roundNonZerosToTarget
public static double[] roundNonZerosToTarget(double[] arr, double target, boolean newZeros, int num_decimals)
Round non zero values such as the sum is equal to the target.- Parameters:
arr
-target
-num_decimals
-- Returns:
-
-