Class RandomSequence

java.lang.Object
nom.tam.fits.compression.algorithm.quant.RandomSequence

public final class RandomSequence extends Object
A standard fixed random sequence to use for portable and reversible dither implementations. This is a modified (improved) version of the random sequence implementation in Appendix I of the FITS 4.0 standard, using integer arithmetics for better performance -- but still providing the same sequence as the original algorithm.
See Also:
  • Method Details

    • get

      public static double get(int i)
      Returns the ith random value from the sequence
      Parameters:
      i - The index between 0 and length() (exclusive).
      Returns:
      The fixed uniform random deviate value at that index in the range of 0.0 to 1.0 (exclusive).
      See Also:
    • length

      public static int length()
      Returns the number of random values in the sequence.
      Returns:
      The number of random values available from the fixed sequence.