cupy.poly1d#

class cupy.poly1d(c_or_r, r=False, variable=None)[source]#

A one-dimensional polynomial class.

Note

This is a counterpart of an old polynomial class in NumPy. Note that the new NumPy polynomial API (numpy.polynomial.polynomial) has different convention, e.g. order of coefficients is reversed.

Parameters
  • c_or_r (array_like) – The polynomial’s coefficients in decreasing powers

  • r (bool, optional) – If True, c_or_r specifies the polynomial’s roots; the default is False.

  • variable (str, optional) – Changes the variable used when printing the polynomial from x to variable

See also

numpy.poly1d

Methods

__call__(*args, **kwargs)#

Call self as a function.

__getitem__(key, /)#

Return self[key].

__setitem__(key, value, /)#

Set self[key] to value.

__len__()#

Return len(self).

__iter__()#

Implement iter(self).

deriv(self, m=1)#
get(self, stream=None)#

Returns a copy of poly1d object on host memory.

Parameters

stream (cupy.cuda.Stream) – CUDA stream object. If it is given, the copy runs asynchronously. Otherwise, the copy is synchronous. The default uses CUDA stream object of the current context.

Returns

Copy of poly1d object on host memory.

Return type

numpy.poly1d

integ(self, m=1, k=0)#
set(self, polyin, stream=None)#

Copies a poly1d object on the host memory to cupy.poly1d.

Parameters
  • polyin (numpy.poly1d) – The source object on the host memory.

  • stream (cupy.cuda.Stream) – CUDA stream object. If it is given, the copy runs asynchronously. Otherwise, the copy is synchronous. The default uses CUDA stream object of the current context.

__eq__(value, /)#

Return self==value.

__ne__(value, /)#

Return self!=value.

__lt__(value, /)#

Return self<value.

__le__(value, /)#

Return self<=value.

__gt__(value, /)#

Return self>value.

__ge__(value, /)#

Return self>=value.

Attributes

c#
coef#
coefficients#
coeffs#
o#
order#
r#
roots#
variable#