HistogramDiff by computing occurrence counts of elements.
Each element in the range being considered is put into a hash table, tracking the number of times that distinct element appears in the sequence. Once all elements have been inserted from sequence A, each element of sequence B is probed in the hash table and the longest common subsequence with the lowest occurrence count in A is used as the result.
| Modifier and Type | Field and Description |
|---|---|
| private final HashedSequence | |
| private final HashedSequence | |
| private final HashedSequenceComparator | |
| private int | |
| private boolean | |
| private final int | |
| private Edit | |
| private static final int | |
| private static final int | |
| private final int | |
| private int[] | next
For |
| private int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private static final int | |
| private int | |
| private int[] | |
| private long[] | recs
Describes a unique element in sequence A. |
| private final Edit | |
| private final int[] | table
Keyed by |
| Access | Constructor and Description |
|---|---|
| pack-priv | HistogramDiffIndex(int maxChainLength, HashedSequenceComparator<S> cmp, HashedSequence<S> a, HashedSequence<S> b, Edit r)
|
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Edit | |
| private int | |
| private static int | |
| private static long | |
| private static int | |
| private static int | |
| private boolean | |
| private static int | |
| private int |
| a | back to summary |
|---|---|
| private final HashedSequence<S> a | |
| b | back to summary |
|---|---|
| private final HashedSequence<S> b | |
| cmp | back to summary |
|---|---|
| private final HashedSequenceComparator<S> cmp | |
| cnt | back to summary |
|---|---|
| private int cnt | |
| hasCommon | back to summary |
|---|---|
| private boolean hasCommon | |
| keyShift | back to summary |
|---|---|
| private final int keyShift Number of low bits to discard from a key to index | |
| lcs | back to summary |
|---|---|
| private Edit lcs | |
| MAX_CNT | back to summary |
|---|---|
| private static final int MAX_CNT | |
| MAX_PTR | back to summary |
|---|---|
| private static final int MAX_PTR | |
| maxChainLength | back to summary |
|---|---|
| private final int maxChainLength | |
| next | back to summary |
|---|---|
| private int[] next For | |
| ptrShift | back to summary |
|---|---|
| private int ptrShift Value to subtract from element indexes to key | |
| REC_CNT_MASK | back to summary |
|---|---|
| private static final int REC_CNT_MASK | |
| REC_NEXT_SHIFT | back to summary |
|---|---|
| private static final int REC_NEXT_SHIFT | |
| REC_PTR_MASK | back to summary |
|---|---|
| private static final int REC_PTR_MASK | |
| REC_PTR_SHIFT | back to summary |
|---|---|
| private static final int REC_PTR_SHIFT | |
| recCnt | back to summary |
|---|---|
| private int recCnt Number of elements in | |
| recIdx | back to summary |
|---|---|
| private int[] recIdx For element | |
| recs | back to summary |
|---|---|
| private long[] recs Describes a unique element in sequence A. The records in this table are actually 3-tuples of:
MAX_CNT, as the field is only
a few bits wide. Elements that occur more frequently will have their
count capped.
| |
| region | back to summary |
|---|---|
| private final Edit region | |
| table | back to summary |
|---|---|
| private final int[] table Keyed by | |
| HistogramDiffIndex | back to summary |
|---|---|
| pack-priv HistogramDiffIndex(int maxChainLength, HashedSequenceComparator<S> cmp, HashedSequence<S> a, HashedSequence<S> b, Edit r) | |
| findLongestCommonSequence | back to summary |
|---|---|
| pack-priv Edit findLongestCommonSequence() | |
| hash | back to summary |
|---|---|
| private int hash(HashedSequence<S> s, int idx) | |
| recCnt | back to summary |
|---|---|
| private static int recCnt(long rec) | |
| recCreate | back to summary |
|---|---|
| private static long recCreate(int next, int ptr, int cnt) | |
| recNext | back to summary |
|---|---|
| private static int recNext(long rec) | |
| recPtr | back to summary |
|---|---|
| private static int recPtr(long rec) | |
| scanA | back to summary |
|---|---|
| private boolean scanA() | |
| tableBits | back to summary |
|---|---|
| private static int tableBits(int sz) | |
| tryLongestCommonSequence | back to summary |
|---|---|
| private int tryLongestCommonSequence(int bPtr) | |