Search Results for

    Show / Hide Table of Contents

    Struct Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State

    Represents a reference to a state of automaton for exposure in public API.

    Implements
    IEquatable<Automaton.State<>>
    Inherited Members
    Object.Equals(Object, Object)
    Object.GetType()
    Object.ReferenceEquals(Object, Object)
    Namespace: Microsoft.ML.Probabilistic.Distributions.Automata
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    public readonly struct State : IEquatable<Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State>
    Remarks

    Acts as a "fat reference" to state in automaton. In addition to reference to actual StateData it carries 2 additional properties for convenience: Index of the state and full Microsoft.ML.Probabilistic.Distributions.Automata.Automaton`5.State.transitions table.

    Properties

    CanEnd

    Gets a value indicating whether the ending weight of this state is greater than zero.

    Declaration
    public readonly bool CanEnd { get; }
    Property Value
    Type Description
    Boolean

    EndWeight

    Gets the ending weight of the state.

    Declaration
    public readonly Weight EndWeight { get; }
    Property Value
    Type Description
    Weight

    Index

    Gets the index of the state.

    Declaration
    public readonly int Index { get; }
    Property Value
    Type Description
    Int32

    Transitions

    Declaration
    public readonly ReadOnlyArraySegment<Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.Transition> Transitions { get; }
    Property Value
    Type Description
    ReadOnlyArraySegment<Automaton.Transition<>>

    Methods

    Equals(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State)

    Compares 2 states for equality.

    Declaration
    public readonly bool Equals(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State that)
    Parameters
    Type Name Description
    Automaton.State<> that
    Returns
    Type Description
    Boolean

    Equals(Object)

    Declaration
    public override readonly bool Equals(object obj)
    Parameters
    Type Name Description
    Object obj
    Returns
    Type Description
    Boolean
    Overrides
    ValueType.Equals(Object)

    GetHashCode()

    Declaration
    public override readonly int GetHashCode()
    Returns
    Type Description
    Int32
    Overrides
    ValueType.GetHashCode()

    ReadTo(ref Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.Builder, Func<Int32>, Func<Double>, Func<TElementDistribution>, Boolean)

    Reads state and appends it into Automaton builder. Returns index in the serialized data. If checkIndex is true, will throw exception if serialized index does not match index in deserialized states array. This check is bypassed only when start state is serialized second time.

    Declaration
    public static int ReadTo(ref Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.Builder builder, Func<int> readInt32, Func<double> readDouble, Func<TElementDistribution> readElementDistribution, bool checkIndex = false)
    Parameters
    Type Name Description
    Automaton.Builder<> builder
    Func<Int32> readInt32
    Func<Double> readDouble
    Func<TElementDistribution> readElementDistribution
    Boolean checkIndex
    Returns
    Type Description
    Int32

    ToString()

    Returns a string that represents the state.

    Declaration
    public override readonly string ToString()
    Returns
    Type Description
    String

    A string that represents the state.

    Overrides
    ValueType.ToString()

    Write(Action<Double>, Action<Int32>, Action<TElementDistribution>)

    Declaration
    public readonly void Write(Action<double> writeDouble, Action<int> writeInt32, Action<TElementDistribution> writeElementDistribution)
    Parameters
    Type Name Description
    Action<Double> writeDouble
    Action<Int32> writeInt32
    Action<TElementDistribution> writeElementDistribution

    Operators

    Equality(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State, Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State)

    Compares 2 states for equality.

    Declaration
    public static bool operator ==(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State a, Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State b)
    Parameters
    Type Name Description
    Automaton.State<> a
    Automaton.State<> b
    Returns
    Type Description
    Boolean

    Inequality(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State, Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State)

    Compares 2 states for inequality.

    Declaration
    public static bool operator !=(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State a, Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TThis>.State b)
    Parameters
    Type Name Description
    Automaton.State<> a
    Automaton.State<> b
    Returns
    Type Description
    Boolean

    Implements

    System.IEquatable<T>
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.