Documentation of 'jsat.utils.ArrayUtils' Java class
ArrayUtils
jsat.utils

Class ArrayUtils



  • public class ArrayUtils
    extends java.lang.Object
    Extra utilities for working on array types
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void shuffle(int[] array, int from, int to, java.util.Random rand)
      Shuffles the values in the given array
      static void shuffle(int[] array, java.util.Random rand)
      Swaps values in the given array
      static void swap(int[] array, int a, int b)
      Swaps two indices in the given array
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 in
        rand - 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 in
        from - the first index, inclusive, to shuffle from
        to - the last index, exclusive, to shuffle from
        rand - 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 in
        a - the first index
        b - the second index

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.