jsat.utils
Class ArrayUtils
- java.lang.Object
-
- jsat.utils.ArrayUtils
-
public class ArrayUtils extends java.lang.ObjectExtra utilities for working on array types
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidshuffle(int[] array, int from, int to, java.util.Random rand)Shuffles the values in the given arraystatic voidshuffle(int[] array, java.util.Random rand)Swaps values in the given arraystatic voidswap(int[] array, int a, int b)Swaps two indices in the given array
-
-
-
Method Detail
-
shuffle
public static void shuffle(int[] array, java.util.Random rand)Swaps values in the given array- Parameters:
array- the array to swap values inrand- the source of randomness for shuffling
-
shuffle
public static void shuffle(int[] array, int from, int to, java.util.Random rand)Shuffles the values in the given array- Parameters:
array- the array to shuffle values infrom- the first index, inclusive, to shuffle fromto- the last index, exclusive, to shuffle fromrand- the source of randomness for shuffling
-
swap
public static void swap(int[] array, int a, int b)Swaps two indices in the given array- Parameters:
array- the array to perform the sawp ina- the first indexb- the second index
-
-
DataMelt 3.0 © DataMelt by jWork.ORG