Class NPTypeCodeExtensions
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
public static class NPTypeCodeExtensions
- Inheritance
-
NPTypeCodeExtensions
- Inherited Members
Methods
AsType(NPTypeCode)
Convert NPTypeCode into its Type
public static Type AsType(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
CompareTo(NPTypeCode, NPTypeCode)
public static int CompareTo(this NPTypeCode left, NPTypeCode right)
Parameters
leftNPTypeCoderightNPTypeCode
Returns
GetAccumulatingType(NPTypeCode)
Gets the dtype that is used as accumulation in case when statistics are computed like sum(in NDArray)
public static NPTypeCode GetAccumulatingType(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
- NPTypeCode
dtype in case when statistics are computed like sum(in NDArray)
GetComputingType(NPTypeCode)
Gets the dtype that is used as return type in case when statistics are computed with high decimal precision like sin(in NDArray, NPTypeCode?)
public static NPTypeCode GetComputingType(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
- NPTypeCode
dtype in case when statistics are computed like mean(in NDArray)
GetDefaultValue(NPTypeCode)
Gets the default value of typeCode.
public static ValueType GetDefaultValue(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
GetTypeCode(Type)
Extracts NPTypeCode from given Type.
public static NPTypeCode GetTypeCode(this Type type)
Parameters
typeType
Returns
Remarks
In case there was no successful cast to NPTypeCode, return will be Empty
GetTypeCode<T>()
Extracts NPTypeCode from given T.
public static NPTypeCode GetTypeCode<T>()
Returns
Type Parameters
T
Remarks
In case there was no successful cast to NPTypeCode, return will be Empty
IsNumerical(NPTypeCode)
public static bool IsNumerical(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
IsRealNumber(NPTypeCode)
Is typeCode a float, double, complex or decimal?
public static bool IsRealNumber(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
IsSigned(NPTypeCode)
Is typeCode a float, double, complex or decimal?
public static bool IsSigned(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
IsUnsigned(NPTypeCode)
Is typeCode a uint, byte, ulong and so on.
public static bool IsUnsigned(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
IsValidNPType(Type)
Checks if given Type has a match in NPTypeCode.
public static bool IsValidNPType(this Type type)
Parameters
typeType
Returns
SizeOf(NPTypeCode)
Gets the size of given typeCode
public static int SizeOf(this NPTypeCode typeCode)
Parameters
typeCodeNPTypeCode
Returns
Remarks
The size is computed by SizeOf<T>()