Class liba


  • public class liba
    extends java.lang.Object
    algorithm library
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String VERSION
      algorithm library version string
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static int hash_bkdr​(byte[] block, int value)
      a hash function whose prime number is 131
      static int hash_sdbm​(byte[] block, int value)
      a hash function whose prime number is 65599
      static int isqrt​(int x)
      square root of an unsigned integer
      static int isqrt​(long x)
      square root of an unsigned integer
      static double rsqrt​(double x)
      reciprocal of square-root
      static float rsqrt​(float x)
      reciprocal of square-root
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • VERSION

        public static final java.lang.String VERSION
        algorithm library version string
    • Method Detail

      • isqrt

        public static final int isqrt​(int x)
        square root of an unsigned integer
        Parameters:
        x - independent variable
        Returns:
        calculated result
      • isqrt

        public static final int isqrt​(long x)
        square root of an unsigned integer
        Parameters:
        x - independent variable
        Returns:
        calculated result
      • rsqrt

        public static final float rsqrt​(float x)
        reciprocal of square-root
        Parameters:
        x - independent variable
        Returns:
        calculated result
      • rsqrt

        public static final double rsqrt​(double x)
        reciprocal of square-root
        Parameters:
        x - independent variable
        Returns:
        calculated result
      • hash_bkdr

        public static final int hash_bkdr​(byte[] block,
                                          int value)
        a hash function whose prime number is 131
        Parameters:
        block - block to be processed
        value - initial value
        Returns:
        hash value
      • hash_sdbm

        public static final int hash_sdbm​(byte[] block,
                                          int value)
        a hash function whose prime number is 65599
        Parameters:
        block - block to be processed
        value - initial value
        Returns:
        hash value