Table of Contents

Class DefaultEngine

Namespace
NumSharp.Backends
Assembly
NumSharp.dll

Default Tensor Engine implemented in pure micro-optimized C#.

public class DefaultEngine : TensorEngine
Inheritance
DefaultEngine
Inherited Members
Extension Methods

Remarks

DefaultEngine is the pure C# implementation of TensorEngine. It uses ILKernelGenerator internally for SIMD-optimized kernels. All computation on NDArray should go through TensorEngine methods.

Methods

ACos(NDArray, NPTypeCode?)

Element-wise inverse cosine (arccos) using IL-generated kernels.

public override NDArray ACos(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

ACos(NDArray, Type)

public override NDArray ACos(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

AMax(NDArray, int, Type, bool)

public override NDArray AMax(NDArray nd, int axis, Type dtype, bool keepdims = false)

Parameters

nd NDArray
axis int
dtype Type
keepdims bool

Returns

NDArray

AMax(NDArray, int?, NPTypeCode?, bool)

public override NDArray AMax(NDArray nd, int? axis = null, NPTypeCode? typeCode = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
typeCode NPTypeCode?
keepdims bool

Returns

NDArray

AMin(NDArray, int, Type, bool)

public override NDArray AMin(NDArray nd, int axis, Type dtype, bool keepdims = false)

Parameters

nd NDArray
axis int
dtype Type
keepdims bool

Returns

NDArray

AMin(NDArray, int?, NPTypeCode?, bool)

public override NDArray AMin(NDArray nd, int? axis = null, NPTypeCode? typeCode = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
typeCode NPTypeCode?
keepdims bool

Returns

NDArray

ASin(NDArray, NPTypeCode?)

Element-wise inverse sine (arcsin) using IL-generated kernels.

public override NDArray ASin(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

ASin(NDArray, Type)

public override NDArray ASin(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

ATan(NDArray, NPTypeCode?)

Element-wise inverse tangent (arctan) using IL-generated kernels.

public override NDArray ATan(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

ATan(NDArray, Type)

public override NDArray ATan(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

ATan2(NDArray, NDArray, NPTypeCode?)

Element-wise arc tangent of y/x choosing the quadrant correctly. NumPy: arctan2(y, x) returns the angle in radians between the positive x-axis and the point (x, y), with correct quadrant determination.

public override NDArray ATan2(NDArray y, NDArray x, NPTypeCode? typeCode = null)

Parameters

y NDArray

y-coordinates

x NDArray

x-coordinates. If y.shape != x.shape, they must be broadcastable.

typeCode NPTypeCode?

Output dtype (overrides type promotion). If null, uses NumPy rules.

Returns

NDArray

Array of angles in radians, range [-pi, pi]

ATan2(NDArray, NDArray, Type)

Element-wise arc tangent of y/x choosing the quadrant correctly. NumPy: arctan2(y, x) returns the angle in radians between the positive x-axis and the point (x, y), with correct quadrant determination.

public override NDArray ATan2(NDArray y, NDArray x, Type dtype)

Parameters

y NDArray

y-coordinates

x NDArray

x-coordinates. If y.shape != x.shape, they must be broadcastable.

dtype Type

Output dtype (overrides type promotion)

Returns

NDArray

Array of angles in radians, range [-pi, pi]

Abs(NDArray, NPTypeCode?)

Element-wise absolute value using IL-generated kernels. NumPy behavior: preserves input dtype (unlike sin/cos which promote to float).

public override NDArray Abs(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Abs(NDArray, Type)

public override NDArray Abs(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Add(NDArray, NDArray)

Element-wise addition using IL-generated kernels. Supports all 144 type combinations with automatic type promotion.

public override NDArray Add(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

All(NDArray)

Test whether all array elements evaluate to True (non-zero). Supports all 12 dtypes with SIMD optimization for contiguous arrays.

public override bool All(NDArray nd)

Parameters

nd NDArray

Input array

Returns

bool

True if all elements are non-zero

All(NDArray, int)

Test whether all array elements along a given axis evaluate to True.

public override NDArray<bool> All(NDArray nd, int axis)

Parameters

nd NDArray

Input array

axis int

Axis along which to reduce

Returns

NDArray<bool>

Array of bools with the axis dimension removed

AllClose(NDArray, NDArray, double, double, bool)

Returns True if two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers.The

relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b. If either array contains one or more NaNs, False is returned. Infs are treated as equal if they are in the same place and of the same sign in both arrays.

public override bool AllClose(NDArray a, NDArray b, double rtol = 1E-05, double atol = 1E-08, bool equal_nan = false)

Parameters

a NDArray
b NDArray

Input array to compare with a.

rtol double

The relative tolerance parameter(see Notes)

atol double

The absolute tolerance parameter(see Notes)

equal_nan bool

Whether to compare NaN's as equal. If True, NaN's in a will be considered equal to NaN's in b in the output array.

Returns

bool

Any(NDArray)

Test whether any array element evaluates to True (non-zero). Supports all 12 dtypes with SIMD optimization for contiguous arrays.

public override bool Any(NDArray nd)

Parameters

nd NDArray

Input array

Returns

bool

True if any element is non-zero

Any(NDArray, int)

Test whether any array element along a given axis evaluates to True.

public override NDArray<bool> Any(NDArray nd, int axis)

Parameters

nd NDArray

Input array

axis int

Axis along which to reduce

Returns

NDArray<bool>

Array of bools with the axis dimension removed

AreBroadcastable(params NDArray[])

Checks if the given arrays can be broadcast together.

public static bool AreBroadcastable(params NDArray[] arrays)

Parameters

arrays NDArray[]

Returns

bool

Remarks

Extracts shapes and delegates to Shape.AreBroadcastable

AreBroadcastable(params Shape[])

Checks if the given shapes can be broadcast together.

public static bool AreBroadcastable(params Shape[] shapes)

Parameters

shapes Shape[]

Returns

bool

Remarks

Delegates to Shape.AreBroadcastable

AreBroadcastable(params int[][])

Checks if the given dimension arrays can be broadcast together.

public static bool AreBroadcastable(params int[][] shapes)

Parameters

shapes int[][]

Returns

bool

Remarks

Delegates to Shape.AreBroadcastable

ArgMax(NDArray)

public override NDArray ArgMax(NDArray a)

Parameters

a NDArray

Returns

NDArray

ArgMax(NDArray, int, bool)

public override NDArray ArgMax(NDArray a, int axis, bool keepdims = false)

Parameters

a NDArray
axis int
keepdims bool

Returns

NDArray

ArgMin(NDArray)

public override NDArray ArgMin(NDArray a)

Parameters

a NDArray

Returns

NDArray

ArgMin(NDArray, int, bool)

public override NDArray ArgMin(NDArray a, int axis, bool keepdims = false)

Parameters

a NDArray
axis int
keepdims bool

Returns

NDArray

BitwiseAnd(NDArray, NDArray)

Execute bitwise AND operation.

public override NDArray BitwiseAnd(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

BitwiseOr(NDArray, NDArray)

Execute bitwise OR operation.

public override NDArray BitwiseOr(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

BitwiseXor(NDArray, NDArray)

Execute bitwise XOR operation.

public override NDArray BitwiseXor(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

BooleanMask(NDArray, NDArray)

Apply a boolean mask to select elements from an array.

public override NDArray BooleanMask(NDArray arr, NDArray mask)

Parameters

arr NDArray

Source array.

mask NDArray

Boolean mask (must have same shape as arr).

Returns

NDArray

1D array containing elements where mask is true.

Broadcast(params NDArray[])

Broadcasts multiple arrays and returns new NDArrays with broadcasted shapes.

public static NDArray[] Broadcast(params NDArray[] arrays)

Parameters

arrays NDArray[]

Returns

NDArray[]

Remarks

Extracts shapes, delegates to Shape.Broadcast, wraps results in NDArray

Broadcast(Shape, Shape)

Broadcasts two shapes and returns the broadcasted shapes with computed strides.

public static (Shape LeftShape, Shape RightShape) Broadcast(Shape leftShape, Shape rightShape)

Parameters

leftShape Shape
rightShape Shape

Returns

(Shape LeftShape, Shape RightShape)

Remarks

Delegates to Shape.Broadcast

Broadcast(params Shape[])

Broadcasts multiple shapes and returns the broadcasted shapes with computed strides.

public static Shape[] Broadcast(params Shape[] shapes)

Parameters

shapes Shape[]

Returns

Shape[]

Remarks

Delegates to Shape.Broadcast

Cast(NDArray, NPTypeCode, bool)

public override NDArray Cast(NDArray nd, NPTypeCode dtype, bool copy)

Parameters

nd NDArray
dtype NPTypeCode
copy bool

Returns

NDArray

Cast(NDArray, Type, bool)

public override NDArray Cast(NDArray nd, Type dtype, bool copy)

Parameters

nd NDArray
dtype Type
copy bool

Returns

NDArray

Cbrt(NDArray, NPTypeCode?)

Element-wise cube root using IL-generated kernels. Computes the cube root of each element.

public override NDArray Cbrt(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Cbrt(NDArray, Type)

public override NDArray Cbrt(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Ceil(NDArray, NPTypeCode?)

Element-wise ceiling using IL-generated kernels.

public override NDArray Ceil(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Ceil(NDArray, Type)

public override NDArray Ceil(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Clip(NDArray, ValueType, ValueType, NPTypeCode?)

Clips array values to a specified range [min, max]. NumPy behavior:

  • NaN in data propagates through (result is NaN)
  • NaN in scalar min/max: entire array becomes NaN (for floating-point)
public override NDArray Clip(NDArray lhs, ValueType min, ValueType max, NPTypeCode? typeCode = null)

Parameters

lhs NDArray
min ValueType
max ValueType
typeCode NPTypeCode?

Returns

NDArray

Remarks

Implementation uses IL kernels with:

  • SIMD for contiguous arrays (Vector256/Vector128)
  • Scalar iteration for strided arrays (via TransformOffset)

The Cast(copy: true) call ensures we have a contiguous output array, so the SIMD path is always taken for supported types.

Clip(NDArray, ValueType, ValueType, Type)

public override NDArray Clip(NDArray lhs, ValueType min, ValueType max, Type dtype)

Parameters

lhs NDArray
min ValueType
max ValueType
dtype Type

Returns

NDArray

ClipNDArray(NDArray, NDArray, NDArray, NPTypeCode?, NDArray)

public override NDArray ClipNDArray(NDArray lhs, NDArray min, NDArray max, NPTypeCode? typeCode = null, NDArray @out = null)

Parameters

lhs NDArray
min NDArray
max NDArray
typeCode NPTypeCode?
out NDArray

Returns

NDArray

ClipNDArray(NDArray, NDArray, NDArray, Type, NDArray)

public override NDArray ClipNDArray(NDArray lhs, NDArray min, NDArray max, Type dtype, NDArray @out = null)

Parameters

lhs NDArray
min NDArray
max NDArray
dtype Type
out NDArray

Returns

NDArray

Compare(NDArray, NDArray)

Element-wise equal comparison (==). Overrides TensorEngine.Compare - used by the == operator.

public override NDArray<bool> Compare(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

Cos(NDArray, NPTypeCode?)

Element-wise cosine using IL-generated kernels.

public override NDArray Cos(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Cos(NDArray, Type)

public override NDArray Cos(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Cosh(NDArray, NPTypeCode?)

Element-wise hyperbolic cosine using IL-generated kernels.

public override NDArray Cosh(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Cosh(NDArray, Type)

public override NDArray Cosh(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

CountNonZero(NDArray)

Count the number of non-zero elements in the array.

public override int CountNonZero(NDArray nd)

Parameters

nd NDArray

Returns

int

Remarks

NumPy-aligned: np.count_nonzero([0, 1, 0, 2]) = 2

CountNonZero(NDArray, int, bool)

Count non-zero elements along a specific axis.

public override NDArray CountNonZero(NDArray nd, int axis, bool keepdims = false)

Parameters

nd NDArray
axis int
keepdims bool

Returns

NDArray

CreateNDArray(Shape, Type, IArraySlice, char)

public override NDArray CreateNDArray(Shape shape, Type dtype = null, IArraySlice buffer = null, char order = 'C')

Parameters

shape Shape
dtype Type
buffer IArraySlice
order char

Returns

NDArray

CreateNDArray(Shape, Type, Array, char)

public override NDArray CreateNDArray(Shape shape, Type dtype = null, Array buffer = null, char order = 'C')

Parameters

shape Shape
dtype Type
buffer Array
order char

Returns

NDArray

CumSumElementwise<T>(NDArray, NPTypeCode?)

public NDArray CumSumElementwise<T>(NDArray arr, NPTypeCode? typeCode) where T : unmanaged

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

NDArray

Type Parameters

T

Deg2Rad(NDArray, NPTypeCode?)

Element-wise degrees to radians conversion using IL-generated kernels. Computes x * (Ï€/180).

public override NDArray Deg2Rad(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Deg2Rad(NDArray, Type)

public override NDArray Deg2Rad(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Divide(NDArray, NDArray)

Element-wise division using IL-generated kernels. Supports all 144 type combinations with automatic type promotion.

public override NDArray Divide(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Dot(NDArray, NDArray)

public override NDArray Dot(NDArray left, NDArray right)

Parameters

left NDArray
right NDArray

Returns

NDArray

Remarks

DotNDMD(NDArray, NDArray)

N-D x M-D dot product: sum product over last axis of lhs and second-to-last axis of rhs. dot(a, b)[i,j,k,m] = sum(a[i,j,:] * b[k,:,m])

public static NDArray DotNDMD(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Remarks

This replaces the original ~15,880 line implementation that used nested switch statements for every combination of dimension counts. The new implementation uses dynamic iteration with optional SIMD optimization for contiguous float/double arrays.

Exp(NDArray, NPTypeCode?)

Element-wise exponential using IL-generated kernels.

public override NDArray Exp(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Exp(NDArray, Type)

public override NDArray Exp(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Exp2(NDArray, NPTypeCode?)

Element-wise 2^x using IL-generated kernels.

public override NDArray Exp2(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Exp2(NDArray, Type)

public override NDArray Exp2(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Expm1(NDArray, NPTypeCode?)

Element-wise exp(x) - 1 using IL-generated kernels.

public override NDArray Expm1(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Expm1(NDArray, Type)

public override NDArray Expm1(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Floor(NDArray, NPTypeCode?)

Element-wise floor using IL-generated kernels.

public override NDArray Floor(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Floor(NDArray, Type)

public override NDArray Floor(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

FloorDivide(NDArray, NDArray, NPTypeCode?)

public override NDArray FloorDivide(NDArray lhs, NDArray rhs, NPTypeCode? typeCode = null)

Parameters

lhs NDArray
rhs NDArray
typeCode NPTypeCode?

Returns

NDArray

FloorDivide(NDArray, NDArray, Type)

public override NDArray FloorDivide(NDArray lhs, NDArray rhs, Type dtype)

Parameters

lhs NDArray
rhs NDArray
dtype Type

Returns

NDArray

FloorDivide(NDArray, ValueType, NPTypeCode?)

public override NDArray FloorDivide(NDArray lhs, ValueType rhs, NPTypeCode? typeCode = null)

Parameters

lhs NDArray
rhs ValueType
typeCode NPTypeCode?

Returns

NDArray

FloorDivide(NDArray, ValueType, Type)

public override NDArray FloorDivide(NDArray lhs, ValueType rhs, Type dtype)

Parameters

lhs NDArray
rhs ValueType
dtype Type

Returns

NDArray

GetStorage(NPTypeCode)

Get storage for given typeCode.

public override UnmanagedStorage GetStorage(NPTypeCode typeCode)

Parameters

typeCode NPTypeCode

Returns

UnmanagedStorage

GetStorage(Type)

Get storage for given dtype.

public override UnmanagedStorage GetStorage(Type dtype)

Parameters

dtype Type

Returns

UnmanagedStorage

Greater(NDArray, NDArray)

Element-wise greater-than comparison (>).

public override NDArray<bool> Greater(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

GreaterEqual(NDArray, NDArray)

Element-wise greater-than-or-equal comparison (>=).

public override NDArray<bool> GreaterEqual(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

Invert(NDArray, NPTypeCode?)

Element-wise bitwise NOT using IL-generated kernels. For integers: computes ~x (ones complement). For booleans: computes logical NOT (NumPy behavior).

public override NDArray Invert(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Invert(NDArray, Type)

public override NDArray Invert(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

IsClose(NDArray, NDArray, double, double, bool)

Returns a boolean array where two arrays are element-wise equal within a tolerance. The tolerance values are positive, typically very small numbers.The relative difference (rtol * abs(b)) and the absolute difference atol are added together to compare against the absolute difference between a and b. Warning: The default atol is not appropriate for comparing numbers that are much smaller than one(see Notes).

See also allclose

Notes: For finite values, isclose uses the following equation to test whether two floating point values are equivalent.

absolute(`a` - `b`) less than or equal to (`atol` + `rtol` * absolute(`b`))

Unlike the built-in math.isclose, the above equation is not symmetric in a and b -- it assumes b is the reference value -- so that isclose(a, b) might be different from isclose(b, a). Furthermore, the default value of atol is not zero, and is used to determine what small values should be considered close to zero.The default value is appropriate for expected values of order unity: if the expected values are significantly smaller than one, it can result in false positives. atol should be carefully selected for the use case at hand. A zero value for atol will result in False if either a or b is zero.

public override NDArray<bool> IsClose(NDArray a, NDArray b, double rtol = 1E-05, double atol = 1E-08, bool equal_nan = false)

Parameters

a NDArray

Input array to compare with b

b NDArray

Input array to compare with a.

rtol double

The relative tolerance parameter(see Notes)

atol double

The absolute tolerance parameter(see Notes)

equal_nan bool

Whether to compare NaN's as equal. If True, NaN's in a will be considered equal to NaN's in b in the output array.

Returns

NDArray<bool>

Returns a boolean array of where a and b are equal within the given tolerance.If both a and b are scalars, returns a single boolean value.

IsFinite(NDArray)

Test element-wise for finiteness (not infinity and not NaN). Returns True for all integer types (always finite), and checks float/double values.

public override NDArray<bool> IsFinite(NDArray a)

Parameters

a NDArray

Input array

Returns

NDArray<bool>

Boolean array where True indicates the element is finite

Remarks

NumPy behavior:

  • Float/Double: True if not infinity and not NaN
  • Integer types: Always True (integers cannot be Inf or NaN)
  • Empty arrays: Returns empty bool array

IsInf(NDArray)

Test element-wise for positive or negative infinity. Returns False for all integer types (cannot be Inf), and checks float/double values.

public override NDArray<bool> IsInf(NDArray a)

Parameters

a NDArray

Input array

Returns

NDArray<bool>

Boolean array where True indicates the element is positive or negative infinity

Remarks

NumPy behavior:

  • Float/Double: True if value is +Inf or -Inf
  • Integer types: Always False (integers cannot be Inf)
  • NaN: Returns False (NaN is not infinity)
  • Empty arrays: Returns empty bool array

IsNan(NDArray)

Test element-wise for NaN (Not a Number). Returns False for all integer types (cannot be NaN), and checks float/double values.

public override NDArray<bool> IsNan(NDArray a)

Parameters

a NDArray

Input array

Returns

NDArray<bool>

Boolean array where True indicates the element is NaN

Remarks

NumPy behavior:

  • Float/Double: True if value is NaN
  • Integer types: Always False (integers cannot be NaN)
  • Infinity: Returns False (Inf is not NaN)
  • Empty arrays: Returns empty bool array

LeftShift(NDArray, NDArray)

Bitwise left shift (x1 << x2).

public override NDArray LeftShift(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

LeftShift(NDArray, ValueType)

Bitwise left shift (x1 << scalar). SIMD optimized for contiguous arrays.

public override NDArray LeftShift(NDArray lhs, ValueType rhs)

Parameters

lhs NDArray
rhs ValueType

Returns

NDArray

Less(NDArray, NDArray)

Element-wise less-than comparison (<).

public override NDArray<bool> Less(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

LessEqual(NDArray, NDArray)

Element-wise less-than-or-equal comparison (<=).

public override NDArray<bool> LessEqual(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

Log(NDArray, NPTypeCode?)

Element-wise natural logarithm using IL-generated kernels.

public override NDArray Log(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Log(NDArray, Type)

public override NDArray Log(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Log10(NDArray, NPTypeCode?)

Element-wise log base 10 using IL-generated kernels.

public override NDArray Log10(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Log10(NDArray, Type)

public override NDArray Log10(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Log1p(NDArray, NPTypeCode?)

Element-wise log(1 + x) using IL-generated kernels.

public override NDArray Log1p(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Log1p(NDArray, Type)

public override NDArray Log1p(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Log2(NDArray, NPTypeCode?)

Element-wise log base 2 using IL-generated kernels.

public override NDArray Log2(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Log2(NDArray, Type)

public override NDArray Log2(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Matmul(NDArray, NDArray)

public override NDArray Matmul(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Remarks

Mean(NDArray, int, Type, bool)

public override NDArray Mean(NDArray nd, int axis, Type dtype, bool keepdims = false)

Parameters

nd NDArray
axis int
dtype Type
keepdims bool

Returns

NDArray

Mean(NDArray, int?, NPTypeCode?, bool)

public override NDArray Mean(NDArray nd, int? axis = null, NPTypeCode? typeCode = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
typeCode NPTypeCode?
keepdims bool

Returns

NDArray

MeanElementwise<T>(NDArray, NPTypeCode?)

Element-wise mean for typed result. Compatibility method for Std/Var.

public T MeanElementwise<T>(NDArray arr, NPTypeCode? typeCode) where T : unmanaged

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

T

Type Parameters

T

Mod(NDArray, NDArray)

Element-wise modulo using IL-generated kernels. Supports all 144 type combinations with automatic type promotion.

public override NDArray Mod(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

ModF(NDArray, NPTypeCode?)

Return the fractional and integral parts of an array, element-wise.

NumPy behavior (C standard modf):

  • modf(1.5) = (0.5, 1.0)
  • modf(-2.7) = (-0.7, -2.0) -- sign of fractional matches input
  • modf(inf) = (0.0, inf)
  • modf(-inf) = (-0.0, -inf)
  • modf(nan) = (nan, nan)

Decimal is a NumSharp extension (NumPy doesn't have decimal type).

public override (NDArray Fractional, NDArray Intergral) ModF(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

(NDArray Lhs, NDArray Rhs)

ModF(NDArray, Type)

public override (NDArray Fractional, NDArray Intergral) ModF(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

(NDArray Lhs, NDArray Rhs)

MoveAxis(NDArray, int[], int[])

public override NDArray MoveAxis(NDArray nd, int[] source, int[] destinition)

Parameters

nd NDArray
source int[]
destinition int[]

Returns

NDArray

Multiply(NDArray, NDArray)

Element-wise multiplication using IL-generated kernels. Supports all 144 type combinations with automatic type promotion.

public override NDArray Multiply(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

MultiplyMatrix(NDArray, NDArray, NDArray)

Matrix multiplication for 2D arrays: C = A @ B A is [M x K], B is [K x N], result is [M x N]

[SuppressMessage("ReSharper", "JoinDeclarationAndInitializer")]
protected static NDArray MultiplyMatrix(NDArray left, NDArray right, NDArray @out = null)

Parameters

left NDArray
right NDArray
out NDArray

Returns

NDArray

Remarks

Implementation strategy:

  1. SIMD fast path for contiguous float/double (40-100x faster)
  2. Generic fallback using Unsafe pointer arithmetic for all types

NanMax(NDArray, int?, bool)

Return maximum of an array or maximum along an axis, ignoring NaNs.

public override NDArray NanMax(NDArray a, int? axis = null, bool keepdims = false)

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

NanMin(NDArray, int?, bool)

Return minimum of an array or minimum along an axis, ignoring NaNs.

public override NDArray NanMin(NDArray a, int? axis = null, bool keepdims = false)

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

NanProd(NDArray, int?, bool)

Return the product of array elements over a given axis treating NaNs as ones.

public override NDArray NanProd(NDArray a, int? axis = null, bool keepdims = false)

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

NanSum(NDArray, int?, bool)

Return the sum of array elements over a given axis treating NaNs as zero.

public override NDArray NanSum(NDArray a, int? axis = null, bool keepdims = false)

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

Negate(NDArray)

Element-wise negation using IL-generated kernels.

public override NDArray Negate(NDArray nd)

Parameters

nd NDArray

Returns

NDArray

NonZero(NDArray)

Return the indices of non-zero elements.

public override NDArray<int>[] NonZero(NDArray nd)

Parameters

nd NDArray

Input array

Returns

NDArray<int>[]

Array of NDArray<int>, one per dimension containing indices of non-zero elements

Remarks

NumPy-aligned behavior:

  • Returns tuple of arrays, one per dimension
  • For empty arrays, returns empty arrays with correct dtype (int)
  • Iterates in C-order (row-major)
  • Handles contiguous and strided arrays efficiently

NotEqual(NDArray, NDArray)

Element-wise not-equal comparison (!=).

public override NDArray<bool> NotEqual(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray<bool>

Power(NDArray, NDArray, NPTypeCode?)

Element-wise power with array exponents: x1 ** x2 Uses ExecuteBinaryOp with BinaryOp.Power for broadcasting support.

public override NDArray Power(NDArray lhs, NDArray rhs, NPTypeCode? typeCode = null)

Parameters

lhs NDArray
rhs NDArray
typeCode NPTypeCode?

Returns

NDArray

Power(NDArray, NDArray, Type)

Element-wise power with array exponents: x1 ** x2

public override NDArray Power(NDArray lhs, NDArray rhs, Type dtype)

Parameters

lhs NDArray
rhs NDArray
dtype Type

Returns

NDArray

Power(NDArray, ValueType, NPTypeCode?)

public override NDArray Power(NDArray lhs, ValueType rhs, NPTypeCode? typeCode = null)

Parameters

lhs NDArray
rhs ValueType
typeCode NPTypeCode?

Returns

NDArray

Power(NDArray, ValueType, Type)

public override NDArray Power(NDArray lhs, ValueType rhs, Type dtype)

Parameters

lhs NDArray
rhs ValueType
dtype Type

Returns

NDArray

Rad2Deg(NDArray, NPTypeCode?)

Element-wise radians to degrees conversion using IL-generated kernels. Computes x * (180/Ï€).

public override NDArray Rad2Deg(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Rad2Deg(NDArray, Type)

public override NDArray Rad2Deg(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Reciprocal(NDArray, NPTypeCode?)

Element-wise reciprocal (1/x) using IL-generated kernels.

public override NDArray Reciprocal(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Reciprocal(NDArray, Type)

public override NDArray Reciprocal(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

ReduceAMax(NDArray, int?, bool, NPTypeCode?)

public override NDArray ReduceAMax(NDArray arr, int? axis_, bool keepdims = false, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
typeCode NPTypeCode?

Returns

NDArray

ReduceAMin(NDArray, int?, bool, NPTypeCode?)

public override NDArray ReduceAMin(NDArray arr, int? axis_, bool keepdims = false, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
typeCode NPTypeCode?

Returns

NDArray

ReduceAdd(NDArray, int?, bool, NPTypeCode?, NDArray)

public override NDArray ReduceAdd(NDArray arr, int? axis_, bool keepdims = false, NPTypeCode? typeCode = null, NDArray @out = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
typeCode NPTypeCode?
out NDArray

Returns

NDArray

ReduceArgMax(NDArray, int?, bool)

public override NDArray ReduceArgMax(NDArray arr, int? axis_, bool keepdims = false)

Parameters

arr NDArray
axis_ int?
keepdims bool

Returns

NDArray

ReduceArgMin(NDArray, int?, bool)

public override NDArray ReduceArgMin(NDArray arr, int? axis_, bool keepdims = false)

Parameters

arr NDArray
axis_ int?
keepdims bool

Returns

NDArray

ReduceCumAdd(NDArray, int?, NPTypeCode?)

public override NDArray ReduceCumAdd(NDArray arr, int? axis_, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
typeCode NPTypeCode?

Returns

NDArray

ReduceCumMul(NDArray, int?, NPTypeCode?)

public override NDArray ReduceCumMul(NDArray arr, int? axis_, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
typeCode NPTypeCode?

Returns

NDArray

ReduceMean(NDArray, int?, bool, NPTypeCode?)

public override NDArray ReduceMean(NDArray arr, int? axis_, bool keepdims = false, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
typeCode NPTypeCode?

Returns

NDArray

ReduceProduct(NDArray, int?, bool, NPTypeCode?)

public override NDArray ReduceProduct(NDArray arr, int? axis_, bool keepdims = false, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
typeCode NPTypeCode?

Returns

NDArray

ReduceStd(NDArray, int?, bool, int?, NPTypeCode?)

public override NDArray ReduceStd(NDArray arr, int? axis_, bool keepdims = false, int? ddof = null, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
ddof int?
typeCode NPTypeCode?

Returns

NDArray

ReduceVar(NDArray, int?, bool, int?, NPTypeCode?)

public override NDArray ReduceVar(NDArray arr, int? axis_, bool keepdims = false, int? ddof = null, NPTypeCode? typeCode = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
ddof int?
typeCode NPTypeCode?

Returns

NDArray

ResolveReturnShape(params NDArray[])

Resolves the output shape when broadcasting multiple arrays together.

public static Shape ResolveReturnShape(params NDArray[] arrays)

Parameters

arrays NDArray[]

Returns

Shape

Remarks

Extracts shapes and delegates to Shape.ResolveReturnShape

ResolveReturnShape(Shape, Shape)

Resolves the output shape when broadcasting two shapes together.

public static Shape ResolveReturnShape(Shape leftShape, Shape rightShape)

Parameters

leftShape Shape
rightShape Shape

Returns

Shape

Remarks

Delegates to Shape.ResolveReturnShape

ResolveReturnShape(params Shape[])

Resolves the output shape when broadcasting multiple shapes together.

public static Shape ResolveReturnShape(params Shape[] shapes)

Parameters

shapes Shape[]

Returns

Shape

Remarks

Delegates to Shape.ResolveReturnShape

ResolveUnaryReturnType(NDArray, NPTypeCode?)

public NPTypeCode ResolveUnaryReturnType(NDArray nd, NPTypeCode? @override)

Parameters

nd NDArray
override NPTypeCode?

Returns

NPTypeCode

ResolveUnaryReturnType(NDArray, Type)

public NPTypeCode ResolveUnaryReturnType(NDArray nd, Type @override)

Parameters

nd NDArray
override Type

Returns

NPTypeCode

RightShift(NDArray, NDArray)

Bitwise right shift (x1 >> x2). Uses arithmetic shift for signed types (sign bit extended). Uses logical shift for unsigned types (zeros filled).

public override NDArray RightShift(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

RightShift(NDArray, ValueType)

Bitwise right shift (x1 >> scalar). SIMD optimized for contiguous arrays.

public override NDArray RightShift(NDArray lhs, ValueType rhs)

Parameters

lhs NDArray
rhs ValueType

Returns

NDArray

RollAxis(NDArray, int, int)

public override NDArray RollAxis(NDArray nd, int axis, int start = 0)

Parameters

nd NDArray
axis int
start int

Returns

NDArray

Round(NDArray, int, NPTypeCode?)

Element-wise round with specified decimal places. Note: This overload uses traditional loop implementation for precision control.

public override NDArray Round(NDArray nd, int decimals, NPTypeCode? typeCode = null)

Parameters

nd NDArray
decimals int
typeCode NPTypeCode?

Returns

NDArray

Round(NDArray, int, Type)

public override NDArray Round(NDArray nd, int decimals, Type dtype)

Parameters

nd NDArray
decimals int
dtype Type

Returns

NDArray

Round(NDArray, NPTypeCode?)

Element-wise round using IL-generated kernels.

public override NDArray Round(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Round(NDArray, Type)

public override NDArray Round(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Sign(NDArray, NPTypeCode?)

Element-wise sign function using IL-generated kernels. Returns -1, 0, or 1 based on input sign. NumPy behavior: preserves input dtype.

public override NDArray Sign(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Sign(NDArray, Type)

public override NDArray Sign(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Sin(NDArray, NPTypeCode?)

Element-wise sine using IL-generated kernels.

public override NDArray Sin(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Sin(NDArray, Type)

public override NDArray Sin(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Sinh(NDArray, NPTypeCode?)

Element-wise hyperbolic sine using IL-generated kernels.

public override NDArray Sinh(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Sinh(NDArray, Type)

public override NDArray Sinh(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Sqrt(NDArray, NPTypeCode?)

Element-wise square root using IL-generated kernels.

public override NDArray Sqrt(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Sqrt(NDArray, Type)

public override NDArray Sqrt(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Square(NDArray, NPTypeCode?)

Element-wise square (x*x) using IL-generated kernels. NumPy behavior: preserves input dtype (unlike trig functions which promote to float).

public override NDArray Square(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Square(NDArray, Type)

public override NDArray Square(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

StdElementwise<T>(NDArray, NPTypeCode?, int?)

public T StdElementwise<T>(NDArray arr, NPTypeCode? typeCode, int? ddof) where T : unmanaged

Parameters

arr NDArray
typeCode NPTypeCode?
ddof int?

Returns

T

Type Parameters

T

Subtract(NDArray, NDArray)

Element-wise subtraction using IL-generated kernels. Supports all 144 type combinations with automatic type promotion.

public override NDArray Subtract(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Sum(NDArray, int, Type, bool)

public override NDArray Sum(NDArray nd, int axis, Type dtype, bool keepdims = false)

Parameters

nd NDArray
axis int
dtype Type
keepdims bool

Returns

NDArray

Sum(NDArray, int?, NPTypeCode?, bool)

public override NDArray Sum(NDArray nd, int? axis = null, NPTypeCode? typeCode = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
typeCode NPTypeCode?
keepdims bool

Returns

NDArray

SwapAxes(NDArray, int, int)

public override NDArray SwapAxes(NDArray nd, int axis1, int axis2)

Parameters

nd NDArray
axis1 int
axis2 int

Returns

NDArray

Tan(NDArray, NPTypeCode?)

Element-wise tangent using IL-generated kernels.

public override NDArray Tan(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Tan(NDArray, Type)

public override NDArray Tan(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Tanh(NDArray, NPTypeCode?)

Element-wise hyperbolic tangent using IL-generated kernels.

public override NDArray Tanh(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Tanh(NDArray, Type)

public override NDArray Tanh(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

Transpose(NDArray, int[])

public override NDArray Transpose(NDArray nd, int[] premute = null)

Parameters

nd NDArray
premute int[]

Returns

NDArray

Truncate(NDArray, NPTypeCode?)

Element-wise truncation (toward zero) using IL-generated kernels.

public override NDArray Truncate(NDArray nd, NPTypeCode? typeCode = null)

Parameters

nd NDArray
typeCode NPTypeCode?

Returns

NDArray

Truncate(NDArray, Type)

public override NDArray Truncate(NDArray nd, Type dtype)

Parameters

nd NDArray
dtype Type

Returns

NDArray

TryExecuteAxisReductionSimd(NDArray, int, ReductionOp, NPTypeCode)

Try to execute an axis reduction using SIMD kernel. Returns null if SIMD kernel is not available, allowing fallback to iterator-based approach.

protected NDArray TryExecuteAxisReductionSimd(NDArray arr, int axis, ReductionOp op, NPTypeCode outputTypeCode)

Parameters

arr NDArray

Input array

axis int

Axis to reduce along (already normalized to positive)

op ReductionOp

Reduction operation

outputTypeCode NPTypeCode

Output type code

Returns

NDArray

Result array, or null if SIMD kernel not available

VarElementwise<T>(NDArray, NPTypeCode?, int?)

public T VarElementwise<T>(NDArray arr, NPTypeCode? typeCode, int? ddof) where T : unmanaged

Parameters

arr NDArray
typeCode NPTypeCode?
ddof int?

Returns

T

Type Parameters

T

argmax_elementwise_il(NDArray)

Execute element-wise argmax reduction using IL kernels. Returns the index of the maximum value. All types including Boolean, Single, Double now use unified IL kernel path.

protected long argmax_elementwise_il(NDArray arr)

Parameters

arr NDArray

Returns

long

argmin_elementwise_il(NDArray)

Execute element-wise argmin reduction using IL kernels. Returns the index of the minimum value. All types including Boolean, Single, Double now use unified IL kernel path.

protected long argmin_elementwise_il(NDArray arr)

Parameters

arr NDArray

Returns

long

check_and_adjust_axis(NDArray, int)

public static int check_and_adjust_axis(NDArray nd, int axis)

Parameters

nd NDArray
axis int

Returns

int

check_and_adjust_axis(int, int)

public static int check_and_adjust_axis(int ndims, int axis)

Parameters

ndims int
axis int

Returns

int

cumprod_elementwise(NDArray, NPTypeCode?)

protected NDArray cumprod_elementwise(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

NDArray

cumsum_elementwise(NDArray, NPTypeCode?)

protected NDArray cumsum_elementwise(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

NDArray

max_axis_simd(NDArray, int, NPTypeCode)

Execute axis reduction for Max with SIMD optimization. Falls back to iterator-based approach if SIMD not available.

protected NDArray max_axis_simd(NDArray arr, int axis, NPTypeCode outputTypeCode)

Parameters

arr NDArray
axis int
outputTypeCode NPTypeCode

Returns

NDArray

max_elementwise_il(NDArray, NPTypeCode?)

Execute element-wise max reduction using IL kernels.

protected object max_elementwise_il(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

object

mean_elementwise_il(NDArray, NPTypeCode?)

Execute element-wise mean using IL kernels for sum. Mean = Sum / count

protected object mean_elementwise_il(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

object

min_axis_simd(NDArray, int, NPTypeCode)

Execute axis reduction for Min with SIMD optimization. Falls back to iterator-based approach if SIMD not available.

protected NDArray min_axis_simd(NDArray arr, int axis, NPTypeCode outputTypeCode)

Parameters

arr NDArray
axis int
outputTypeCode NPTypeCode

Returns

NDArray

min_elementwise_il(NDArray, NPTypeCode?)

Execute element-wise min reduction using IL kernels.

protected object min_elementwise_il(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

object

normalize_axis_tuple(int, int, object, bool)

public static int[] normalize_axis_tuple(int axis, int ndim, object argname = null, bool allow_duplicate = false)

Parameters

axis int
ndim int
argname object
allow_duplicate bool

Returns

int[]

normalize_axis_tuple(int[], int, object, bool)

public static int[] normalize_axis_tuple(int[] axis, int ndim, object argname = null, bool allow_duplicate = false)

Parameters

axis int[]
ndim int
argname object
allow_duplicate bool

Returns

int[]

prod_axis_simd(NDArray, int, NPTypeCode)

Execute axis reduction for Prod with SIMD optimization. Falls back to iterator-based approach if SIMD not available.

protected NDArray prod_axis_simd(NDArray arr, int axis, NPTypeCode outputTypeCode)

Parameters

arr NDArray
axis int
outputTypeCode NPTypeCode

Returns

NDArray

prod_elementwise_il(NDArray, NPTypeCode?)

Execute element-wise product reduction using IL kernels.

protected object prod_elementwise_il(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

object

std_elementwise(NDArray, NPTypeCode?, int?)

protected object std_elementwise(NDArray arr, NPTypeCode? typeCode, int? ddof)

Parameters

arr NDArray
typeCode NPTypeCode?
ddof int?

Returns

object

sum_axis_simd(NDArray, int, NPTypeCode)

Execute axis reduction for Sum with SIMD optimization. Falls back to iterator-based approach if SIMD not available.

protected NDArray sum_axis_simd(NDArray arr, int axis, NPTypeCode outputTypeCode)

Parameters

arr NDArray
axis int
outputTypeCode NPTypeCode

Returns

NDArray

sum_elementwise_il(NDArray, NPTypeCode?)

Execute element-wise sum reduction using IL kernels.

protected object sum_elementwise_il(NDArray arr, NPTypeCode? typeCode)

Parameters

arr NDArray
typeCode NPTypeCode?

Returns

object

var_elementwise(NDArray, NPTypeCode?, int?)

protected object var_elementwise(NDArray arr, NPTypeCode? typeCode, int? ddof)

Parameters

arr NDArray
typeCode NPTypeCode?
ddof int?

Returns

object