// Path: src/main/java/edu/berkeley/nlp/lm/ConfigOptions.java
// public class ConfigOptions implements Serializable
// {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 1L;
// 
// 	@Option(gloss = "Number of longs (8 bytes) used as a block for variable length compression")
// 	public int compressedBlockSize = 16;
// 
// 	@Option(gloss = "Parameter \"k\" which controls the base for variable-length compression of offset deltas")
// 	public int offsetDeltaRadix = 6;
// 
// 	@Option(gloss = "Parameter \"k\" which controls the base for variable-length compression of value ranks")
// 	public int valueRadix = 6;
// 
// 	@Option(gloss = "Fraction of hash table array actually used for entries (lower means more memory/more speed)")
// 	public double hashTableLoadFactor = 1.0 / 1.5;
// 
// 	@Option(gloss = "Probability returned when the last word of an n-gram is not in the vocabulary of the LM (this is *not* the probability of the <unk> tag)")
// 	public double unknownWordLogProb = -100.0f;
// 
// 	@Option(gloss = "Backoff constant used for stupid backoff")
// 	public double stupidBackoffAlpha = 0.4;
// 
// 	@Option(gloss = "Discounts used in estimating Kneser-Ney language models (one for each order). If null, they are calculated automatically using c1/(c1+2*c2), where cn is the number of ngrams with count n.")
// 	public double[] kneserNeyDiscounts = null;//KneserNeyLmReaderCallback.defaultDiscounts();
// 
// 	@Option(gloss = "Minimum token counts used in estimating Kneser-Ney language models (one for each order). Note that for some internal reasons, these counts are *only* applied to the highest- and second-highest order n-grams (for example, if you estimate a 5-gram language model, only 4- and 5-grams will be thresholded. Also, any ngram orders beyond the length of this array are considered to have min count 0.")
// 	public double[] kneserNeyMinCounts = KneserNeyLmReaderCallback.defaultMinCounts();
// 
// 	@Option(gloss = "Number of bits allocated for a word in a context encoding (remaining bits of a long are used to encode an offset")
// 	public int numWordBits = 26;
// 
// 	@Option(gloss = "Whether to lock indexers after language model creation. This prevents the vocabulary from growing.")
// 	public boolean lockIndexer = true;
// 
// 	@Option(gloss = "Number of bits to round the mantissa of floats to when reading from ARPA LM files. Note that the mantissa of a float is at most 24 bits long.")
// 	public static int roundBits = 24;
// 
// 	@Option(gloss = "For (uncompressed) models that store probabilities and backoffs, store by ranking")
// 	public boolean storeRankedProbBackoffs = true;
// 
// 
// 	public ConfigOptions() {
// 	}
// 
// }
// 
// Path: src/main/java/edu/berkeley/nlp/lm/bits/BitUtils.java
// public class BitUtils
// {
// 
// 	private static final long INT_BITS_MASK = ((1L << Integer.SIZE) - 1);
// 
// 	public static int getHighInt(long key) {
// 		return ((int) (key >>> Integer.SIZE));
// 
// 	}
// 
// 	public static int abs(int a_) {
// 		int a = a_;
// 		int signMask = a >> (Integer.SIZE - 1); // make a mask of the sign bit
// 		a ^= signMask; // toggle the bits if value is negative
// 		a += signMask & 1;
// 		return a;
// 	}
// 
// 	public static long abs(long a_) {
// 		long a = a_;
// 		long signMask = a >> (Long.SIZE - 1); // make a mask of the sign bit
// 		a ^= signMask; // toggle the bits if value is negative
// 		a += signMask & 1;
// 		return a;
// 	}
// 
// 	public static int getLowInt(long key) {
// 		return (int) getLowLong(key);
// 
// 	}
// 
// 	public static long getLowLong(long key) {
// 		return (key & INT_BITS_MASK);
// 	}
// 
// 	public static long setLowInt(long key, int i) {
// 		return combineInts(i, getHighInt(key));
// 
// 	}
// 
// 	public static long setHighInt(long key, int i) {
// 		return combineInts(getLowInt(key), i);
// 
// 	}
// 
// 	public static long max(long a_, long b) {
// 		long a = a_;
// 		a -= b;
// 		a &= (~a) >> Long.SIZE - 1;
// 		a += b;
// 		return a;
// 	}
// 
// 	public static long min(long a_, long b) {
// 		long a = a_;
// 		a -= b;
// 		a &= a >> Long.SIZE - 1;
// 		a += b;
// 		return a;
// 	}
// 
// 	public static long combineInts(int lowInt, int highInt) {
// 		return (((long) highInt) << Integer.SIZE) | (lowInt & INT_BITS_MASK);
// 	}
// 
// 	public static void main(String[] argv) {
// 		long x = 0xfff;
// 		x <<= Long.SIZE - 1;
// 		x >>>= Long.SIZE - 1;
// 		System.out.println(x);
// 	}
// 
// }
// 
// Path: src/main/java/edu/berkeley/nlp/lm/collections/LongRepresentable.java
// public interface LongRepresentable<T> extends Comparable<T>
// {
// 
// 	public long asLong();
// 
// }


import edu.berkeley.nlp.lm.ConfigOptions;
import edu.berkeley.nlp.lm.bits.BitUtils;
import edu.berkeley.nlp.lm.collections.LongRepresentable;
package edu.berkeley.nlp.lm.values;


public class ProbBackoffPair implements Comparable<ProbBackoffPair>, LongRepresentable<ProbBackoffPair>
{

	static final int MANTISSA_MASK = 0x7fffff;

	static final int REST_MASK = ~MANTISSA_MASK;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Float.floatToIntBits(prob);
		result = prime * result + Float.floatToIntBits(backoff);
// Path: src/main/java/edu/berkeley/nlp/lm/ConfigOptions.java
// public class ConfigOptions implements Serializable
// {
// 
// 	/**
// 	 * 
// 	 */
// 	private static final long serialVersionUID = 1L;
// 
// 	@Option(gloss = "Number of longs (8 bytes) used as a block for variable length compression")
// 	public int compressedBlockSize = 16;
// 
// 	@Option(gloss = "Parameter \"k\" which controls the base for variable-length compression of offset deltas")
// 	public int offsetDeltaRadix = 6;
// 
// 	@Option(gloss = "Parameter \"k\" which controls the base for variable-length compression of value ranks")
// 	public int valueRadix = 6;
// 
// 	@Option(gloss = "Fraction of hash table array actually used for entries (lower means more memory/more speed)")
// 	public double hashTableLoadFactor = 1.0 / 1.5;
// 
// 	@Option(gloss = "Probability returned when the last word of an n-gram is not in the vocabulary of the LM (this is *not* the probability of the <unk> tag)")
// 	public double unknownWordLogProb = -100.0f;
// 
// 	@Option(gloss = "Backoff constant used for stupid backoff")
// 	public double stupidBackoffAlpha = 0.4;
// 
// 	@Option(gloss = "Discounts used in estimating Kneser-Ney language models (one for each order). If null, they are calculated automatically using c1/(c1+2*c2), where cn is the number of ngrams with count n.")
// 	public double[] kneserNeyDiscounts = null;//KneserNeyLmReaderCallback.defaultDiscounts();
// 
// 	@Option(gloss = "Minimum token counts used in estimating Kneser-Ney language models (one for each order). Note that for some internal reasons, these counts are *only* applied to the highest- and second-highest order n-grams (for example, if you estimate a 5-gram language model, only 4- and 5-grams will be thresholded. Also, any ngram orders beyond the length of this array are considered to have min count 0.")
// 	public double[] kneserNeyMinCounts = KneserNeyLmReaderCallback.defaultMinCounts();
// 
// 	@Option(gloss = "Number of bits allocated for a word in a context encoding (remaining bits of a long are used to encode an offset")
// 	public int numWordBits = 26;
// 
// 	@Option(gloss = "Whether to lock indexers after language model creation. This prevents the vocabulary from growing.")
// 	public boolean lockIndexer = true;
// 
// 	@Option(gloss = "Number of bits to round the mantissa of floats to when reading from ARPA LM files. Note that the mantissa of a float is at most 24 bits long.")
// 	public static int roundBits = 24;
// 
// 	@Option(gloss = "For (uncompressed) models that store probabilities and backoffs, store by ranking")
// 	public boolean storeRankedProbBackoffs = true;
// 
// 
// 	public ConfigOptions() {
// 	}
// 
// }
// 
// Path: src/main/java/edu/berkeley/nlp/lm/bits/BitUtils.java
// public class BitUtils
// {
// 
// 	private static final long INT_BITS_MASK = ((1L << Integer.SIZE) - 1);
// 
// 	public static int getHighInt(long key) {
// 		return ((int) (key >>> Integer.SIZE));
// 
// 	}
// 
// 	public static int abs(int a_) {
// 		int a = a_;
// 		int signMask = a >> (Integer.SIZE - 1); // make a mask of the sign bit
// 		a ^= signMask; // toggle the bits if value is negative
// 		a += signMask & 1;
// 		return a;
// 	}
// 
// 	public static long abs(long a_) {
// 		long a = a_;
// 		long signMask = a >> (Long.SIZE - 1); // make a mask of the sign bit
// 		a ^= signMask; // toggle the bits if value is negative
// 		a += signMask & 1;
// 		return a;
// 	}
// 
// 	public static int getLowInt(long key) {
// 		return (int) getLowLong(key);
// 
// 	}
// 
// 	public static long getLowLong(long key) {
// 		return (key & INT_BITS_MASK);
// 	}
// 
// 	public static long setLowInt(long key, int i) {
// 		return combineInts(i, getHighInt(key));
// 
// 	}
// 
// 	public static long setHighInt(long key, int i) {
// 		return combineInts(getLowInt(key), i);
// 
// 	}
// 
// 	public static long max(long a_, long b) {
// 		long a = a_;
// 		a -= b;
// 		a &= (~a) >> Long.SIZE - 1;
// 		a += b;
// 		return a;
// 	}
// 
// 	public static long min(long a_, long b) {
// 		long a = a_;
// 		a -= b;
// 		a &= a >> Long.SIZE - 1;
// 		a += b;
// 		return a;
// 	}
// 
// 	public static long combineInts(int lowInt, int highInt) {
// 		return (((long) highInt) << Integer.SIZE) | (lowInt & INT_BITS_MASK);
// 	}
// 
// 	public static void main(String[] argv) {
// 		long x = 0xfff;
// 		x <<= Long.SIZE - 1;
// 		x >>>= Long.SIZE - 1;
// 		System.out.println(x);
// 	}
// 
// }
// 
// Path: src/main/java/edu/berkeley/nlp/lm/collections/LongRepresentable.java
// public interface LongRepresentable<T> extends Comparable<T>
// {
// 
// 	public long asLong();
// 
// }


// Path: src/main/java/edu/berkeley/nlp/lm/values/ProbBackoffPair.java
import edu.berkeley.nlp.lm.ConfigOptions;
import edu.berkeley.nlp.lm.bits.BitUtils;
import edu.berkeley.nlp.lm.collections.LongRepresentable;

package edu.berkeley.nlp.lm.values;


public class ProbBackoffPair implements Comparable<ProbBackoffPair>, LongRepresentable<ProbBackoffPair>
{

	static final int MANTISSA_MASK = 0x7fffff;

	static final int REST_MASK = ~MANTISSA_MASK;

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Float.floatToIntBits(prob);
		result = prime * result + Float.floatToIntBits(backoff);
		return result;