Table of Contents

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

typeCode NPTypeCode

Returns

Type

CompareTo(NPTypeCode, NPTypeCode)

public static int CompareTo(this NPTypeCode left, NPTypeCode right)

Parameters

left NPTypeCode
right NPTypeCode

Returns

int

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

typeCode NPTypeCode

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

typeCode NPTypeCode

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

typeCode NPTypeCode

Returns

ValueType

GetTypeCode(Type)

Extracts NPTypeCode from given Type.

public static NPTypeCode GetTypeCode(this Type type)

Parameters

type Type

Returns

NPTypeCode

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

NPTypeCode

Type Parameters

T

Remarks

In case there was no successful cast to NPTypeCode, return will be Empty

IsNumerical(NPTypeCode)

Returns true if typecode is a number (incl. bool, char and Complex).

public static bool IsNumerical(this NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Returns

bool

IsRealNumber(NPTypeCode)

Is typeCode a float, double, complex or decimal?

public static bool IsRealNumber(this NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Returns

bool

IsSigned(NPTypeCode)

Is typeCode a float, double, complex or decimal?

public static bool IsSigned(this NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Returns

bool

IsUnsigned(NPTypeCode)

Is typeCode a uint, byte, ulong and so on.

public static bool IsUnsigned(this NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Returns

bool

IsValidNPType(Type)

Checks if given Type has a match in NPTypeCode.

public static bool IsValidNPType(this Type type)

Parameters

type Type

Returns

bool

SizeOf(NPTypeCode)

Gets the size of given typeCode

public static int SizeOf(this NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Returns

int

Remarks

The size is computed by SizeOf<T>()