Struct ImmutableDiscreteChar.CharRange
Represents a range of characters, with an associated probability.
Implements
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
[Serializable]
[DataContract]
public struct CharRange : IComparable<ImmutableDiscreteChar.CharRange>
Constructors
CharRange(Int32, Int32, Weight)
Initializes a new instance of the ImmutableDiscreteChar.CharRange struct with given range bounds and character probability.
Declaration
[Construction(new string[]{"StartInclusive", "EndExclusive", "Probability"})]
public CharRange(int startInclusive, int endExclusive, Weight probability)
Parameters
Type | Name | Description |
---|---|---|
Int32 | startInclusive | The start of the character range (inclusive). |
Int32 | endExclusive | The end of the character range (exclusive). |
Weight | probability | The probability of characters in the range. |
Properties
EndExclusive
Gets or sets the end of the range (exclusive).
Declaration
[DataMember]
public int EndExclusive { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Setter is required for DataContractSerializer
Probability
Gets or sets the probability associated with the range.
Declaration
[DataMember]
public Weight Probability { get; }
Property Value
Type | Description |
---|---|
Weight |
Remarks
Setter is required for DataContractSerializer
StartInclusive
Gets or sets the start of the range (inclusive).
Declaration
[DataMember]
public int StartInclusive { get; }
Property Value
Type | Description |
---|---|
Int32 |
Remarks
Setter is required for DataContractSerializer
Methods
CompareTo(ImmutableDiscreteChar.CharRange)
Declaration
public int CompareTo(ImmutableDiscreteChar.CharRange that)
Parameters
Type | Name | Description |
---|---|---|
ImmutableDiscreteChar.CharRange | that |
Returns
Type | Description |
---|---|
Int32 |
Read(Func<Int32>, Func<Double>)
Reads a char range.
Declaration
public static ImmutableDiscreteChar.CharRange Read(Func<int> readInt32, Func<double> readDouble)
Parameters
Type | Name | Description |
---|---|---|
Func<Int32> | readInt32 | |
Func<Double> | readDouble |
Returns
Type | Description |
---|---|
ImmutableDiscreteChar.CharRange |
ToString()
Gets a string that represents this character range.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string that represents this character range. |
Overrides
Write(Action<Int32>, Action<Double>)
Writes a char range.
Declaration
public void Write(Action<int> writeInt32, Action<double> writeDouble)
Parameters
Type | Name | Description |
---|---|---|
Action<Int32> | writeInt32 | |
Action<Double> | writeDouble |