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
namestringThe method name.
castingNPY_CASTINGThe minimal cast safety of the cast.
flagsNDArrayMethodFlagsThe method flags.
fromDTypeMetaThe source class.
toDTypeMetaThe destination class.
Exceptions
- ArgumentNullException
from,toornameis null.
Properties
From
The source DType class (dtypes[0]).
public DTypeMeta From { get; }
Property Value
IsWithinDType
True for the cast between two instances of the same class.
public bool IsWithinDType { get; }
Property Value
To
The destination DType class (dtypes[1]).
public DTypeMeta To { get; }