Table of Contents

Delegate UnravelIndexKernel

Namespace
NumSharp.Backends.Kernels
Assembly
NumSharp.dll

IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.

public delegate long UnravelIndexKernel(long* indices, long count, long* dims, long unravelSize, long** outCols, long ndim, long idxStart, long idxStep)

Parameters

indices long*
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
count long
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
dims long*
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
unravelSize long
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
outCols long**
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
ndim long
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
idxStart long
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.
idxStep long
IL-emitted flat→multi-coord expander for np.unravel_index. Caller pre-casts indices to int64 and computes unravelSize = product of dims; the kernel reads indices linearly, validates each value against [0, unravelSize), and emits per-axis coords into outCols using the C-order or F-order extraction direction selected by idxStart / idxStep.

Returns

long

count on success. On failure, the row index of the first element with val < 0 or val >= unravelSize; the caller reads indices[returned] to produce the error message.

Extension Methods