Class SuffixArrayAgainstPatternComparer
A SuffixAgainstPatternComparer which compares the suffix System.String corresponding to the i-th element (first System.Int32 value) of the provided MoreStructures.SuffixArrays.SuffixArray, against the provided System.String pattern, and ignores the second System.Int32 value.
Inherited Members
Namespace: MoreStructures.BurrowsWheelerTransform.Matching.Comparers
Assembly: MoreStructures.dll
Syntax
public class SuffixArrayAgainstPatternComparer : SuffixAgainstPatternComparer
Remarks
COMPLEXITY
- When the provided MoreStructures.SuffixArrays.SuffixArray instance has a
- Because a complete Suffix Array with direct memory access is provided to Compare(Int32, Int32),
getting the starting index of the suffix corresponding to the i-th element is a constant-time operation.
- Compare a suffix against the pattern requires comparing at most n chars, where n is the length of
Text.
- So Time and Space Complexity are both O(n) in the worst case. Space Complexity is O(1) when
Constructors
| Improve this Doc View SourceSuffixArrayAgainstPatternComparer(TextWithTerminator, SuffixArray, IEnumerable<Char>)
Declaration
public SuffixArrayAgainstPatternComparer(TextWithTerminator text, SuffixArray suffixArray, IEnumerable<char> pattern)
Parameters
Type | Name | Description |
---|---|---|
TextWithTerminator | text | The text, to extract suffixes from via |
MoreStructures.SuffixArrays.SuffixArray | suffixArray | The MoreStructures.SuffixArrays.SuffixArray of |
IEnumerable<System.Char> | pattern | The pattern, to compare against each suffix of |
Methods
| Improve this Doc View SourceCompare(Int32, Int32)
Compares the suffix of text identified by the x
-th element of the
MoreStructures.SuffixArrays.SuffixArray against the pattern.
Declaration
public override int Compare(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | |
System.Int32 | y |
Returns
Type | Description |
---|---|
System.Int32 |