Class LegacyWrappingCastingImpl
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
A cast whose safety is fixed per class pair with the plain descriptor resolution — NumPy's
PyArray_AddLegacyWrapping_CastingImpl, used for the numeric ↔ datetime/timedelta casts: every cast
to or from datetime64 is unsafe; an integer or bool casts safely to timedelta64
(a 64-bit unsigned one only same_kind), a float or complex only unsafely.
public sealed class LegacyWrappingCastingImpl : CastingImpl
- Inheritance
-
LegacyWrappingCastingImpl
- Inherited Members
Methods
ResolveDescriptors(DType[], DType[], out long)
resolve_descriptors: given the operand descriptors (an output entry may be null — "please pick"),
fills loopDescrs with the descriptors the loop will actually run on and returns the cast
safety of doing so. viewOffset is the byte offset at which the operation is a plain
VIEW (0 for a no-op cast between identical descriptors), or NoView.
public override NPY_CASTING ResolveDescriptors(DType[] givenDescrs, DType[] loopDescrs, out long viewOffset)
Parameters
Returns
Exceptions
- TypeError
The descriptors cannot be resolved (NumPy returns -1 with an error set).