Search Results for

    Show / Hide Table of Contents

    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.

    Inheritance
    System.Object
    SuffixAgainstPatternComparer
    SuffixArrayAgainstPatternComparer
    Inherited Members
    SuffixAgainstPatternComparer.Text
    SuffixAgainstPatternComparer.Pattern
    SuffixAgainstPatternComparer.CharComparer
    SuffixAgainstPatternComparer.LongestMatchFirstValue
    SuffixAgainstPatternComparer.LongestMatch
    SuffixAgainstPatternComparer.CompareSuffixAgainstPattern(Int32, Int32)
    Namespace: MoreStructures.BurrowsWheelerTransform.Matching.Comparers
    Assembly: MoreStructures.dll
    Syntax
    public class SuffixArrayAgainstPatternComparer : SuffixAgainstPatternComparer
    Remarks

    COMPLEXITY
    - When the provided MoreStructures.SuffixArrays.SuffixArray instance has a sequence which doesn't implement , the enumerable has to be enumerated, resulting into a list of exactly n elements.
    - 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 implements .

    Constructors

    | Improve this Doc View Source

    SuffixArrayAgainstPatternComparer(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 suffixArray.

    MoreStructures.SuffixArrays.SuffixArray suffixArray

    The MoreStructures.SuffixArrays.SuffixArray of text, to map the first term of comparison to the starting index in text of the corresponding suffix.

    IEnumerable<System.Char> pattern

    The pattern, to compare against each suffix of text.

    Methods

    | Improve this Doc View Source

    Compare(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
    Overrides
    SuffixAgainstPatternComparer.Compare(Int32, Int32)

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX