Table of Contents

Class TensorEngine

Namespace
NumSharp
Assembly
NumSharp.dll

The linear-algebra entry points beyond dot/matmul: the matrix products (managed fallback, backend optional), the LU-based factorisations det/slogdet/ solve/inv (managed fallback via NumSharp.Backends.ManagedLu, backend optional), and the remaining factorisations (backend required, no fallback).

public abstract class TensorEngine
Inheritance
TensorEngine
Derived
Inherited Members

Remarks

Every member reads Blas into a LOCAL before using it. That is not style — the property is settable and a concurrent OpenBlasEngine.Disable() turns a test-then-call into a null dereference (measured at ~2 % of calls; see docs/stale-docs/GEMM_PARITY.md §9).

Two behaviours live here and the difference matters to callers. The product family falls back to NumSharp's own managed kernels, so a backend changes which implementation runs and nothing else. The factorisation family splits: the LU-based four — det, slogdet, solve, inv — fall back to NumSharp.Backends.ManagedLu, a pure-managed unblocked LU that computes them (allclose to NumPy, since NumSharp.Core carries no BLOCKED LU to reproduce LAPACK's exact accumulation) rather than raising. The remaining factorisations — Cholesky, QR, SVD, the eigensolvers, lstsq — still have no managed numerics and raise OpenBlasMissingBackendException when no backend serves the operands. The members are virtual rather than abstract so an alternative engine overrides only what it actually implements.

Properties

Blas

An external BLAS this engine delegates its matrix products to, or null (the default) to compute them with NumSharp's own managed SIMD kernels.

public IBlasBackend Blas { get; set; }

Property Value

IBlasBackend

Remarks

NumSharp.Core is 100 % managed C# and never assigns this. It is set by an optional package — NumSharp.Interop.OpenBLAS does it from a [ModuleInitializer], so referencing that package is the whole opt-in — and can be cleared again by assigning null. A backend only answers for what it implements (see IBlasBackend); everything else falls back to the managed kernels.

Engines are cached singletons (BackendFactory), so assigning this affects every array that resolves to the engine — including ones already created.

Methods

ACos(NDArray, DType, NDArray, NDArray)

public abstract NDArray ACos(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ACosh(NDArray, DType, NDArray, NDArray)

public abstract NDArray ACosh(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

AMax(NDArray, int?, DType, bool)

public abstract NDArray AMax(NDArray nd, int? axis = null, DType dtype = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
dtype DType
keepdims bool

Returns

NDArray

AMin(NDArray, int?, DType, bool)

public abstract NDArray AMin(NDArray nd, int? axis = null, DType dtype = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
dtype DType
keepdims bool

Returns

NDArray

ASin(NDArray, DType, NDArray, NDArray)

public abstract NDArray ASin(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ASinh(NDArray, DType, NDArray, NDArray)

public abstract NDArray ASinh(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ATan(NDArray, DType, NDArray, NDArray)

public abstract NDArray ATan(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ATan2(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray ATan2(NDArray y, NDArray x, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

y NDArray
x NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ATanh(NDArray, DType, NDArray, NDArray)

public abstract NDArray ATanh(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Abs(NDArray, DType, NDArray, NDArray)

public abstract NDArray Abs(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Add(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Add(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

All(NDArray)

public abstract bool All(NDArray nd)

Parameters

nd NDArray

Returns

bool

All(NDArray, int)

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

Parameters

nd NDArray
axis int

Returns

NDArray<bool>

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

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

Parameters

a NDArray
b NDArray
rtol double
atol double
equal_nan bool

Returns

bool

Any(NDArray)

public abstract bool Any(NDArray nd)

Parameters

nd NDArray

Returns

bool

Any(NDArray, int)

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

Parameters

nd NDArray
axis int

Returns

NDArray<bool>

ArgMax(NDArray)

public abstract NDArray ArgMax(NDArray a)

Parameters

a NDArray

Returns

NDArray

ArgMax(NDArray, int, bool)

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

Parameters

a NDArray
axis int
keepdims bool

Returns

NDArray

ArgMin(NDArray)

public abstract NDArray ArgMin(NDArray a)

Parameters

a NDArray

Returns

NDArray

ArgMin(NDArray, int, bool)

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

Parameters

a NDArray
axis int
keepdims bool

Returns

NDArray

Argwhere(NDArray)

public abstract NDArray Argwhere(NDArray a)

Parameters

a NDArray

Returns

NDArray

BitwiseAnd(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray BitwiseAnd(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

BitwiseOr(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray BitwiseOr(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

BitwiseXor(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray BitwiseXor(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

BooleanMask(NDArray, NDArray)

public abstract NDArray BooleanMask(NDArray arr, NDArray mask)

Parameters

arr NDArray
mask NDArray

Returns

NDArray

BooleanMaskSet(NDArray, NDArray, NDArray)

public abstract void BooleanMaskSet(NDArray arr, NDArray mask, NDArray value)

Parameters

arr NDArray
mask NDArray
value NDArray

Cast(NDArray, Type, bool)

public abstract NDArray Cast(NDArray x, Type dtype, bool copy)

Parameters

x NDArray
dtype Type
copy bool

Returns

NDArray

Cbrt(NDArray, DType, NDArray, NDArray)

public abstract NDArray Cbrt(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Ceil(NDArray, DType, NDArray, NDArray)

public abstract NDArray Ceil(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Cholesky(NDArray, bool)

np.linalg.cholesky — OpenBLAS potrf.

public virtual NDArray Cholesky(NDArray a, bool upper)

Parameters

a NDArray
upper bool

Returns

NDArray

ClipNDArray(NDArray, NDArray, NDArray, DType, NDArray)

public abstract NDArray ClipNDArray(NDArray lhs, NDArray min, NDArray max, DType dtype = null, NDArray @out = null)

Parameters

lhs NDArray
min NDArray
max NDArray
dtype DType
out NDArray

Returns

NDArray

Compare(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Compare(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Conjugate(NDArray, DType, NDArray, NDArray)

NumPy 'conjugate' / 'conj' — the complex conjugate, element-wise. Identity at every real dtype (values unchanged, dtype preserved); for Complex it flips the sign of the imaginary part. dtype selects the loop; out=/where= follow the ufunc contract.

public abstract NDArray Conjugate(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

CopySign(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray CopySign(NDArray x1, NDArray x2, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

x1 NDArray
x2 NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Cos(NDArray, DType, NDArray, NDArray)

public abstract NDArray Cos(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Cosh(NDArray, DType, NDArray, NDArray)

public abstract NDArray Cosh(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

CountNonZero(NDArray)

public abstract long CountNonZero(NDArray a)

Parameters

a NDArray

Returns

long

CountNonZero(NDArray, int, bool)

public abstract NDArray CountNonZero(NDArray a, int axis, bool keepdims = false)

Parameters

a NDArray
axis int
keepdims bool

Returns

NDArray

CreateNDArray(Shape, DType, IArraySlice, char)

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

Parameters

shape Shape
dtype DType
buffer IArraySlice
order char

Returns

NDArray

CreateNDArray(Shape, DType, Array, char)

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

Parameters

shape Shape
dtype DType
buffer Array
order char

Returns

NDArray

Deg2Rad(NDArray, DType, NDArray, NDArray)

public abstract NDArray Deg2Rad(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Det(NDArray)

np.linalg.det — OpenBLAS getrf, or NumSharp's managed LU (NumSharp.Backends.ManagedLu) when no backend serves the operand.

public virtual NDArray Det(NDArray a)

Parameters

a NDArray

Returns

NDArray

Divide(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Divide(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Dot(NDArray, NDArray)

public abstract NDArray Dot(NDArray x, NDArray y)

Parameters

x NDArray
y NDArray

Returns

NDArray

Eig(NDArray, bool)

np.linalg.eig / np.linalg.eigvals — OpenBLAS geev.

public virtual (NDArray eigenvalues, NDArray eigenvectors) Eig(NDArray a, bool computeVectors)

Parameters

a NDArray
computeVectors bool

Returns

(NDArray Lhs, NDArray Rhs)

Eigh(NDArray, char, bool)

np.linalg.eigh / np.linalg.eigvalsh — OpenBLAS syevd (real symmetric) or heevd (complex Hermitian).

public virtual (NDArray eigenvalues, NDArray eigenvectors) Eigh(NDArray a, char uplo, bool computeVectors)

Parameters

a NDArray
uplo char
computeVectors bool

Returns

(NDArray Lhs, NDArray Rhs)

Evaluate(NDExpr, NDArray)

Fused evaluation of an NDExpr tree in one iterator pass (np.evaluate, roadmap Wave 6.1). Virtual with a NotSupported default so alternative engines opt in explicitly.

public virtual NDArray Evaluate(NDExpr expr, NDArray @out = null)

Parameters

expr NDExpr
out NDArray

Returns

NDArray

Evaluate(NDExpr, NDArray[], NDArray)

Fused evaluation against an explicit operand list (Input(int) leaves reference operands by position).

public virtual NDArray Evaluate(NDExpr expr, NDArray[] operands, NDArray @out = null)

Parameters

expr NDExpr
operands NDArray[]
out NDArray

Returns

NDArray

Exp(NDArray, DType, NDArray, NDArray)

public abstract NDArray Exp(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Exp2(NDArray, DType, NDArray, NDArray)

public abstract NDArray Exp2(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Expm1(NDArray, DType, NDArray, NDArray)

public abstract NDArray Expm1(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

FMax(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray FMax(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

FMin(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray FMin(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

FlatNonZero(NDArray)

public abstract NDArray<long> FlatNonZero(NDArray a)

Parameters

a NDArray

Returns

NDArray<long>

Floor(NDArray, DType, NDArray, NDArray)

public abstract NDArray Floor(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

FloorDivide(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray FloorDivide(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

GetStorage(DType)

Get storage described by the dtype DESCRIPTOR descr (NumPy's PyArray_NewFromDescr entry — the descriptor becomes the array's dtype, its class supplies the storage lane). The default routes through GetStorage(Type), which is exact for every builtin (one canonical descriptor per lane); an engine that carries parametric descriptors overrides it.

public virtual UnmanagedStorage GetStorage(DType descr)

Parameters

descr DType

Returns

UnmanagedStorage

GetStorage(Type)

Get storage for given dtype.

public abstract UnmanagedStorage GetStorage(Type dtype)

Parameters

dtype Type

Returns

UnmanagedStorage

Greater(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Greater(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

GreaterEqual(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray GreaterEqual(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Inner(NDArray, NDArray)

np.inner — a sum product over the LAST axis of both operands.

public virtual NDArray Inner(NDArray a, NDArray b)

Parameters

a NDArray
b NDArray

Returns

NDArray

Remarks

NumPy's PyArray_InnerProduct swaps the last two axes of b (when a.ndim >= 1 and b.ndim >= 2) and hands the pair to the very same PyArray_MatrixProduct2 that backs np.dot — which is why an unaligned inner reports b's shape ALREADY TRANSPOSED.

Inv(NDArray)

np.linalg.inv — OpenBLAS gesv against the identity, or NumSharp's managed LU (NumSharp.Backends.ManagedLu) when no backend serves the operand. A singular operand surfaces as LinAlgError("Singular matrix") from the factorisation either way, exactly as NumPy's does.

public virtual NDArray Inv(NDArray a)

Parameters

a NDArray

Returns

NDArray

Invert(NDArray, DType, NDArray, NDArray)

public abstract NDArray Invert(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

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

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

Parameters

a NDArray
b NDArray
rtol double
atol double
equal_nan bool

Returns

NDArray<bool>

IsFinite(NDArray, DType, NDArray, NDArray)

public abstract NDArray IsFinite(NDArray a, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

a NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

IsInf(NDArray, DType, NDArray, NDArray)

public abstract NDArray IsInf(NDArray a, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

a NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

IsNan(NDArray, DType, NDArray, NDArray)

public abstract NDArray IsNan(NDArray a, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

a NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

IsNegInf(NDArray, DType, NDArray, NDArray)

public abstract NDArray IsNegInf(NDArray a, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

a NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

IsPosInf(NDArray, DType, NDArray, NDArray)

public abstract NDArray IsPosInf(NDArray a, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

a NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

LeftShift(NDArray, NDArray)

public abstract NDArray LeftShift(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Less(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Less(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

LessEqual(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray LessEqual(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Log(NDArray, DType, NDArray, NDArray)

public abstract NDArray Log(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Log10(NDArray, DType, NDArray, NDArray)

public abstract NDArray Log10(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Log1p(NDArray, DType, NDArray, NDArray)

public abstract NDArray Log1p(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Log2(NDArray, DType, NDArray, NDArray)

public abstract NDArray Log2(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

LogAddExp(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray LogAddExp(NDArray x1, NDArray x2, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

x1 NDArray
x2 NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

LogAddExp2(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray LogAddExp2(NDArray x1, NDArray x2, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

x1 NDArray
x2 NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Lstsq(NDArray, NDArray, double)

np.linalg.lstsq — OpenBLAS gelsd.

public virtual (NDArray Solution, NDArray Residuals, NDArray Rank, NDArray SingularValues) Lstsq(NDArray a, NDArray b, double rcond)

Parameters

a NDArray
b NDArray
rcond double

Returns

(NDArray, NDArray, NDArray, NDArray)

Matmul(NDArray, NDArray)

public abstract NDArray Matmul(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Matvec(NDArray, NDArray)

The np.matvec gufunc (m,n),(n)->(m) — NumPy's gemv route.

public virtual NDArray Matvec(NDArray x1, NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Maximum(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Maximum(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Mean(NDArray, int?, DType, bool)

public abstract NDArray Mean(NDArray nd, int? axis = null, DType dtype = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
dtype DType
keepdims bool

Returns

NDArray

Minimum(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Minimum(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Mod(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Mod(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ModF(NDArray, DType)

public abstract (NDArray Fractional, NDArray Intergral) ModF(NDArray nd, DType dtype = null)

Parameters

nd NDArray
dtype DType

Returns

(NDArray Lhs, NDArray Rhs)

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

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

Parameters

nd NDArray
source int[]
destinition int[]

Returns

NDArray

Multiply(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Multiply(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

NanMax(NDArray, int?, bool)

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

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

NanMin(NDArray, int?, bool)

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

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

NanProd(NDArray, int?, bool)

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

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

NanSum(NDArray, int?, bool)

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

Parameters

a NDArray
axis int?
keepdims bool

Returns

NDArray

Negate(NDArray, DType, NDArray, NDArray)

public abstract NDArray Negate(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

NextAfter(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray NextAfter(NDArray x1, NDArray x2, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

x1 NDArray
x2 NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

NonZero(NDArray)

public abstract NDArray<long>[] NonZero(NDArray a)

Parameters

a NDArray

Returns

NDArray<long>[]

NotEqual(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray NotEqual(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Positive(NDArray, DType, NDArray, NDArray)

NumPy 'positive' — identity at every numeric dtype (no bool loop). dtype selects the loop (positive(i32, dtype=f64) widens; a bool loop request raises NumPy's did-not-contain-a-loop TypeError).

public abstract NDArray Positive(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Power(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Power(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Qr(NDArray, string)

np.linalg.qr — OpenBLAS geqrf plus orgqr/ungqr.

public virtual (NDArray Q, NDArray R) Qr(NDArray a, string mode)

Parameters

a NDArray
mode string

Returns

(NDArray Lhs, NDArray Rhs)

Rad2Deg(NDArray, DType, NDArray, NDArray)

public abstract NDArray Rad2Deg(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Reciprocal(NDArray, DType, NDArray, NDArray)

public abstract NDArray Reciprocal(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

ReduceAMax(NDArray, int?, bool, DType)

public abstract NDArray ReduceAMax(NDArray arr, int? axis_, bool keepdims = false, DType dtype = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
dtype DType

Returns

NDArray

ReduceAMin(NDArray, int?, bool, DType)

public abstract NDArray ReduceAMin(NDArray arr, int? axis_, bool keepdims = false, DType dtype = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
dtype DType

Returns

NDArray

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

public abstract NDArray ReduceAdd(NDArray arr, int? axis_, bool keepdims = false, DType dtype = null, NDArray @out = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
dtype DType
out NDArray

Returns

NDArray

ReduceArgMax(NDArray, int?, bool)

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

Parameters

arr NDArray
axis_ int?
keepdims bool

Returns

NDArray

ReduceArgMin(NDArray, int?, bool)

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

Parameters

arr NDArray
axis_ int?
keepdims bool

Returns

NDArray

ReduceCumAdd(NDArray, int?, DType)

public abstract NDArray ReduceCumAdd(NDArray arr, int? axis_, DType dtype = null)

Parameters

arr NDArray
axis_ int?
dtype DType

Returns

NDArray

ReduceCumMul(NDArray, int?, DType)

public abstract NDArray ReduceCumMul(NDArray arr, int? axis_, DType dtype = null)

Parameters

arr NDArray
axis_ int?
dtype DType

Returns

NDArray

ReduceMean(NDArray, int?, bool, DType)

public abstract NDArray ReduceMean(NDArray arr, int? axis_, bool keepdims = false, DType dtype = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
dtype DType

Returns

NDArray

ReduceProduct(NDArray, int?, bool, DType)

public abstract NDArray ReduceProduct(NDArray arr, int? axis_, bool keepdims = false, DType dtype = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
dtype DType

Returns

NDArray

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

public abstract NDArray ReduceStd(NDArray arr, int? axis_, bool keepdims = false, int? ddof = null, DType dtype = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
ddof int?
dtype DType

Returns

NDArray

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

public abstract NDArray ReduceVar(NDArray arr, int? axis_, bool keepdims = false, int? ddof = null, DType dtype = null)

Parameters

arr NDArray
axis_ int?
keepdims bool
ddof int?
dtype DType

Returns

NDArray

RightShift(NDArray, NDArray)

public abstract NDArray RightShift(NDArray lhs, NDArray rhs)

Parameters

lhs NDArray
rhs NDArray

Returns

NDArray

Rint(NDArray, DType, NDArray, NDArray)

public abstract NDArray Rint(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

RollAxis(NDArray, int, int)

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

Parameters

nd NDArray
axis int
start int

Returns

NDArray

Round(NDArray, DType, NDArray, NDArray)

public abstract NDArray Round(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Round(NDArray, int, DType, NDArray)

public abstract NDArray Round(NDArray nd, int decimals, DType dtype = null, NDArray @out = null)

Parameters

nd NDArray
decimals int
dtype DType
out NDArray

Returns

NDArray

Sign(NDArray, DType, NDArray, NDArray)

public abstract NDArray Sign(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Sin(NDArray, DType, NDArray, NDArray)

public abstract NDArray Sin(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Sinh(NDArray, DType, NDArray, NDArray)

public abstract NDArray Sinh(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Slogdet(NDArray)

np.linalg.slogdet — OpenBLAS getrf, or NumSharp's managed LU (NumSharp.Backends.ManagedLu) when no backend serves the operand.

public virtual (NDArray sign, NDArray logabsdet) Slogdet(NDArray a)

Parameters

a NDArray

Returns

(NDArray Lhs, NDArray Rhs)

Solve(NDArray, NDArray, bool)

np.linalg.solve — OpenBLAS gesv, or NumSharp's managed LU (NumSharp.Backends.ManagedLu) when no backend serves the operands.

public virtual NDArray Solve(NDArray a, NDArray b, bool oneDimensionalRhs)

Parameters

a NDArray
b NDArray
oneDimensionalRhs bool

Returns

NDArray

Sqrt(NDArray, DType, NDArray, NDArray)

public abstract NDArray Sqrt(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Square(NDArray, DType, NDArray, NDArray)

public abstract NDArray Square(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Subtract(NDArray, NDArray, DType, NDArray, NDArray)

public abstract NDArray Subtract(NDArray lhs, NDArray rhs, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

lhs NDArray
rhs NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Sum(NDArray, int?, DType, bool)

public abstract NDArray Sum(NDArray nd, int? axis = null, DType dtype = null, bool keepdims = false)

Parameters

nd NDArray
axis int?
dtype DType
keepdims bool

Returns

NDArray

Svd(NDArray, bool, bool)

np.linalg.svd / np.linalg.svdvals — OpenBLAS gesdd. Also the engine behind pinv, matrix_rank, cond and the spectral/nuclear norms.

public virtual (NDArray U, NDArray S, NDArray Vh) Svd(NDArray a, bool fullMatrices, bool computeUv)

Parameters

a NDArray
fullMatrices bool
computeUv bool

Returns

(NDArray, NDArray, NDArray)

SwapAxes(NDArray, int, int)

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

Parameters

nd NDArray
axis1 int
axis2 int

Returns

NDArray

Tan(NDArray, DType, NDArray, NDArray)

public abstract NDArray Tan(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Tanh(NDArray, DType, NDArray, NDArray)

public abstract NDArray Tanh(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Transpose(NDArray, int[])

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

Parameters

nd NDArray
premute int[]

Returns

NDArray

Truncate(NDArray, DType, NDArray, NDArray)

public abstract NDArray Truncate(NDArray nd, DType dtype = null, NDArray @out = null, NDArray where = null)

Parameters

nd NDArray
dtype DType
out NDArray
where NDArray

Returns

NDArray

Vdot(NDArray, NDArray)

np.vdot — both operands flattened to 1-D, a conjugated when complex, then a vector dot product. Always 0-d.

public virtual NDArray Vdot(NDArray a, NDArray b)

Parameters

a NDArray
b NDArray

Returns

NDArray

Vecdot(NDArray, NDArray)

The np.vecdot gufunc (n),(n)->()x1 conjugated when complex. Operands arrive validated; leading axes broadcast.

public virtual NDArray Vecdot(NDArray x1, NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray

Vecmat(NDArray, NDArray)

The np.vecmat gufunc (n),(n,m)->(m)x1 conjugated when complex.

public virtual NDArray Vecmat(NDArray x1, NDArray x2)

Parameters

x1 NDArray
x2 NDArray

Returns

NDArray