Struct Conversion
Assembly: Microsoft.ML.Probabilistic.Compiler.dll
Syntax
Fields
ChangeRankSubclassCount
Declaration
public const int ChangeRankSubclassCount = 3000
Field Value
Converter
Declaration
public Converter Converter
Field Value
IsExplicit
True if the conversion is explicit.
Declaration
Field Value
OpImplicitSubclassCount
Declaration
public const int OpImplicitSubclassCount = 2000
Field Value
SameTypeCodeSubclassCount
Declaration
public const int SameTypeCodeSubclassCount = 1000
Field Value
SpecialImplicitSubclassCount
Declaration
public const int SpecialImplicitSubclassCount = 10000
Field Value
SubclassCount
The number of subclass edges between the two types.
Declaration
Field Value
Methods
ChangeRank(Array, Int32, Type, Converter)
Change array rank and convert elements.
Declaration
public static Array ChangeRank(Array fromArray, int toRank, Type toElementType, Converter conv)
Parameters
| Type |
Name |
Description |
| Array |
fromArray |
|
| Int32 |
toRank |
Can be smaller, larger, or equal to fromArray.Rank.
|
| Type |
toElementType |
|
| Converter |
conv |
|
Returns
| Type |
Description |
| Array |
A new array of rank toRank with the same contents as fromArray.
|
ChangeType(Object, Type)
Declaration
public static object ChangeType(object value, Type toType)
Parameters
Returns
ConvertDelegate(Type, Delegate)
Convert a weakly-typed delegate into a strongly-typed delegate.
Declaration
public static Delegate ConvertDelegate(Type delegateType, Delegate inner)
Parameters
| Type |
Name |
Description |
| Type |
delegateType |
The desired delegate type.
|
| Delegate |
inner |
A delegate with parameters (object[] args).
The
return type can be any type convertible to the return type of delegateType, or void if
the delegateType is void.
|
Returns
| Type |
Description |
| Delegate |
A delegate of type delegateType. The arguments of this delegate will be
passed as (object[]) args to the innerMethod.
|
GetPrimitiveConverter(Type, Type)
Declaration
public static Converter GetPrimitiveConverter(Type fromType, Type toType)
Parameters
| Type |
Name |
Description |
| Type |
fromType |
|
| Type |
toType |
|
Returns
GetWeight()
Returns a numerical weight such that (a.GetWeight() < b.GetWeight()) iff (a < b)
Declaration
Returns
GetWeight(IEnumerable<Conversion>)
Declaration
public static float GetWeight(IEnumerable<Conversion> array)
Parameters
Returns
IsNullable(Type)
Declaration
public static bool IsNullable(Type type)
Parameters
| Type |
Name |
Description |
| Type |
type |
|
Returns
ToString()
Declaration
public override string ToString()
Returns
Overrides
TryGetArrayConversion(Int32, Int32, Type, Conversion, out Conversion)
Declaration
public static bool TryGetArrayConversion(int fromRank, int toRank, Type toElementType, Conversion elementConversion, out Conversion info)
Parameters
Returns
TryGetConversion(Type, Type, out Conversion)
Declaration
public static bool TryGetConversion(Type fromType, Type toType, out Conversion info)
Parameters
| Type |
Name |
Description |
| Type |
fromType |
non-null. May contain type parameters. Use typeof(Nullable) to convert from a null value.
|
| Type |
toType |
non-null. May contain type parameters. May be typeof(void), for which no conversion is needed.
|
| Conversion |
info |
|
Returns
| Type |
Description |
| Boolean |
null if no converter was found.
|
TryGetPrimitiveConversion(Type, Type, out Conversion)
Get a Conversion structure to a primitive type.
Declaration
public static bool TryGetPrimitiveConversion(Type fromType, Type toType, out Conversion info)
Parameters
| Type |
Name |
Description |
| Type |
fromType |
Any type.
|
| Type |
toType |
A primitive type.
|
| Conversion |
info |
|
Returns
| Type |
Description |
| Boolean |
false if no conversion exists.
|
Operators
GreaterThan(Conversion, Conversion)
Declaration
public static bool operator>(Conversion a, Conversion b)
Parameters
Returns
LessThan(Conversion, Conversion)
True if A is a more specific conversion than B.
Declaration
public static bool operator <(Conversion a, Conversion b)
Parameters
Returns
| Type |
Description |
| Boolean |
True if A is a more specific conversion than B.
|