Table of Contents

Class CastingImpl

Namespace
NumSharp
Assembly
NumSharp.dll

An ArrayMethod with one input and one output: the cast from From to To (NumPy's castingimpl). Looked up per class pair by GetCastingImpl(DTypeMeta) and consulted by DTypeCasting (can_cast, cast-safety, descriptor adaptation) and by CastDescrToDType(DType, DTypeMeta) (which is how a parametric class learns the instance an operand of another class should become).

public abstract class CastingImpl : ArrayMethod
Inheritance
CastingImpl
Derived
Inherited Members

Remarks

From, To and IsWithinDType have no NumPy names: NumPy reads the two classes as dtypes[0] and dtypes[1] of the bound method and compares them where it needs to.

Constructors

CastingImpl(string, NPY_CASTING, NDArrayMethodFlags, DTypeMeta, DTypeMeta)

Builds the cast from from to to.

protected CastingImpl(string name, NPY_CASTING casting, NDArrayMethodFlags flags, DTypeMeta from, DTypeMeta to)

Parameters

name string

The method name.

casting NPY_CASTING

The minimal cast safety of the cast.

flags NDArrayMethodFlags

The method flags.

from DTypeMeta

The source class.

to DTypeMeta

The destination class.

Exceptions

ArgumentNullException

from, to or name is null.

Properties

From

The source DType class (dtypes[0]).

public DTypeMeta From { get; }

Property Value

DTypeMeta

IsWithinDType

True for the cast between two instances of the same class.

public bool IsWithinDType { get; }

Property Value

bool

To

The destination DType class (dtypes[1]).

public DTypeMeta To { get; }

Property Value

DTypeMeta