Table of Contents

Class NDPolynomial

Namespace
NumSharp
Assembly
NumSharp.dll

NumPy's numpy.polynomial.polynomial.Polynomial: a power series: c[0] + c[1]·x + c[2]·x² + …, with a domain (default [-1, 1]) mapped onto a window (default [-1, 1]). Arithmetic (+ - * / %, __floordiv__(object), __divmod__(object), __pow__(object)), evaluation (__call__(object)), calculus (integ(int, object, object), deriv(int)), roots, fitting (fit(object, object, object, object, object, bool, object, object, string)), conversion between bases (convert(object, Type, object), cast(NDPolyBase, object, object)) and printing, all as NumPy 2.4.2 has them.

public sealed class NDPolynomial : NDPolyBase, IDisposable, IFormattable
Inheritance
NDPolynomial
Implements
Inherited Members

Remarks

See NDPolyBase for the ownership rule (dispose every series, operator results included) and the C# spelling of NumPy's protocol. NumPy's class object Polynomial is Class (also every series' __class__): the class attributes domain, window, maxpower and basis_name keep NumPy's names there. The class methods (identity(object, object, string), basis(object, object, object, string), fromroots(object, object, object, string), fit(object, object, object, object, object, bool, object, object, string), cast(NDPolyBase, object, object)) are static members.

https://numpy.org/doc/stable/reference/generated/numpy.polynomial.polynomial.Polynomial.html

Constructors

NDPolynomial(object, object, object, string)

NumPy's Polynomial(coef, domain=None, window=None, symbol='x'): the series with coefficients coef (low degree first), converted and copied as polyutils.as_series does.

public NDPolynomial(object coef, object domain = null, object window = null, string symbol = "x")

Parameters

coef object

The coefficients: a 1-D array_like (a C# array, an NDArray, a Python list / tuple, a scalar); integers become float64 (a bool array has no common type), a float16 / float32 / complex array keeps its dtype.

domain object

The domain (two numbers), or null for the class default (shared, not copied).

window object

The window (two numbers), or null for the class default.

symbol string

The variable's name for printing: a Python identifier.

Exceptions

ValueError

Coefficient array is empty, Coefficient array is not 1-d, Coefficient arrays have no common type (a bool array), Domain has wrong number of elements., Window has wrong number of elements., Symbol string must be a valid Python identifier.

TypeError

Symbol must be a non-empty string (a null symbol).

NotSupportedException

Coefficients NumPy keeps as an OBJECT array (None, a Python int past uint64, a list holding a non-number).

Properties

Class

NumPy's class object Polynomial: its class attributes under NumPy's names — NDPolynomial.Class.domain is NumPy's Polynomial.domain, likewise window, maxpower and basis_name — and its name / module. The same object as __class__ of every Polynomial series. Footgun: its attributes are process-wide state, read by every series of the class without its own (see NDPolyClass).

public static NDPolyClass Class { get; }

Property Value

NDPolyClass

Methods

Deconstruct(out NDPolynomial, out (NDArray residuals, NDArray rank, NDArray singular_values, NDArray rcond))

NumPy's series, [resid, rank, sv, rcond] = Polynomial.fit(..., full=True): the fitted series and lstsq's statistics (the residual sums of squares, the rank, the singular values, the rcond used).

public void Deconstruct(out NDPolynomial series, out (NDArray residuals, NDArray rank, NDArray singular_values, NDArray rcond) status)

Parameters

series NDPolynomial

This series.

status (NDArray, NDArray, NDArray, NDArray)

The statistics, in NumPy's order. The caller owns them (no scope tracks them; the garbage collector releases them).

Exceptions

ValueError

The series is not the result of a fit(..., full: true) (NumPy's series does not unpack either).

__divmod__(object)

NumPy's divmod(p, other) (divmod): the quotient and the remainder.

public (NDPolynomial quo, NDPolynomial rem) __divmod__(object other)

Parameters

other object

The divisor.

Returns

(NDPolynomial quo, NDPolynomial rem)

(quo, rem), two new series of this class.

Exceptions

TypeError

See NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand).

ZeroDivisionError

A zero divisor.

__floordiv__(object)

NumPy's p // other (floordiv, then CPython's fallbacks): the quotient of divmod(p, other).

public override NDPolynomial __floordiv__(object other)

Parameters

other object

The divisor: a series of this class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The quotient series.

Exceptions

TypeError

See NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand).

ZeroDivisionError

A zero divisor.

__pow__(object)

NumPy's p ** n (pow): self._pow(self.coef, n, maxpower=self.maxpower) — no try/except, so every error of the power argument propagates — in a new series.

public override NDPolynomial __pow__(object power)

Parameters

power object

The power: a non-negative integer (Python's int(pow) and power != pow decide: 2.0 and True work, 2.5 and '2' do not).

Returns

NDPolynomial

The new series.

Exceptions

ValueError

Power must be a non-negative integer., Power is too large (above maxpower), int()'s ValueErrors.

TypeError

int() refuses the power: int() argument must be a string, a bytes-like object or a real number, not 'complex' (a series: its class name), only 0-dimensional arrays can be converted to Python scalars.

OverflowError

An infinite power.

__rdivmod__(object)

NumPy's divmod(other, p) (rdivmod).

public (NDPolynomial quo, NDPolynomial rem) __rdivmod__(object other)

Parameters

other object

The dividend.

Returns

(NDPolynomial quo, NDPolynomial rem)

(quo, rem), two new series of this class.

Exceptions

TypeError

See NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand).

ZeroDivisionError

This series is zero.

__rfloordiv__(object)

NumPy's other // p (rfloordiv): the quotient of divmod(other, p).

public override NDPolynomial __rfloordiv__(object other)

Parameters

other object

The dividend.

Returns

NDPolynomial

The quotient series.

Exceptions

TypeError

See NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand).

ZeroDivisionError

This series is zero.

basis(object, object, object, string)

NumPy's Polynomial.basis(deg, domain=None, window=None, symbol='x'): the basis polynomial of degree deg (coefficients [0, …, 0, 1]).

public static NDPolynomial basis(object deg, object domain = null, object window = null, string symbol = "x")

Parameters

deg object

The degree: a non-negative integer (Python's int() and != decide).

domain object

The domain, or null for the class default.

window object

The window, or null for the class default.

symbol string

The symbol.

Returns

NDPolynomial

The basis series.

Exceptions

ValueError

deg must be non-negative integer.

TypeError

int() refuses deg.

cast(NDPolyBase, object, object)

NumPy's Polynomial.cast(series, domain=None, window=None): series converted to this class (series.convert(domain, Polynomial, window)).

public static NDPolynomial cast(NDPolyBase series, object domain = null, object window = null)

Parameters

series NDPolyBase

The series to convert (any of the six classes).

domain object

The domain, or null for the class default.

window object

The window, or null for the class default.

Returns

NDPolynomial

The converted series.

Exceptions

AttributeError

series is null.

copy()

NumPy's copy(): self.class(self.coef, self.domain, self.window, self.symbol) — a new series with copies of the coefficients, the domain and the window (a class default is copied too: the copy owns its own).

public override NDPolynomial copy()

Returns

NDPolynomial

The copy.

Exceptions

ValueError

An assigned domain or window of the wrong length (the constructor's check).

cutdeg(object)

NumPy's cutdeg(deg): self.truncate(deg + 1) — the series cut to degree deg, with Python's + on whatever deg is (a float 1.0 works, 1.5 fails truncate's integer check, a str fails the +).

public override NDPolynomial cutdeg(object deg)

Parameters

deg object

The degree: a non-negative integer (anything whose + 1 truncate accepts).

Returns

NDPolynomial

The new series.

Exceptions

ValueError

size must be a positive integer.

TypeError

Python's + refuses deg (can only concatenate str (not "int") to str, unsupported operand type(s) for +: 'NoneType' and 'int'), or int() refuses the sum (an array of one or more dims).

deriv(int)

NumPy's deriv(m=1): {p}der(self.coef, m, scl) in a new series, with the map's scale as the chain rule's factor (the derivative is taken in the window variable).

public override NDPolynomial deriv(int m = 1)

Parameters

m int

The order (≥ 0).

Returns

NDPolynomial

The new series (the same domain and window).

Exceptions

ValueError

The order of derivation must be non-negative.

fit(object, object, object, object, object, bool, object, object, string)

NumPy's Polynomial.fit(x, y, deg, domain=None, rcond=None, full=False, w=None, window=None, symbol='x'): the least-squares fit of this basis to the points, on a domain covering x by default (mapped onto the window, which keeps the problem well conditioned).

public static NDPolynomial fit(object x, object y, object deg, object domain = null, object rcond = null, bool full = false, object w = null, object window = null, string symbol = "x")

Parameters

x object

The sample points (1-D).

y object

The values (1-D, or 2-D with one data set per column).

deg object

The degree, or a 1-D list of the degrees to fit.

domain object

null: the smallest interval holding x (widened by 1 when x is constant); an empty list: the class default; otherwise the domain.

rcond object

The relative cutoff of small singular values, or null for len(x)·eps.

full bool

Also keep lstsq's statistics: var (s, (resid, rank, sv, rcond)) = NDPolynomial.fit(…, full: true).

w object

Weights (1-D), or null.

window object

The window, or null for the class default.

symbol string

The symbol.

Returns

NDPolynomial

The fitted series (deconstructible into the series and the statistics when full).

Exceptions

ValueError

expected deg >= 0 and the fit's other checks; the constructor's errors.

TypeError

The fit's argument errors (expected 1D vector for x, …).

MissingBackendException

No LAPACK backend: lstsq needs NumSharp.Interop.OpenBLAS.

fromroots(object, object, object, string)

NumPy's Polynomial.fromroots(roots, domain=[], window=None, symbol='x'): the series (x - r[0])·(x - r[1])·…, built in the window variable (fromroots(off + scl·roots) / scl**deg).

public static NDPolynomial fromroots(object roots, object domain, object window = null, string symbol = "x")

Parameters

roots object

The roots (1-D).

domain object

Omitted or an empty list: the class default (NumPy's []); null: the roots' own interval (NumPy's None, getdomain(roots)); otherwise the domain.

window object

The window, or null for the class default.

symbol string

The symbol.

Returns

NDPolynomial

The series.

Exceptions

ValueError

Empty or non-1-d roots; a domain / window the constructor refuses.

IndexError

An empty domain array (mapparms' indexing).

identity(object, object, string)

NumPy's Polynomial.identity(domain=None, window=None, symbol='x'): the series whose value at every x is x (in this basis, mapped through the domain and window).

public static NDPolynomial identity(object domain = null, object window = null, string symbol = "x")

Parameters

domain object

The domain, or null for the class default.

window object

The window, or null for the class default.

symbol string

The symbol.

Returns

NDPolynomial

The identity series.

Exceptions

ValueError

A domain / window the constructor refuses; an invalid symbol.

IndexError

A domain or window shorter than two.

integ(int, object, object)

NumPy's integ(m=1, k=[], lbnd=None): the definite integral in a new series. NumPy integrates in the WINDOW variable, so the lower bound is mapped there (lbnd = off + scl*lbnd, a NumPy scalar; 0 for None) and every order is scaled by 1./scl — then {p}int(self.coef, m, k, lbnd, 1./scl).

public override NDPolynomial integ(int m = 1, object k = null, object lbnd = null)

Parameters

m int

The number of integrations (≥ 0).

k object

The integration constants (null for NumPy's []): a scalar or a sequence, at most m of them, missing ones 0.

lbnd object

The lower bound in the DOMAIN variable: null for NumPy's None (the window's 0), or a scalar.

Returns

NDPolynomial

The new series (the same domain and window).

Exceptions

ValueError

The order of integration must be non-negative, Too many integration constants, lbnd must be a scalar. (an array bound).

TypeError

A sequence or str bound: can't multiply sequence by non-int of type 'numpy.float64' (the scale's NumPy type); another object NumPy's object loop refuses.

trim(object)

NumPy's trim(tol=0): pu.trimcoef(self.coef, tol) in a new series — the trailing coefficients whose magnitude is at most tol removed (all of them leaves one zero).

public override NDPolynomial trim(object tol)

Parameters

tol object

The tolerance: omitted for NumPy's default 0, or a Python / NumPy number (see np.polynomial.polyutils.trimcoef). An explicit null is NumPy's tol=None, which trimcoef's tol < 0 refuses.

Returns

NDPolynomial

The new series.

Exceptions

ValueError

tol must be non-negative.

TypeError

A tolerance that does not compare with 0 (complex, str, None).

truncate(object)

NumPy's truncate(size): isize = int(size); isize != size or isize < 1 raises; then the first isize coefficients (all of them when there are fewer) in a new series.

public override NDPolynomial truncate(object size)

Parameters

size object

The length: a positive integer (Python's int() and != decide: 2.0 works, 2.5 and '2' do not).

Returns

NDPolynomial

The new series.

Exceptions

ValueError

size must be a positive integer; or int()'s own ValueError (a NaN, an unparsable str — a parsable one fails the !=).

TypeError

int() refuses size (None, complex, a list, an array of one or more dims).

OverflowError

An infinity.

Operators

operator +(NDArray, NDPolynomial)

NumPy's other + p: the other operand declines, then the series' radd.

public static NDPolynomial operator +(NDArray a, NDPolynomial b)

Parameters

a NDArray

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The sum.

operator +(NDPolynomial, NDArray)

NumPy's p + other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator +(NDPolynomial a, NDArray b)

Parameters

a NDPolynomial

The series.

b NDArray

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The sum.

operator +(NDPolynomial, Array)

NumPy's p + seq for a C# array (p + new[] { 1.0, 2.0 }, NumPy's p + [1, 2]): an overload of its own because C# would otherwise convert the array to an NDArray at the call site and bind operator +(NDPolyBase, NDArray), leaving that temporary to the garbage collector. The array is read as NumPy reads an ndarray operand.

public static NDPolynomial operator +(NDPolynomial a, Array b)

Parameters

a NDPolynomial

The series.

b Array

The coefficients.

Returns

NDPolynomial

The sum.

operator +(NDPolynomial, object)

NumPy's p + other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator +(NDPolynomial a, object b)

Parameters

a NDPolynomial

The series.

b object

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The sum.

operator +(NDPolynomial, object[])

NumPy's p + other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator +(NDPolynomial a, object[] b)

Parameters

a NDPolynomial

The series.

b object[]

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The sum.

operator +(NDPolynomial, string)

NumPy's p + "text", a TypeError as in NumPy: an overload of its own so the C# string reaches the protocol as Python's str, not through NumSharp's string-to-char-array conversion (whose temporary would be left to the garbage collector). Footgun: p + null is ambiguous between this overload and the object[] one; NumPy's p + None is p + (object)null.

public static NDPolynomial operator +(NDPolynomial a, string b)

Parameters

a NDPolynomial

The series.

b string

The text.

Returns

NDPolynomial

Never: NumPy's TypeError.

operator +(Array, NDPolynomial)

NumPy's other + p: the other operand declines, then the series' radd.

public static NDPolynomial operator +(Array a, NDPolynomial b)

Parameters

a Array

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The sum.

operator +(IList, NDPolynomial)

NumPy's other + p: the other operand declines, then the series' radd.

public static NDPolynomial operator +(IList a, NDPolynomial b)

Parameters

a IList

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The sum.

operator +(object[], NDPolynomial)

NumPy's other + p: the other operand declines, then the series' radd.

public static NDPolynomial operator +(object[] a, NDPolynomial b)

Parameters

a object[]

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The sum.

operator +(ITuple, NDPolynomial)

NumPy's other + p: the other operand declines, then the series' radd.

public static NDPolynomial operator +(ITuple a, NDPolynomial b)

Parameters

a ITuple

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The sum.

operator +(string, NDPolynomial)

NumPy's other + p: the other operand declines, then the series' radd.

public static NDPolynomial operator +(string a, NDPolynomial b)

Parameters

a string

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The sum.

operator /(NDArray, NDPolynomial)

NumPy's other / p: always CPython's TypeError (rtruediv declines every operand).

public static NDPolynomial operator /(NDArray a, NDPolynomial b)

Parameters

a NDArray

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

Never returns.

operator /(NDPolynomial, NDArray)

NumPy's p / other: only a number divides (p // number).

public static NDPolynomial operator /(NDPolynomial a, NDArray b)

Parameters

a NDPolynomial

The series.

b NDArray

A Python or NumPy number (not a bool).

Returns

NDPolynomial

The quotient.

operator /(NDPolynomial, Array)

NumPy's p / seq for a C# array (p / new[] { 1.0, 2.0 }, NumPy's p / [1, 2]): an overload of its own because C# would otherwise convert the array to an NDArray at the call site and bind operator /(NDPolyBase, NDArray), leaving that temporary to the garbage collector. The array is read as NumPy reads an ndarray operand.

public static NDPolynomial operator /(NDPolynomial a, Array b)

Parameters

a NDPolynomial

The series.

b Array

The coefficients.

Returns

NDPolynomial

The quotient.

operator /(NDPolynomial, object)

NumPy's p / other: only a number divides (p // number).

public static NDPolynomial operator /(NDPolynomial a, object b)

Parameters

a NDPolynomial

The series.

b object

A Python or NumPy number (not a bool).

Returns

NDPolynomial

The quotient.

operator /(NDPolynomial, object[])

NumPy's p / other: only a number divides (p // number).

public static NDPolynomial operator /(NDPolynomial a, object[] b)

Parameters

a NDPolynomial

The series.

b object[]

A Python or NumPy number (not a bool).

Returns

NDPolynomial

The quotient.

operator /(NDPolynomial, string)

NumPy's p / "text", a TypeError as in NumPy: an overload of its own so the C# string reaches the protocol as Python's str, not through NumSharp's string-to-char-array conversion (whose temporary would be left to the garbage collector). Footgun: p / null is ambiguous between this overload and the object[] one; NumPy's p / None is p / (object)null.

public static NDPolynomial operator /(NDPolynomial a, string b)

Parameters

a NDPolynomial

The series.

b string

The text.

Returns

NDPolynomial

Never: NumPy's TypeError.

operator /(Array, NDPolynomial)

NumPy's other / p: always CPython's TypeError (rtruediv declines every operand).

public static NDPolynomial operator /(Array a, NDPolynomial b)

Parameters

a Array

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

Never returns.

operator /(IList, NDPolynomial)

NumPy's other / p: always CPython's TypeError (rtruediv declines every operand).

public static NDPolynomial operator /(IList a, NDPolynomial b)

Parameters

a IList

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

Never returns.

operator /(object[], NDPolynomial)

NumPy's other / p: always CPython's TypeError (rtruediv declines every operand).

public static NDPolynomial operator /(object[] a, NDPolynomial b)

Parameters

a object[]

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

Never returns.

operator /(ITuple, NDPolynomial)

NumPy's other / p: always CPython's TypeError (rtruediv declines every operand).

public static NDPolynomial operator /(ITuple a, NDPolynomial b)

Parameters

a ITuple

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

Never returns.

operator /(string, NDPolynomial)

NumPy's other / p: always CPython's TypeError (rtruediv declines every operand).

public static NDPolynomial operator /(string a, NDPolynomial b)

Parameters

a string

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

Never returns.

operator %(NDArray, NDPolynomial)

NumPy's other % p: the series' rmod (a str's % formats first).

public static NDPolynomial operator %(NDArray a, NDPolynomial b)

Parameters

a NDArray

The dividend.

b NDPolynomial

The series.

Returns

NDPolynomial

The remainder.

operator %(NDPolynomial, NDArray)

NumPy's p % other: the remainder of divmod(p, other).

public static NDPolynomial operator %(NDPolynomial a, NDArray b)

Parameters

a NDPolynomial

The series.

b NDArray

The divisor.

Returns

NDPolynomial

The remainder.

operator %(NDPolynomial, Array)

NumPy's p % seq for a C# array (p % new[] { 1.0, 2.0 }, NumPy's p % [1, 2]): an overload of its own because C# would otherwise convert the array to an NDArray at the call site and bind operator %(NDPolyBase, NDArray), leaving that temporary to the garbage collector. The array is read as NumPy reads an ndarray operand.

public static NDPolynomial operator %(NDPolynomial a, Array b)

Parameters

a NDPolynomial

The series.

b Array

The coefficients.

Returns

NDPolynomial

The remainder.

operator %(NDPolynomial, object)

NumPy's p % other: the remainder of divmod(p, other).

public static NDPolynomial operator %(NDPolynomial a, object b)

Parameters

a NDPolynomial

The series.

b object

The divisor.

Returns

NDPolynomial

The remainder.

operator %(NDPolynomial, object[])

NumPy's p % other: the remainder of divmod(p, other).

public static NDPolynomial operator %(NDPolynomial a, object[] b)

Parameters

a NDPolynomial

The series.

b object[]

The divisor.

Returns

NDPolynomial

The remainder.

operator %(NDPolynomial, string)

NumPy's p % "text", a TypeError as in NumPy: an overload of its own so the C# string reaches the protocol as Python's str, not through NumSharp's string-to-char-array conversion (whose temporary would be left to the garbage collector). Footgun: p % null is ambiguous between this overload and the object[] one; NumPy's p % None is p % (object)null.

public static NDPolynomial operator %(NDPolynomial a, string b)

Parameters

a NDPolynomial

The series.

b string

The text.

Returns

NDPolynomial

Never: NumPy's TypeError.

operator %(Array, NDPolynomial)

NumPy's other % p: the series' rmod (a str's % formats first).

public static NDPolynomial operator %(Array a, NDPolynomial b)

Parameters

a Array

The dividend.

b NDPolynomial

The series.

Returns

NDPolynomial

The remainder.

operator %(IList, NDPolynomial)

NumPy's other % p: the series' rmod (a str's % formats first).

public static NDPolynomial operator %(IList a, NDPolynomial b)

Parameters

a IList

The dividend.

b NDPolynomial

The series.

Returns

NDPolynomial

The remainder.

operator %(object[], NDPolynomial)

NumPy's other % p: the series' rmod (a str's % formats first).

public static NDPolynomial operator %(object[] a, NDPolynomial b)

Parameters

a object[]

The dividend.

b NDPolynomial

The series.

Returns

NDPolynomial

The remainder.

operator %(ITuple, NDPolynomial)

NumPy's other % p: the series' rmod (a str's % formats first).

public static NDPolynomial operator %(ITuple a, NDPolynomial b)

Parameters

a ITuple

The dividend.

b NDPolynomial

The series.

Returns

NDPolynomial

The remainder.

operator %(string, NDPolynomial)

NumPy's other % p: the series' rmod (a str's % formats first).

public static NDPolynomial operator %(string a, NDPolynomial b)

Parameters

a string

The dividend.

b NDPolynomial

The series.

Returns

NDPolynomial

The remainder.

operator *(NDArray, NDPolynomial)

NumPy's other * p: the series' rmul.

public static NDPolynomial operator *(NDArray a, NDPolynomial b)

Parameters

a NDArray

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The product.

operator *(NDPolynomial, NDArray)

NumPy's p * other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator *(NDPolynomial a, NDArray b)

Parameters

a NDPolynomial

The series.

b NDArray

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The product.

operator *(NDPolynomial, Array)

NumPy's p * seq for a C# array (p * new[] { 1.0, 2.0 }, NumPy's p * [1, 2]): an overload of its own because C# would otherwise convert the array to an NDArray at the call site and bind operator *(NDPolyBase, NDArray), leaving that temporary to the garbage collector. The array is read as NumPy reads an ndarray operand.

public static NDPolynomial operator *(NDPolynomial a, Array b)

Parameters

a NDPolynomial

The series.

b Array

The coefficients.

Returns

NDPolynomial

The product.

operator *(NDPolynomial, object)

NumPy's p * other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator *(NDPolynomial a, object b)

Parameters

a NDPolynomial

The series.

b object

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The product.

operator *(NDPolynomial, object[])

NumPy's p * other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator *(NDPolynomial a, object[] b)

Parameters

a NDPolynomial

The series.

b object[]

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The product.

operator *(NDPolynomial, string)

NumPy's p * "text", a TypeError as in NumPy: an overload of its own so the C# string reaches the protocol as Python's str, not through NumSharp's string-to-char-array conversion (whose temporary would be left to the garbage collector). Footgun: p * null is ambiguous between this overload and the object[] one; NumPy's p * None is p * (object)null.

public static NDPolynomial operator *(NDPolynomial a, string b)

Parameters

a NDPolynomial

The series.

b string

The text.

Returns

NDPolynomial

Never: NumPy's TypeError.

operator *(Array, NDPolynomial)

NumPy's other * p: the series' rmul.

public static NDPolynomial operator *(Array a, NDPolynomial b)

Parameters

a Array

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The product.

operator *(IList, NDPolynomial)

NumPy's other * p: the series' rmul.

public static NDPolynomial operator *(IList a, NDPolynomial b)

Parameters

a IList

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The product.

operator *(object[], NDPolynomial)

NumPy's other * p: the series' rmul.

public static NDPolynomial operator *(object[] a, NDPolynomial b)

Parameters

a object[]

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The product.

operator *(ITuple, NDPolynomial)

NumPy's other * p: the series' rmul.

public static NDPolynomial operator *(ITuple a, NDPolynomial b)

Parameters

a ITuple

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The product.

operator *(string, NDPolynomial)

NumPy's other * p: the series' rmul.

public static NDPolynomial operator *(string a, NDPolynomial b)

Parameters

a string

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The product.

operator -(NDArray, NDPolynomial)

NumPy's other - p: the series' rsub.

public static NDPolynomial operator -(NDArray a, NDPolynomial b)

Parameters

a NDArray

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The difference.

operator -(NDPolynomial, NDArray)

NumPy's p - other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator -(NDPolynomial a, NDArray b)

Parameters

a NDPolynomial

The series.

b NDArray

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The difference.

operator -(NDPolynomial, Array)

NumPy's p - seq for a C# array (p - new[] { 1.0, 2.0 }, NumPy's p - [1, 2]): an overload of its own because C# would otherwise convert the array to an NDArray at the call site and bind operator -(NDPolyBase, NDArray), leaving that temporary to the garbage collector. The array is read as NumPy reads an ndarray operand.

public static NDPolynomial operator -(NDPolynomial a, Array b)

Parameters

a NDPolynomial

The series.

b Array

The coefficients.

Returns

NDPolynomial

The difference.

operator -(NDPolynomial, object)

NumPy's p - other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator -(NDPolynomial a, object b)

Parameters

a NDPolynomial

The series.

b object

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The difference.

operator -(NDPolynomial, object[])

NumPy's p - other (see NumSharp.NDPolyBase.PyBinary(NumSharp.PyBinOp, in NumSharp.PyOperand, in NumSharp.PyOperand)).

public static NDPolynomial operator -(NDPolynomial a, object[] b)

Parameters

a NDPolynomial

The series.

b object[]

A series of the same class, a number, an array or a sequence of coefficients.

Returns

NDPolynomial

The difference.

operator -(NDPolynomial, string)

NumPy's p - "text", a TypeError as in NumPy: an overload of its own so the C# string reaches the protocol as Python's str, not through NumSharp's string-to-char-array conversion (whose temporary would be left to the garbage collector). Footgun: p - null is ambiguous between this overload and the object[] one; NumPy's p - None is p - (object)null.

public static NDPolynomial operator -(NDPolynomial a, string b)

Parameters

a NDPolynomial

The series.

b string

The text.

Returns

NDPolynomial

Never: NumPy's TypeError.

operator -(Array, NDPolynomial)

NumPy's other - p: the series' rsub.

public static NDPolynomial operator -(Array a, NDPolynomial b)

Parameters

a Array

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The difference.

operator -(IList, NDPolynomial)

NumPy's other - p: the series' rsub.

public static NDPolynomial operator -(IList a, NDPolynomial b)

Parameters

a IList

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The difference.

operator -(object[], NDPolynomial)

NumPy's other - p: the series' rsub.

public static NDPolynomial operator -(object[] a, NDPolynomial b)

Parameters

a object[]

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The difference.

operator -(ITuple, NDPolynomial)

NumPy's other - p: the series' rsub.

public static NDPolynomial operator -(ITuple a, NDPolynomial b)

Parameters

a ITuple

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The difference.

operator -(string, NDPolynomial)

NumPy's other - p: the series' rsub.

public static NDPolynomial operator -(string a, NDPolynomial b)

Parameters

a string

The other operand.

b NDPolynomial

The series.

Returns

NDPolynomial

The difference.

operator -(NDPolynomial)

NumPy's -p.

public static NDPolynomial operator -(NDPolynomial a)

Parameters

a NDPolynomial

The series.

Returns

NDPolynomial

The negated series.

operator +(NDPolynomial)

NumPy's +p: the series itself (pos returns self).

public static NDPolynomial operator +(NDPolynomial a)

Parameters

a NDPolynomial

The series.

Returns

NDPolynomial

a.