Documentation of 'cc.redberry.core.utils.MathUtils' Java class
MathUtils
cc.redberry.core.utils

Class MathUtils



  • public final class MathUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int[] getSortedDistinct(int[] values)
      Sort array & return array with removed repetitive values.
      static int[] intSetDifference(int[] a, int[] b)
      Return the set difference B - A for int sets A and B.
      Sets A and B must be represented as two sorted int arrays.
      Repetitive values in A or B not allowed.
      static int[] intSetUnion(int[] a, int[] b)
      Return the union B + A for integer sets A and B.
      Sets A and B must be represented as two sorted integer arrays.
      Repetitive values in A or B not allowed.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getSortedDistinct

        public static int[] getSortedDistinct(int[] values)
        Sort array & return array with removed repetitive values.
        Parameters:
        values - input array (this method will quickSort this array)
        Returns:
        sorted array of distinct values
      • intSetDifference

        public static int[] intSetDifference(int[] a,
                                             int[] b)
        Return the set difference B - A for int sets A and B.
        Sets A and B must be represented as two sorted int arrays.
        Repetitive values in A or B not allowed.
        Parameters:
        a - sorted array of distinct values. (set A)
        b - sorted array of distinct values. (set B)
        Returns:
        the set of elements in B but not in A
      • intSetUnion

        public static int[] intSetUnion(int[] a,
                                        int[] b)
        Return the union B + A for integer sets A and B.
        Sets A and B must be represented as two sorted integer arrays.
        Repetitive values in A or B not allowed.
        Parameters:
        a - sorted array of distinct values. (set A)
        b - sorted array of distinct values. (set B)
        Returns:
        the set of elements from B and from A

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.